Sec11.2TanPlanes.mws

__A First Look at Tangent Planes__

Worksheet by Mike May, S.J.- maymk@slu.edu

`> `

A first naive way to look at tangent planes is to take the tangent lines to the two cross section curves at a point and turn those lines into a plane. (The naive approach works if the function is differentiable, but that is a detail we will look at later.) This worksheet is intended as a demonstration of that technique.

**Constructing a plane defined by tangent lines to cross sections**

We start by defining a function that we will work with. Let z=f(x,y) =x^2-3*x*y+y^2.

It is first of all useful to look at the graph.

`> `
**f:= (x,y) -> x^2-3*x*y+y^2;**

`> `
**plot3d( f(x,y), x=-5..5, y=-5..5, axes=framed);**

Notice that the graph goes up in one direction and down in another. We are at a saddle, so tangent planes will tend to cut the surface, much as the tangent line to a cubic curve cuts the curve at the inflection point.

To find the tangent plane we considered cross sections.

We will start with the point (-1,3). We start by finding the z-value at the point on the graph.

Next compute the functions in one variable that we obtain by holding either x or y constant.

Now compute the derivatives of the functions in one variable and substitute in the point to find an x-slope and y-slope.

`> `

`> `
**graph := plot3d({f(x,y)}, x=0..5, y=0..5, color=blue):**

`> `
**tanPlane :=plot3d({19-11*(x+1)+9*(y-3)}, x=0..5, y=0..5, color=green):**

`> `
**plots[display](graph, tanPlane);**

`> `
**?plots,spacecurve**

`> `
**plot3d(f(x,y),x=-10..10, y=-10..10, view=-100..100, axes=normal, color=blue);**

`> `
**x0 := -1; y0 := 3;**

z0 := f(x0, y0);

`> `
**fx := f(x,y0); fy := f(x0,y);**

`> `
**Dfx := diff(fx,x); mx := subs(x=x0,Dfx);**

Dfy := diff(fy,y); my := subs(y=y0,Dfy);

We see that the x slope is -11, the y-slope is 9, and the z value is 19.

Let's try plotting the surface and the plane we have obtained.

The two surfaces look like good approximations to each other. Let us clean up the picture with some more magical Maple code.

Since we want to plot the cross-sections of the graph, we use the command spacecurve in the plots package

`> `
**with(plots):**

s1 := plot3d(f(x,y), x=-3..1, y=1..5,

view=0..40, color=blue):

s2 := plot3d(19-11*(x+1)+9*(y-3), x=-3..1, y=1..5,

view=0..40, color=red):

c1 := spacecurve([x,y0,f(x,y0)], x=-3..1,

color=green, thickness =3):

c2 := spacecurve([x0,y,f(x0,y)], y=1..5,

color=yellow, thickness =3):

display3d({s1,s2, c1, c2}, axes=boxed);

`Warning, the name changecoords has been redefined`

`> `

Thus we see that we have constructed a point that contains the appropriate point of the surface and contains the two tangent lines.

**An automated approach**

We can set up a block of code that does the work of the example all in one step.

`> `
**f := (x,y) -> x^2-3*x*y+y^2;**

x0:=-1; y0:=3;

width := 5:

z0:=f(x0,y0);

fx:=f(x,y0);

Dfx := diff(fx,x);

xslope:= subs(x=x0,Dfx);

fy:=f(x0,y);

Dfy := diff(fy,y);

yslope:= subs(y=y0,Dfy);

fsurface := plot3d(f(x,y), x=x0-width..x0+width, y=y0-width..y0+width,

color=red):

ftanplane := plot3d(z0+xslope*(x-x0)+yslope*(y-y0), x=x0-width..x0+width,

y=y0-width..y0+width, color=blue):

xcurve := spacecurve([x,y0,f(x,y0)], x=x0-width..x0+width,

color=green, thickness =3):

ycurve := spacecurve([x0,y,f(x0,y)], y=y0-width..y0+width,

color=yellow, thickness =3):

display3d({fsurface,ftanplane, xcurve, ycurve}, axes=boxed);

The advantage of this set-up is that we can consider a different example by modifying the first 2 lines of the block of code above and re-executing the block of code.

`> `

**Exercises**

`> `

1) Modify the code above to examine the function
at two points of your choosing. Verify that the plane obtained is tangent to the surface. (You may want to reduce the width variable to zoom in on the point of tangency.)

2) Modify the code above to examine the function
at the points {(-1, -1), (-1, 1), (1, -1), (1,1)}. Explain what you find.

`> `

`> `