Maple Lab 2 (Spring 2007 Math 251) 

Sections 05-07 

ANSWER KEY 

Exercises 

 

Note: Use appropriate colors and plot options to make your plots look nice. The appearance of 

          you lab will be factored into your grade. You may add execution groups if you need more. 

          Please delete unused execution groups. 

> restart; 1; with(VectorCalculus); -1; with(plots); -1
 

Warning, the assigned names `<,>` and `<|>` now have a global binding 

Warning, these protected names have been redefined and unprotected: `*`, `+`, `-`, `.`, D, Vector, diff, int, limit, series 

Warning, the name changecoords has been redefined 

1. Define a function of two variables: h(x, y) = 1/4*y^2-1/9*x^2 

> h := proc (x, y) options operator, arrow; 1/4*y^2-1/9*x^2 end proc; 1
 

(Typesetting:-mprintslash)([h := proc (x, y) options operator, arrow; (VectorCalculus:-`+`)((VectorCalculus:-`*`)((VectorCalculus:-`*`)(1, 1/4), y^2), (VectorCalculus:-`-`)((VectorCalculus:-`*`)((Vect...
(Typesetting:-mprintslash)([h := proc (x, y) options operator, arrow; (VectorCalculus:-`+`)((VectorCalculus:-`*`)((VectorCalculus:-`*`)(1, 1/4), y^2), (VectorCalculus:-`-`)((VectorCalculus:-`*`)((Vect...
(Typesetting:-mprintslash)([h := proc (x, y) options operator, arrow; (VectorCalculus:-`+`)((VectorCalculus:-`*`)((VectorCalculus:-`*`)(1, 1/4), y^2), (VectorCalculus:-`-`)((VectorCalculus:-`*`)((Vect...
 

> z = h(x, y); 1
 

z = 1/4*y^2-1/9*x^2 

1(a). Define u to be the gradient vector at the point -1, -1, let v be the gradient vector at 

       the point 2, 0, and let w be the gradient vector at 0, 1. 

> gradh := Gradient(h(x, y), [x, y]); 1
 

(Typesetting:-mprintslash)([gradh := Vector[column]([[-2/9*x], [1/2*y]], [ 

> u := evalVF(gradh, `<,>`(-1, -1)); 1
 

(Typesetting:-mprintslash)([u := Vector[column]([[2/9], [(-1)/2]], [ 

> v := evalVF(gradh, `<,>`(2, 0)); 1
 

(Typesetting:-mprintslash)([v := Vector[column]([[(-4)/9], [0]], [ 

> w := evalVF(gradh, `<,>`(0, 1)); 1
 

(Typesetting:-mprintslash)([w := Vector[column]([[0], [1/2]], [ 

1(b). Graph the contours of the surface z = h(x, y)(in 2-dimensions) along with the  

       gradient vectors and w. Give the vectors extra "thickness" and make them 

       different color so they can be seen easily. 

> conPlot := contourplot(h(x, y), x = -2 .. 2, y = -2 .. 2, contours = 15); 1
 

conPlot := INTERFACE_PLOT(CURVES([[-.902499999791667173, -2.], [-.884090909053030782, -1.99590909094696966]], [[-.880000000000000448, -1.99500000004629618], [-.884090909053030782, -1.99590909094696966... 

> uPlot := arrow(`<,>`(-1, -1), u, shape = arrow, thickness = 2, color = black); 1
 

uPlot := INTERFACE_PLOT(CURVES([[-1., -1.], [-.7777777778, -1.500000000]], [[-.7972222218, -1.388888889], [-.7777777778, -1.500000000], [-.8472222218, -1.411111111]], STYLE(PATCHNOGRID), COLOUR(RGB, 0... 

> vPlot := arrow(`<,>`(2, 0), v, shape = arrow, thickness = 2, color = blue); 1
 

vPlot := INTERFACE_PLOT(CURVES([[2., 0.], [1.555555556, 0.]], [[1.644444445, -0.2222222222e-1], [1.555555556, 0.], [1.644444445, 0.2222222222e-1]], STYLE(PATCHNOGRID), COLOUR(RGB, 0., 0., 1.00000000),... 

> wPlot := arrow(`<,>`(0, 1), w, shape = arrow, thickness = 2, color = green); 1
 

wPlot := INTERFACE_PLOT(CURVES([[0., 1.], [0., 1.500000000]], [[-0.2500000000e-1, 1.400000000], [0., 1.500000000], [0.2500000000e-1, 1.400000000]], STYLE(PATCHNOGRID), COLOUR(RGB, 0., 1.00000000, 0.),... 

> display({vPlot, wPlot, uPlot, conPlot}); 1
 

Plot 

1(c). Compute normal vectors for the surface at the points and 0, 1. 

> gradLS := Gradient(z-h(x, y), [x, y, z]); 1
 

(Typesetting:-mprintslash)([gradLS := Vector[column]([[2/9*x], [-1/2*y], [1]], [ 

> nU := evalVF(gradLS, `<,>`(-1, -1, h(-1, -1))); 1
 

(Typesetting:-mprintslash)([nU := Vector[column]([[(-2)/9], [1/2], [1]], [ 

> nV := evalVF(gradLS, `<,>`(2, 0, h(2, 0))); 1
 

(Typesetting:-mprintslash)([nV := Vector[column]([[4/9], [0], [1]], [ 

> nW := evalVF(gradLS, `<,>`(0, 1, h(0, 1))); 1
 

(Typesetting:-mprintslash)([nW := Vector[column]([[0], [(-1)/2], [1]], [ 

1(d). Plot the surface z = h(x, y) in 3-dimensions using "contourplot3d" and turn on 

       the option which fills in the surface between the contours. 

       Include the normal vectors computed in 1(c) in the same plot. Give these 

       vectors the same colors as you gave the corresponding vectors in 1(b). 

> con3dPlot := contourplot3d(h(x, y), x = -2 .. 2, y = -2 .. 2, contours = 15, filled = true); 1
con3dPlot := contourplot3d(h(x, y), x = -2 .. 2, y = -2 .. 2, contours = 15, filled = true); 1
con3dPlot := contourplot3d(h(x, y), x = -2 .. 2, y = -2 .. 2, contours = 15, filled = true); 1
 

con3dPlot := INTERFACE_PLOT3D(CURVES([[-2., -.601666666701388797, -.352711111099999974], [-1.98214285712797644, -.577857142872024054, -.352711111099999974]], [[-1.96874999997395862, -.5600000000000003... 

> uPlot := arrow(`<,>`(-1, -1, h(-1, -1)), nU, shape = arrow, thickness = 2, color = black); 1
uPlot := arrow(`<,>`(-1, -1, h(-1, -1)), nU, shape = arrow, thickness = 2, color = black); 1
uPlot := arrow(`<,>`(-1, -1, h(-1, -1)), nU, shape = arrow, thickness = 2, color = black); 1
 

uPlot := INTERFACE_PLOT3D(CURVES([[-1., -1., .1388888889], [-1.222222222, -.5000000000, 1.138888889]], [[-1.218991012, -.6381055081, .9487831464], [-1.222222222, -.5000000000, 1.138888889], [-1.136564... 

> vPlot := arrow(`<,>`(2, 0, h(2, 0)), nV, shape = arrow, thickness = 2, color = blue); 1
 

vPlot := INTERFACE_PLOT3D(CURVES([[2., 0., -.4444444444], [2.444444444, 0., .5555555556]], [[2.405555556, 0., .3333333334], [2.444444444, 0., .5555555556], [2.305555556, 0., .3777777778]], STYLE(PATCH... 

> wPlot := arrow(`<,>`(0, 1, h(0, 1)), nW, shape = arrow, thickness = 2, color = green); 1
 

wPlot := INTERFACE_PLOT3D(CURVES([[0., 1., .2500000000], [0., .5000000000, 1.250000000]], [[0., .6500000000, 1.075000000], [0., .5000000000, 1.250000000], [0., .5500000000, 1.025000000]], STYLE(PATCHN... 

> display({vPlot, wPlot, uPlot, con3dPlot}, orientation = [-25, 45]); 1
 

Plot 

2. Define a function F(x, y, z) = 1/4*x^2+1/9*y^2+1/4*z^2. 

> F := proc (x, y, z) options operator, arrow; 1/4*x^2+1/9*y^2+1/4*z^2 end proc; 1
 

(Typesetting:-mprintslash)([F := proc (x, y, z) options operator, arrow; (VectorCalculus:-`+`)((VectorCalculus:-`+`)((VectorCalculus:-`*`)((VectorCalculus:-`*`)(1, 1/4), x^2), (VectorCalculus:-`*`)((V...
(Typesetting:-mprintslash)([F := proc (x, y, z) options operator, arrow; (VectorCalculus:-`+`)((VectorCalculus:-`+`)((VectorCalculus:-`*`)((VectorCalculus:-`*`)(1, 1/4), x^2), (VectorCalculus:-`*`)((V...
(Typesetting:-mprintslash)([F := proc (x, y, z) options operator, arrow; (VectorCalculus:-`+`)((VectorCalculus:-`+`)((VectorCalculus:-`*`)((VectorCalculus:-`*`)(1, 1/4), x^2), (VectorCalculus:-`*`)((V...
(Typesetting:-mprintslash)([F := proc (x, y, z) options operator, arrow; (VectorCalculus:-`+`)((VectorCalculus:-`+`)((VectorCalculus:-`*`)((VectorCalculus:-`*`)(1, 1/4), x^2), (VectorCalculus:-`*`)((V...
 

> F(x, y, z) = 1; 1
 

1/4*x^2+1/9*y^2+1/4*z^2 = 1 

2(a). Verify that the point sqrt(2), 0, -sqrt(2) is on the level surface F(x, y, z) = 1. 

       Then use the gradient operator to find a normal vector for the level surface 

       defined at this point. Call the normal vector n. 

> evalb(F(sqrt(2), 0, -sqrt(2)) = 1); 1
 

true 

> n := evalVF(Gradient(F(x, y, z), [x, y, z]), `<,>`(sqrt(2), 0, -sqrt(2))); 1
 

(Typesetting:-mprintslash)([n := Vector[column]([[1/2*2^(1/2)], [0], [-1/2*2^(1/2)]], [ 

2(b). Graph the level surface F(x, y, z) = 1 together with the its tangent plane 

       and normal line at the point  

> surfPlot := implicitplot3d(F(x, y, z) = 1, x = -4 .. 4, y = -4 .. 4, z = -4 .. 4, numpoints = 5000); 1
surfPlot := implicitplot3d(F(x, y, z) = 1, x = -4 .. 4, y = -4 .. 4, z = -4 .. 4, numpoints = 5000); 1
surfPlot := implicitplot3d(F(x, y, z) = 1, x = -4 .. 4, y = -4 .. 4, z = -4 .. 4, numpoints = 5000); 1
 

surfPlot := INTERFACE_PLOT3D(ISOSURFACE(Array( 1..20,1..20,1..20,1..4, [... unable to display content ...] )), AXESLABELS( 

> tPlane := Typesetting:-delayDotProduct(n, `<,>`(x, y, z)-`<,>`(sqrt(2), 0, -sqrt(2))) = 0; 1
 

(Typesetting:-mprintslash)([tPlane := 1/2*2^(1/2)*(x-2^(1/2))-1/2*2^(1/2)*(z+2^(1/2)) = 0], [1/2*2^(1/2)*(x-2^(1/2))-1/2*2^(1/2)*(z+2^(1/2)) = 0]) 

> tanPlot := plot3d(solve(tPlane, z), x = -4 .. 4, y = -4 .. 4); 1
 

tanPlot := INTERFACE_PLOT3D(GRID(-4. .. 4., -4. .. 4., Array( 1..25,1..25, [... unable to display content ...] )), AXESLABELS(x, y,  

> nLine := `<,>`(sqrt(2), 0, -sqrt(2))+n*t; 1
 

(Typesetting:-mprintslash)([nLine := Vector[column]([[2^(1/2)+1/2*t*2^(1/2)], [0], [-2^(1/2)-1/2*t*2^(1/2)]], [ 

> nPlot := spacecurve(nLine, t = -8 .. 3, thickness = 2, color = blue); 1
 

nPlot := INTERFACE_PLOT3D(CURVES([[-4.242640687, 0., 4.242640687], [-4.083902430, 0., 4.083902430], [-3.925164173, 0., 3.925164173], [-3.766425916, 0., 3.766425916], [-3.607687659, 0., 3.607687659], [... 

> display({nPlot, tanPlot, surfPlot}, orientation = [-44, 73]); 1
 

Plot 

3. The temperature at a point x, y on a metal plate is T(x, y) = x^4+y^4-4*x*y degrees 

   Fahrenheit. Define the function T(x, y) and graph the surface z = T(x, y). 

> T := proc (x, y) options operator, arrow; x^4+y^4-4*y*x end proc; 1
 

(Typesetting:-mprintslash)([T := proc (x, y) options operator, arrow; (VectorCalculus:-`+`)((VectorCalculus:-`+`)(x^4, y^4), (VectorCalculus:-`-`)((VectorCalculus:-`*`)((VectorCalculus:-`*`)(4, y), x)...
(Typesetting:-mprintslash)([T := proc (x, y) options operator, arrow; (VectorCalculus:-`+`)((VectorCalculus:-`+`)(x^4, y^4), (VectorCalculus:-`-`)((VectorCalculus:-`*`)((VectorCalculus:-`*`)(4, y), x)...
 

> z = T(x, y); 1
 

z = x^4+y^4-4*y*x 

> plot3d(T(x, y), x = -2 .. 2, y = -2 .. 2, orientation = [98, 77]); 1
 

Plot 

3(a). Find all of the function T(x, y)'s critical points. 

       Define "critPts" to be the list of all REAL critical points. 

> Tx := diff(T(x, y), x); 1
 

(Typesetting:-mprintslash)([Tx := 4*x^3-4*y], [4*x^3-4*y]) 

> Ty := diff(T(x, y), y); 1
 

(Typesetting:-mprintslash)([Ty := 4*y^3-4*x], [4*y^3-4*x]) 

> soln := solve({Ty = 0, Tx = 0}, [x, y]); 1
 

(Typesetting:-mprintslash)([soln := [[x = 0, y = 0], [x = RootOf(_Z^2+1, label = _L4), y = -RootOf(_Z^2+1, label = _L4)], [x = 1, y = 1], [x = -1, y = -1], [x = RootOf(-RootOf(_Z^2+1, label = _L3)+_Z^...
(Typesetting:-mprintslash)([soln := [[x = 0, y = 0], [x = RootOf(_Z^2+1, label = _L4), y = -RootOf(_Z^2+1, label = _L4)], [x = 1, y = 1], [x = -1, y = -1], [x = RootOf(-RootOf(_Z^2+1, label = _L3)+_Z^...
(Typesetting:-mprintslash)([soln := [[x = 0, y = 0], [x = RootOf(_Z^2+1, label = _L4), y = -RootOf(_Z^2+1, label = _L4)], [x = 1, y = 1], [x = -1, y = -1], [x = RootOf(-RootOf(_Z^2+1, label = _L3)+_Z^...
(Typesetting:-mprintslash)([soln := [[x = 0, y = 0], [x = RootOf(_Z^2+1, label = _L4), y = -RootOf(_Z^2+1, label = _L4)], [x = 1, y = 1], [x = -1, y = -1], [x = RootOf(-RootOf(_Z^2+1, label = _L3)+_Z^...
(Typesetting:-mprintslash)([soln := [[x = 0, y = 0], [x = RootOf(_Z^2+1, label = _L4), y = -RootOf(_Z^2+1, label = _L4)], [x = 1, y = 1], [x = -1, y = -1], [x = RootOf(-RootOf(_Z^2+1, label = _L3)+_Z^...
 

> critPts := [soln[1], soln[3], soln[4]]; 1
 

(Typesetting:-mprintslash)([critPts := [[x = 0, y = 0], [x = 1, y = 1], [x = -1, y = -1]]], [[[x = 0, y = 0], [x = 1, y = 1], [x = -1, y = -1]]]) 

3(b). Define the discriminant "D = T[xx]*T[yy]-T[xy]^2" and test all of the REAL critical points. 

       Discuss what the max/min test says about your critical points. 

 

Note: Assign the discriminant some name like "DD" since "D" is reserved by Maple for 

        another operator. 

> Txx := diff(T(x, y), `$`(x, 2)); 1
 

(Typesetting:-mprintslash)([Txx := 12*x^2], [12*x^2]) 

> Tyy := diff(T(x, y), `$`(y, 2)); 1
 

(Typesetting:-mprintslash)([Tyy := 12*y^2], [12*y^2]) 

> Txy := diff(T(x, y), x, y); 1
 

(Typesetting:-mprintslash)([Txy := -4], [-4]) 

> DD := Txx*Tyy-Txy^2; 1
 

(Typesetting:-mprintslash)([DD := 144*x^2*y^2-16], [144*x^2*y^2-16]) 

> simplify(subs(critPts[1], DD)); 1
 

-16 

> simplify(subs(critPts[1], Txx)); 1
 

0 

> simplify(subs(critPts[2], DD)); 1
 

128 

> simplify(subs(critPts[2], Txx)); 1
 

12 

> simplify(subs(critPts[3], DD)); 1
 

128 

> simplify(subs(critPts[3], Txx)); 1
 

12 

 

The discriminant is negative for our first critial point 0, 0, so it is a saddle point. 

 

We can see that the discriminant is positive and the second partial of T(x, y) is positive 

for our last two critical points 1, 1 and -1, -1. Therefore, these points are local minima. 

 

3(c). Suppose that our metal plate is circular with radius 2 and is centered at 0, 0. 

      If an ant is walking around on the plate, what point will it find to be the hottest 

      and what point will it find to be the coldest. 

 

Directions: Use Lagrange multipliers to find the coldest and hottest points on the edge 

                 of the plate (your constraint is the circle x^2+y^2 = 4). And then  

                 combine those results with your previous critical points results. 

> g := proc (x, y) options operator, arrow; x^2+y^2 end proc; 1
 

(Typesetting:-mprintslash)([g := proc (x, y) options operator, arrow; (VectorCalculus:-`+`)(x^2, y^2) end proc], [proc (x, y) options operator, arrow; (VectorCalculus:-`+`)(x^2, y^2) end proc]) 

> g(x, y) = 4; 1
 

x^2+y^2 = 4 

> EqX := diff(T(x, y), x) = lambda*(diff(g(x, y), x)); 1
 

(Typesetting:-mprintslash)([EqX := 4*x^3-4*y = 2*lambda*x], [4*x^3-4*y = 2*lambda*x]) 

> EqY := diff(T(x, y), y) = lambda*(diff(g(x, y), y)); 1
 

(Typesetting:-mprintslash)([EqY := 4*y^3-4*x = 2*lambda*y], [4*y^3-4*x = 2*lambda*y]) 

> EqConstraint := g(x, y) = 4; 1
 

(Typesetting:-mprintslash)([EqConstraint := x^2+y^2 = 4], [x^2+y^2 = 4]) 

> lagrangeCrit := solve({EqX, EqY, EqConstraint}, [x, y, lambda]); 1
 

(Typesetting:-mprintslash)([lagrangeCrit := [[x = -RootOf(_Z^2-2), y = RootOf(_Z^2-2), lambda = 6], [x = RootOf(_Z^2-2), y = RootOf(_Z^2-2), lambda = 2], [x = RootOf(_Z^4+1-4*_Z^2)^3-4*RootOf(_Z^4+1-4...
(Typesetting:-mprintslash)([lagrangeCrit := [[x = -RootOf(_Z^2-2), y = RootOf(_Z^2-2), lambda = 6], [x = RootOf(_Z^2-2), y = RootOf(_Z^2-2), lambda = 2], [x = RootOf(_Z^4+1-4*_Z^2)^3-4*RootOf(_Z^4+1-4...
(Typesetting:-mprintslash)([lagrangeCrit := [[x = -RootOf(_Z^2-2), y = RootOf(_Z^2-2), lambda = 6], [x = RootOf(_Z^2-2), y = RootOf(_Z^2-2), lambda = 2], [x = RootOf(_Z^4+1-4*_Z^2)^3-4*RootOf(_Z^4+1-4...
(Typesetting:-mprintslash)([lagrangeCrit := [[x = -RootOf(_Z^2-2), y = RootOf(_Z^2-2), lambda = 6], [x = RootOf(_Z^2-2), y = RootOf(_Z^2-2), lambda = 2], [x = RootOf(_Z^4+1-4*_Z^2)^3-4*RootOf(_Z^4+1-4...
 

> evalf(lagrangeCrit); 1
 

[[x = -1.414213562, y = 1.414213562, lambda = 6.], [x = 1.414213562, y = 1.414213562, lambda = 2.], [x = -1.931851653, y = .5176380902, lambda = 8.]]
[[x = -1.414213562, y = 1.414213562, lambda = 6.], [x = 1.414213562, y = 1.414213562, lambda = 2.], [x = -1.931851653, y = .5176380902, lambda = 8.]]
 

> evalf(subs(lagrangeCrit[1], T(x, y))); 1
 

15.99999999 

> evalf(subs(lagrangeCrit[2], T(x, y))); 1
 

-0.4e-8 

> evalf(subs(lagrangeCrit[3], T(x, y))); 1
 

18.00000001 

> evalf(subs(critPts[1], T(x, y))); 1
 

0. 

> evalf(subs(critPts[2], T(x, y))); 1
 

-2. 

> evalf(subs(critPts[3], T(x, y))); 1
 

-2. 

 

First, notice that all three critical points from 3(b) are within the circle of radius 2. 

Now comparing the temperature at all of the internal critical points and all of the 

points found from the method of Lagrange multipliers, we find that the maximum 

temperature is approximately 18 degrees and occurs at "lagrangeCrit[3]" which is  

located approximately at .5176, -1.9319. The lowest temperature is -2 degrees 

and this occurs at "critPts[2]" and "critPts[3]" which are the points 1, 1and -1, -1.