**Tangent Planes to Surfaces in Maple**

**Copyright © 1999, 2001 by James F. Hurley, University of Connecticut Department of Mathematics, U-9, Storrs CT 06269-3009. All rights reserved.**

The interactive version of this worksheet is in the Math 210 folder within the Workspace volume in MSB 203 (g3server: for instructions on remote access, see the worksheet
*Space Curves*
.)

This worksheet illustrates how to plot a surface in
that is the graph of a function
*f: *
®
together with the tangent plane to the graph at a point
*P*
(
*a*
,
*b*
,
*f*
(
*a*
,
*b*
))

.
**
**
Consider the function

`> `
**with(plots):
f := (x, y) -> x/y:
surf := plot3d( f(x, y), x = -3..3, y = -3..3, axes = boxed ):
xaxis := spacecurve([t, 0, 0, t = -3..5, color = magenta]) :
yaxis := spacecurve([0, t, 0, t = -3..5, color = magenta]) :
zaxis := spacecurve([0, 0, t, t = -3..12, color = magenta]) :
labx := textplot3d([5.5, 0, -.2, `x`], color = magenta):
laby := textplot3d([0,5.5, -.2, `y`], color = magenta):
labz := textplot3d([0, 0, 13, `z`], color = magenta):
display(surf, xaxis, yaxis, zaxis, labx, laby,labz);**

The tangent plane to the graph of
*f*
at the point
*P*
has equation

*z*
Ð 2 =
(2, 1) (
*x*
Ð 2) +
(2, 1) (
*y*
Ð 1)
.

For this function, it is easy to calculate the partial derivatives:

(
*x*
,
*y*
)
=
Þ
(2, 1)
=
1,
(
*x*
,
*y*
)
=
Þ
(2, 1)
=
.

Thus the tangent plane has equation

* z*
Ð 2 =
.

The following routine plots that plane.

`> `
**with(plots):
f := (x, y) -> 2 + (x - 2) - 2*(y - 1):
tanplane := plot3d( f(x, y), x = 1..3, y = 0..2, color = red, axes = boxed ):
xaxis := spacecurve([t, 0, 0, t = -3..5, color = magenta]) :
yaxis := spacecurve([0, t, 0, t = -3..5, color = magenta]) :
zaxis := spacecurve([0, 0, t, t = -3..12, color = magenta]) :
labx := textplot3d([5.5, 0, -.2, `x`], color = magenta):
laby := textplot3d([0,5.5, -.2, `y`], color = magenta):
labz := textplot3d([0, 0, 13, `z`], color = magenta):
display(tanplane,xaxis, yaxis, zaxis,labx,laby,labz);
**

The follwoing Maple command displays the two plots together. The tangent plane resembles a patch on the surface.

`> `
**display(surf, tanplane, xaxis, yaxis, zaxis, labx, laby,labz);**

`> `

A convenient feature of Maple lets you direct output to an untitled window, which you can then print as an individual graphical image without the need to print the entire worksheet or to copy the image to a new document. To print output to such a window, simply add the command

plotsetup(window);

directly after the
with(plots);
command. To restore plotting to the worksheet, add the following to your graphics routine right after the
with(plots);
command:

plotsetup(inline);

Try this with the last routine!