In this lab we will be graphing surfaces of the form z = f( x, y ) and their tangent planes at some point ( x0, y0, z0 ) on the surface. We will need the partial derivatives of f( x, y ) evaluated at the point ( x0, y0 ) in order to define the tangent plane. The usual equation for the tangent plane is :
fx( x0, y0 )( x - x0 ) + fy( x0, y0 )( y - y0 ) - ( z - z0 ) = 0
We will find it easier to solve for z and use the form z = fx( x0, y0 )( x - x0 ) + fy( x0, y0 )( y - y0 ) + z0.
The Mathematica notation for the partial derivative of f( x, y ) with respect to x is: D[ f[x, y], x]. To then assign x0 to x and y0 to y, we use the assignment /.{x -> x0, y -> y0 }. Thus to define the surface f( x, y ) = 4 - x2 - y2, and the point x0 = 1, y0 = 1, z0 = f( x0, y0 ), and the tangent plane to the surface at that point, type:
f[x_,y_]:=4 - x2 - y2
x0 = 1;y0 = 1;z0 = f[x0,y0]
dx = D[f[x,y],x]/.{x->x0,y->y0}
dy = D[f[x,y],y]/.{x->x0,y->y0}
p[x_,y_]:=dx*(x-x0)+dy*(y-y0)+z0
To graph the surface and the plane at the point, type:
p1 = Plot3D[f[x,y],{x,-2,2},{y,-2,2},
p2 = Plot3D[p[x,y],{x,0,2},{y,0,2},
Show[p1,p2] |
![]() |
Exercises Lab #4
1. Graph the surface z = -x2 and its tangent plane at ( 1, 1, -1 ).
2. Graph the surface z = 2sin( xy ) and its tangent plane at ( Pi/6, 1, 1 ). Change the ViewPoint to get the best view of the surface and the tangent plane.