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 R^3 that is the graph of a function f: R^2 ® R together with the tangent plane to the graph at a point P ( a , b , f ( a , b ))
.

Consider the function f with formula f ( x , y ) = x/y at the point P (2, 1, 2). The following routine, which is copied and slightly edited from one in SurfPlot , generates a plot of the graph of f . As usual, generate the plot by placing the cursor at the end of the last line of code, and pressing the Enter key. The gap in the plot calls attention to the discontinuity of f on the xz -plane.

> 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);

[Maple Plot]


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

z Ð 2 = `¶f`/`¶x` (2, 1) ( x Ð 2) + `¶f`/`¶y` (2, 1) ( y Ð 1) .

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

f[x] ( x , y ) = 1/y Þ f[x] (2, 1) = 1, f[y] ( x , y ) = (-x)/(y^2) Þ f[x] (2, 1) = -2 .

Thus the tangent plane has equation

z Ð 2 = x-2-2(y-1) .

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);

[Maple Plot]

>


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!