Tangent Planes to Surfaces in Maple

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

This worksheet shows how to use Maple to plot both the graph in R^3 of a function f: R^2 R and its tangent plane at a point P ( a , b , f ( a , b )) on the surface.

Consider first the function f with formula f ( x , y ) = y^2-2*x^2 at the point P (2, 1, -7 ). The following routine, which is copied and slightly edited from FirstSurfPlot , generates a plot of the graph of f . Note that the graph is a hyperboloid of one sheet (saddle). As usual, to see it place the cursor at the end of the last line of code and press the Enter key.

> with(plots):
f := (x, y) -> y^2 - 2*x^2:
tanpoint := pointplot3d([2,1,-7], symbol = circle, color = red):
surf := plot3d( f(x, y), x = -3..3, y = -3..3, axes = boxed ):
xaxis := spacecurve([t, 0, 0, t = -3..6, color = magenta]) :
yaxis := spacecurve([0, t, 0, t = -3..5, color = magenta]) :
zaxis := spacecurve([0, 0, t, t = -3..12, color = magenta]) :
labx := textplot3d([6.5, 0, -.2, `x`], color = magenta):
laby := textplot3d([0,5.5, -.2, `y`], color = magenta):
labz := textplot3d([0, 0, 13, `z`], color = magenta):
labP := textplot3d([2.2, 1.1, -6.8, `P`], color = red):
display(surf, tanpoint, labP, xaxis, yaxis, zaxis, labx, laby,labz);

Warning, the name changecoords has been redefined

[Maple Plot]


The tangent plane to the graph of
f at the point P (2, 1, 2) has equation

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

It is easy to calculate the partial derivatives of f :

f[x] ( x , y ) = 4 x f[x] (2, 1) = 8, f[y] ( x , y ) = 2 y f[x] (2, 1) = 2.


Thus the equation of the tangent plane at the point
P is

z+7 = -8*(x-2)+2*(y-1) .


The following routine plots the plane.

> with(plots):
f := (x, y) -> -7 - 8*(x - 2) + 2*(y - 1):
tanplane := plot3d( f(x, y), x = 1..3, y = 0..3, axes = boxed ):
tanpoint := pointplot3d([2,1,-7], symbol = circle, color = red):
xaxis := spacecurve([t, 0, 0, t = -3..6, color = magenta]) :
yaxis := spacecurve([0, t, 0, t = -3..5, color = magenta]) :
zaxis := spacecurve([0, 0, t, t = -3..12, color = magenta]) :
labx := textplot3d([6.5, 0, -.2, `x`], color = magenta):
laby := textplot3d([0,5.5, -.2, `y`], color = magenta):
labz := textplot3d([0, 0, 13, `z`], color = magenta):
labP := textplot3d([2.2, 1.1, -6.8, `P`], color = black):
display(tanplane,tanpoint,xaxis, yaxis, zaxis,labx,laby,labz, labP);

[Maple Plot]


As we have seen, Maple can display the two plots together. The following command accomplishes that. Observe that the tangent plane resembles a patch on the surface.

> display(surf, tanplane, tanpoint, xaxis, yaxis, zaxis, labx, laby,labz, labP);

[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 the graphics routine right after the with(plots); command:

plotsetup(inline);

Try this with the last routine!