Lab 3B - Tangent Planes
Math 2374 - University of Minnesota
http://www.math.umn.edu/math2374
 questions to: drake@math.umn.edu

Introduction

The last lab investigated properties of continuity, differentiability, partial derivatives, and the relationships between them. In this lab, all the functions we consider will be differentiable, which as we learned means that there's a linear transformation that approximates the function very well at each point. If the function goes from (ℝ^2)to ℝ, then the linear transformation must do the same—and in this simple and common case, we call the transformation a tangent plane. Today we'll use several different methods to find the specific plane tangent to a surface at a given point.

We'll be doing some parametric plot in this lab. If you don't like the little error messages Mathematica gives you when doing those, execute the line below. It doesn't really change how anything works, it just makes things look a bit nicer.

Off[ParametricPlot3D::ppcom]

Plotting Planes

Before we begin considering issues of tangency, let's review how to plot planes. 

The nicest situation is when we can describe the plane as a function of x and y; in that case, we can write the equation of the plane as ``z = ax + by + c'' where a, b, and c are real numbers. We can just use Plot3D in those cases; for instance, if we had z = 3x - y, we could just use

Plot3D[3  x  -  y,  {x, -2, 2}, {y, -2, 2}]

to plot the plane, adjusting the range of x and y if necessary. 

Even if we can describe a plane with a nice, easy equation, it is sometimes more convenient or enlightening to describe the plane with parametric equations. If we are given a point and two non-parallel vectors, there is a unique plane containing that point parallel to each of the vectors. Let's say our vectors are (2,3,5) and (-7,-11,13), and we wish to find the plane parallel to those two vectors passing through the point (17, 29, 0). In parametric equations, we could write

(17, 29, 0)  +  t (2, 3, 5)  +  
      s (-7, -11, 13)

where s and t range over all real numbers. To plot this plane, we use the properties of scalar multiplication and vector addition, and use ParametricPlot3D:

ParametricPlot3D[{17 + 2*t - 7*s,  29 + 3*t - 11* s,  
        5*t + 13*s},  {t, -1, 2}, {s, -1, 1}]

You can keep the parametric equation of the plane in ``un-multiplied out'' form and use ParametricPlot3D, but it may complain. Either way works; mathematically they are exactly equivalent. The following form may be easier to write.

ParametricPlot3D[{17,  29, 0}  +  t*{2, 3, 5} + 
        s*{-7, -11, 13},  {t, -1, 2}, {s, -1, 1}]

One important thing to note is that we've only plotted a small portion of the plane. Above we chose values of t and s between -1 and 1, but we can choose any range we like. The ranges on s and t don't have to be the same. You don't have to use s and t if you don't like; Mathematica will let you use pretty much any variable name you like. The world is your oyster.

Example

Plot the plane that's described by

s (0, 0, 1)  +  t (0.2,  0.2,  2)

when s and t range from 2 to 3. It won't look very good—it's ``too skinny''. Experiment with some different ranges on s and t until you get a nicer picture—one that's a little more ``square''.

Exercise 1

Are there planes that are not the graph of a function of x and y? If so, which planes are they? If there are no such planes, explain why.

Are there planes that cannot be described by a parametrization? If so, which planes are they? If there are no such planes (i.e., any plane whatsoever can be described by a parametrization), explain why.

Explain your reasoning!

Tangent Planes Via Tangent Vectors

Let's begin by plotting curves in a surface that are parallel to the coordinate planes. We're going to find the plane tangent to the surface

z  =  (x^2)  +  3  xy  +  (y^2)

at the point (1,-2,-1). If we look at the cross section of this surface where x = 1, then we will get a path that lies in the surface and is parallel to the yz plane. It's easier to see this if we plot it out; first, the surface itself.

f[x_, y_]  =  x^2  +  3 x y  +  y^2
surf  =  
      Plot3D[f[x, y],  {x, 0, 2}, {y, -3, -1},  
        Mesh -> False]

We'll use a parametric description for the curve that represents the restriction of f(x,y) to x=1. The x-value is always 1; the y-value can be arbitrary—we'll use t for that—and the z-value is described by f(1, t):

c1[t_]  =  {1,  t,  f[1, t]}
one  = 
      ParametricPlot3D[
        Evaluate[c1[t]],  {t, -3.1, -0.9}]

The parametric description of the restriction to y = -2 is very similar:

c2[s_]  =  {s,  -2,  f[s,  -2]}
two  = 
      ParametricPlot3D[Evaluate[c2[s]],  {s, -0.1, 2.1}]

Now we'll plot the surface and these curves together. I used "Mesh -> False" back in the Plot3D command to make it easier to see the curves.

Show[surf,  one, two]

Note how the paths run right through the surface. The nice thing about going to the trouble of using these paths is that the tangent vectors of the paths are also tangent to the surface. We can use those two tangent vectors to describe the plane that is tangent to the surface at the point where the curves intersect. It's easy to find the tangent vectors for the paths; we differentiate with respect to t (or s) and plug in the appropriate values of t or s. We get

(d/dt) c1 (t)  =  (0,  1,  
        2  t + 3)
(d/ds) c2 (s)  =  (1,  0,  
        2  s - 6)

The point of intersection occurs when t = -2 for c1, so the tangent vector there is (0,1,-1). The intersection is at s = 1 for c2, yielding a tangent vector of (1,0,-4). There's nothing magical about s and t being the same or being equal to one; we just need the values of s and t that place us at the point of intersection.

Now we know everything we need to describe the plane: we know a point it passes through (namely f(1,-2)) and two vectors parallel to the plane. In parametric terms, the plane is

p[s_, t_]  =  {1, -2, f[1, -2]}  +  t*{0, 1, -1}  +  
        s*{1, 0, -4}

Let's plot the plane and the surface together:

tanplane  = 
      ParametricPlot3D[
        p[s, t],  {s, -1, 1},  {t, -1, 
          1}]
Show[surf,  tanplane]

The two pictures of the plane may look quite different, but that's just because Mathematica is using different-sized boxes to plot the plane in. Use the ViewPoint command to look at the above picture from several different viewpoints and convince yourself that this plane really is tangent to the surface. Note how the plane is above the surface at some points and below it at others; that's perfectly fine. It's analogous to the line tangent to the curve y = sin x at x = 0, which goes above and beneath the curve.

In the last lab, we were very careful about differentiability, existence of partial derivatives, and the like. In this case, f(x,y) is continuous and differentiable and everything you could want. You should calculate its partial derivatives at (x,y) = (1,-2), make sure they are continuous, and compare them to the tangent vectors you found above.

Curves Not Parallel To Coordinate Planes

Another thing we discovered in the last lab is that the existence of partial derivatives does not even guarantee continuity. One rather fuzzy way to explain why is that the partials do not ``look in enough directions''. Conversely, if a function is differentiable at a point, we can ``look in any direction'' to find tangent vectors. To make this somewhat more precise, let's redo the above example, but instead of restricting f(x,y) to the planes x=1 and y=-2, let's restrict to the planes y = 2x -4 and y = -x -1.

Let's define c3 and c4 to represent the restrictions to y = 2x - 4 and y = -x-1 respectively.

c3[s_]  =  {s,  2  s  - 4,  
        f[s, 2  s - 4]}
c4[t_]  =  {t,  -t - 1,  f[t, -t - 1]}

Now let's look at the original surface with these two curves:

three  = 
      ParametricPlot3D[
        Evaluate[c3[s]],  {s, 0.5, 1.5}]
four  =  
      ParametricPlot3D[
        c4[t],  {t, -0.1, 2.1}]
Show[surf, three, four]

The tangent vectors are again found by differentiation: the tangent vectors are (1, 2, 22s-28) and (1, -1, -2t-1) and we are interested in the point when s and t both equal one, so we get (1,2,-6) and (1,-1,-3). Just like above, the vectors tangent to the paths at the point of intersection are both tangent to the surface. The resulting plane is then

p2[s_, t_]  =  {1, -2, f[1, -2]}  +  t*{1, 2, -6}  +  
        s*{1, -1, -3}
tanplane2  =  
      ParametricPlot3D[
        p2[s, t], {t, -1, 1}, {s, -1, 1}]
Show[surf,  tanplane2]

For comparison, here's the first tangent plane we found:

Show[surf, tanplane]

Are these planes the same? They better be, and in this case they are. You'll get a chance to verify that these two different methods produce identical planes.

Exercise 2

Find the plane tangent to the function g(x,y) = sin(x+y) at the point (x,y) = (π/3, π/3) using the above method. First, use two paths parallel to the xz and yz planes. Include in your answer:
	(i) the parametric descriptions of the paths in simplest form (i.e., write ``2t - 7''instead of ``g(t,-3) + 1'' or whatever);
	
	(ii) the tangent vectors at (x,y) = (π/3, π/3);
	
	(iii) the parametric description and cartesian equation of the tangent plane.

It will probably be helpful to plot graphs as we did above; you don't need to include those in your report, but you may if you like.

Now use the paths along the planes y = -(1/2)x + (π/2) and y = x and do (i), (ii),  and (iii) above. Did you get the same tangent plane in each case?

(Hint for finding cartesian equations: find a normal vector.)

Tangent Planes Via Gradients

Another way to find the tangent plane to a surface is to use the gradient vector. Recall that the gradient vector of a function f(x,y) is defined to be

\(\(\((∂f\/∂x, \ ∂f\/∂y)\)\(.\)\)\)

Hmmm. This is a two-dimensional vector, and to define a plane in 3-space, we'll definitely need vectors with three components. Sometimes we can ``convert'' two-dimensional vectors into three-dimensional ones by tacking on a zero in the third component—but that won't work here; every tangent plane would then be perpendicular to the xy plane, and that's certainly not the case! (why would every tangent plane be perpendicular to the xy plane?) We can fix this problem with some minor tweaking: given f(x,y), we'll find the gradient of a new function:

g (x, y, z)  =  z  -  f (x, y)

This is now a function of three variables, and its gradient is

\(\(\((\(-\(∂f\/∂x\)\), \ \(-\(∂f\/∂y\)\), \ 1)\)\(.\)\)\)

The crucial feature about this vector is that this vector is perpendicular to the surface z = f(x,y). To explain why, we'll need to think about level sets. The zero level set of g(x,y,z) is the set of points in 3-space where g(x,y,z) = 0, which means

0  =  z  -  f (x, y)
z  =  f (x, y).

So the zero level set is just a fancy way of referring to our original surface. g(x,y,z) is identically zero at all those points—in other words, the value of g is not changing at all. The gradient vector represents the direction of fastest change, and as you saw in lecture, the direction of fastest change is perpendicular to the directions in which the function doesn't change at all (the explanation is also in your text on pages 216-218). The gradient of g(x,y,z) is perpendicular to the zero level set of g(x,y,z), which is the same thing as our original surface. That gradient can therefore be used as a normal vector for the tangent plane. How cool is that?

Exercise 3

Use this gradient method to find the cartesian equation of the plane tangent to

	h (x, y)  =  
        Exp[-((x^2) + (y^2))]  -  
          Exp[-((x^2) + (((y - 1))^2))]

at the point (0,1, h(0,1)). Show the graph of h(x,y) and this tangent plane together on the same plot. Be sure to show your work and explain your reasoning.

Tangent Plane Conspiracy Theory

In this section, we'll learn that, despite all appearances to the contrary, the ``tangent vectors'' and ``gradient vector'' methods are surreptitiously working together and are engaged in a secret government conspiracy!

Okay, there's no government conspiracy (well...none that I'm aware of), but it is true that the two methods are working together—in fact, they are just different ways of looking at the same thing. Let's talk about directional derivatives for a bit before explaining why they're the same.

Above we were talking about partial derivatives and directions, which should remind you of directional derivatives. In the Tangent Vectors section, when specifying ``the planes y = 2x - 4 and y = -x - 1'', we were really talking about direction vectors. In the above cases, the corresponding direction vectors would be

(1/(Sqrt[5])) (1, 
        2)    and     (1/(Sqrt[2])) (1, -1),

respectively. We are basically using the slope of a line: y = 2x - 4 is a line (in two dimensions) with slope 2. The vector (1,2) is parallel to that line, and above we just normalized it. The other direction vector was obtained in a similar way. Once we know direction vectors, we just need to take the dot product with the gradient vector to find the directional derivative. The conspiracy is already unravelling.

For the function f(x,y) = (x^2)  +  3  xy +  (y^2) at the point (1,-2), and the first direction vector—call it u—we have

\(Df\_u = \ \(\((∂f\/∂x, \ ∂f\/∂y)\)·\((1\/\@5, 
            2\/\@5)\)\  = \ \(\((\(-4\), \ \(-1\))\)·\((1\/\@5, 
              2\/\@5)\)\  = \ \(-\(6\/\@5\)\)\)\)\)

We interpret this by saying ``in the direction of u, f is increasing at a rate of -6/(Sqrt[5]).'' The upshot of this is that (1/(Sqrt[5]), 2/(Sqrt[5]), -6/(Sqrt[5])) is a tangent vector to f(x,y), and it's parallel to (1,2,-6)—the tangent vector we found by using the path we described in the first section. We get this vector by taking the direction vector—a two-dimensional vector—and adding a third component, which is given by the directional derivative of f(x,y).  In general, this means that

(u1,  u2,  (Subscript[D, u]) f)

is a vector tangent to the surface z = f(x,y). You should do this same process with the other direction vector above and make sure that you end up with a tangent vector parallel to (1,-1,-3).

Of course, there's nothing special about those two directional vectors above. We can use any two non-parallel direction vectors and we'll get the same plane—which is exactly what you would hope for, since a function can have only one tangent plane (or no tangent plane, if the function isn't differentiable). The following exercise will help you expose the conspiracy—er, show that the tangent planes from the ``tangent vectors method'' and from the ``gradient vectors method'' are in fact the same. We'll do that by comparing the normal vectors of the resulting planes.

Exercise 4

As discussed in the Gradient Vector section, the gradient of z - f(x,y) represents a normal vector to the tangent plane, so our main objective is to find the normal vector of the plane we get from the tangent vector method. We'll use an arbitrary differentiable function f(x,y) and two non-parallel direction vectors u = (u1, u2) and v = (v1, v2).

	(i) Find the vectors tangent to f(x,y) in the directions of u and v. Describe them in terms of u1, u2, v1, v2, and the partials of f (∂f / ∂x and ∂f / ∂y).

	(ii) Find the normal vector of the plane spanned by those two vectors.
	
	(iii) Show that the normal vector you found in (ii) is parallel to the gradient vector of the function g(x,y,z) = z - f(x,y).
	
	(iii) What does this imply about the tangent planes found using the two different methods?