MA0 Calculus III Fall, 009 Laboratory Exploration : Gradients, Directional Derivatives, Stationary Points Introduction: This lab deals with several topics from Chapter. Some of the problems should be done by hand, while Mathematica may be used for others. For the problems done by hand, be sure to show all work and write neatly. Due on Fri., /6/09. ) The Gradient as Total Derivative. Suppose z f(x; y) is a di erentiable function of variables. In class, I have suggested that the gradient vector, rf ( @z @z ; @z ); obtained by putting together the partial derivatives of f into a single (vector-valued) function, should be called the "total" derivative of f: This suggests that the total derivative should have properties that generalize the derivative of a function of a single variable. Indeed, show that the following properties all hold. Assume that u f(x; y) and v g(x; y) are (scalar-valued) functions and a & b are constants: a) r(au + bv) aru + brv (linearity) b) r(uv) urv + vru (product rule) u vru urv c) r (quotient rule) v d) r (u n ) nu n ru (power rule) [Remark: This is exercise 7 in section.6] a) Solution: @(au + bv) @(au + bv) r(au + bv) ( ; ) @x (af x (x; y) + bg x (x; y); af y (x; y) + bg y (x; y)) v (af x (x; y); af y (x; y)) + (bg x (x; y); bg y (x; y)) a (f x (x; y); f y (x; y)) + b (g x (x; y); g y (x; y)) aru + brv
b) Solution: @(uv) r(uv) @x ; @(uv) @u @x v + u @v @x ; @u v + u@v u @v @u @x ; u@v @u + v; @x v @v u @x ; @v @u + @x ; @u v urv + vru c) Solution: d) Solution: u r v @( u v ) @x ; @( u v ) v @u @x u @v @x v ; v @u v v @u u @v @x v v @u @x ; v @u @u v v @x ; @u vru urv v @x ; v @u! u @v v u u @v u @v @x ; u@v @v @x ; @v r (u n ) ( @ (un ) @x ; @ (un ) ) (nu n @u @x ; nun nu n ( @u @x ; @u ) nu n ru @u ) ) Properties of the Gradient Vector. Consider the function z y+sin(x): a) Determine rz (by hand) at a general point and at the speci c point (x; y) ( ; ):
Solution: rz ( @z @x ; @z ) ( cos(x); ) rz( ; ) (0; ) b) Plot the function z over the region R f(x; y)j x ; y g [ ; ] [ ; ]; using the PlotD command in Mathematica. Solution: y + sin(x) 0 z 0 0 0 x 0 y c) Use the ContourPlot command in Mathematica to obtain a contour plot of this function z over the same region. Solution: See Mathematica printout. d) The gradient you computed in part a is a vector eld. Use the Vector- Plot command to generate a plot of this gradient eld over the same window as in parts b & c: By comparing your graphs in parts b & d, you can see that the gradient vector does indeed point in the direction of steepest ascent on the surface as noted in the discussion on page 99 of the text. By comparing your graphs in parts c & d, you can see that the gradient vectors are indeed orthogonal to the level curves of the surface, also as discussed on page 99. Solution: See Mathematica printout. y + sin(x) Here is the Scienti c
Workplace version: y x Gradient Field for y + sin(x) ) An application of partial derivatives and of directional derivatives. (This problem should be done by hand.) Suppose a small company manufactures and sells two items: gadgets and widgets. Let x denote the number of cases of gadgets and y denote the number of cases of widgets which are sold each week. Denote the weekly pro t (in dollars) by P: In reality, P depends on many variables, but for the sake of simplicity, let us assume that P depends only on x & y; and suppose that P (x + y ) : Answer the following questions: a) Currently, they produce 00 cases of gadgets and 0 cases of widgets each week. What is their weekly pro t? They wish to increase the gadget production while keeping the widget production constant. About how much additional pro t is generated by each additional case of gadgets? (This is called the marginal pro t of the gadgets. Hint: isn t this a certain rate of change we have seen in class? ) Also nd the marginal pro t of the widgets (at the current production levels).
Solution: P (00; 0) ( (00) + (0) ) $6; 00 @P @x (x + y ) x (x) p x + y @P So the marginal pro ts are: Gadgets: Widgets: (x + y ) (0y) 0y p x + y @P @x (00; 0) (00) q $ 0 (00) + (0) @P (00; 0) 0 (0) q $0 (00) + (0) b) Compute the directional derivative of P at (00; 0) in the direction of the vector u (; ): Give a suitable interpretation of dp du for the company (remember to make a unit vector out of u): Solution: To make u into a unit vector, divide by it s length: p (; ) dp du (00; 0) rp u 0 ; 0 p (; ) 0 p + 0 p p $: per unit The interpretation is that if production increases from the current levels in such a way that the number of cases to widgets to cases of gadgets are in a to ratio, then the additional pro t will be $: per unit (where a "unit" is p (; ); that is, p cases gadgets and p cases widgets.) c) Now the company wants to increase the production levels in such a way as to generate the greatest possible additional (marginal) pro t per unit. At a recent board meeting, the production manager (who has had calculus) made the following statement: At the current levels, we stand to make the greatest additional pro t if we increase our production with the following strategy: the ratio of the number of additional cases of gadgets to the number of additional cases of widgets should be to. In other words, for each additional case of gadgets we make, we should also make additional cases of widgets." Justify her statement. [Hint: See theorem in section.6.] Solution: Since rp (00; 0) 0 ; 0 ; it points in the direction of steepest increase of P: Notice that direction is the same as ; or (; ): d) Suppose the management takes the advice of the production manager. If they increase their production levels to cases gadgets and cases widgets each week, nd (exactly) the new pro t.
Solution: P (; ) ( () + () ) $6; 87: 0: Notice this represents exactly $7:0 /week additional pro t. e) Use the total derivative of P at (00; 0) to give a reasonable approximation to P (; ) and compare it to the exact answer you found in part d. [Hint: Formula 0 on page 896, as well as the discussion on the top of page 897 (including the picture!) will be helpful.] Solution: P dp rp (dx; dy) 0 ; 0 (; ) $ 00 $: The approximate increase of $: /week is quite close to the actual increase of $7:0 /week. ) Quadratic approximations to surfaces. Recall that for functions y f(x) of one variable, that the degree Taylor polynomial P (x) is the best linear approximation to f(x) locally near x a: We have P (x) f(a)+f 0 (a)(x a): If we abbreviate x a by "dx"; we can write this suggestively as: P (x) L(x) f(a) + f 0 (a) dx; where we use L(x) to emphasize that it is a linear function - in fact it is the same as the tangent line to the curve at x a: Similarly, P (x); the degree Taylor polynomial, is the best quadratic approximation to f(x) locally near x a; so we use Q(x) to stand for that. So we have: P (x) Q(x) f(a) + f 0 (a) (x a) + f 00 (a)! f(a) + f 0 (a) dx + f 00 (a) L(x) + f 00 (a) dx (x a) dx () a) Let f(x) x x x: Find L(x) and Q(x) at the point x : Using Mathematica, plot f(x); L(x); and Q(x) in the same coordinate system, over the window 0 x : You should observe that Q(x) is a better approximation to f(x) than L(x) is (near x ); because Q(x) has the same height, slope and concavity as f does as x ; whereas L(x) only shares the height and slope of f: Solution: f() ; and f 0 (x) x x ; so f 0 () ; therefore: L(x) (x ) x We also have f 00 (x) x ; so f 00 () 8; and so: Q(x) (x ) + (x ) x 9x + 6
The plots (also see the Mathematica printout): y 0. 0. 0. 0. 0.6 0.8.0...6.8.0 x b) All of this generalizes to functions z f(x; y) of two variables. We already are familiar with L(x; y) - it is the tangent plane with equation: L(x; y) f(a; b) + rf(a; b) (dx; dy) () f(a; b) + f x (a; b)(x a) + f y (a; b)(y b) The best quadratic approximation Q(x; y) near (a:b), like equation () above, is obtained by adding some degree terms to L(x; y): The exact form is: Q(x; y) L(x; y) + f xx(a; b)(x a) + f xy (a; b)(x a)(y b) + f yy(a; b)(y b) L(x; y) + f xx(a; b) dx + f xy (a; b) dx dy + f yy(a; b) dy [Remark: See part of the "Discovery Project" on page 9 of our text.] Let f(x; y) x y xy + x y : Find L(x; y) and Q(x; y) for the point (a:b) (; ): Use the PlotD command in Mathematica to plot f(x; y); L(x; y) and Q(x; y) over the region R f(x; y) j x ; y g [ ; ] [ ; ]: You should observe that L(x; y) is the tangent plane to both f(x; y) and Q(x; y) at the pont (; ); but that near that point, Q(x; y) is a better approximation to f(x; y) than L(x; y) is, just as in the one-variable case. Solution: Given f(x; y) x y xy + x y ; we have rf (x y y + xy ; x xy + x y) and " # @ z @ z @x H f @x 6xy + y x y + xy x y + xy x + x @ z @x @ z 7
At the point (; ); these yield: f(; ) () () () + () () rf(; ) ( () () () + () () ; () () () + () ()) 6 6 () () + () () () + () () 0 H f () () + () () () + () Thus: L(x; y) + 6 dx dy + 6(x ) (y ) 6x y Q(x; y) 6x y + (0)(x ) + (x )(y ) + ( )(y ) 0x + xy 0x y y + The plots (also see the Mathematica printout): y z 0 0 x [Remark: Similar to parts & of the "Discovery Project" on page 9-9 of our text.] ) Classifying Stationary Points. A stationary point of a function is a point where the derivative is 0: For a surface z f(x; y), this means the gradient vector is the zero vector. Think about why this makes sense - if the gradient vector is zero, it should be clear that the linear approximation L(x; y) is constant: L(x; y; ) f(a; b) (see formula above). In other words, the tangent plane is horizontal (parallel to the xy plane), just as for curves, stationary points are places where the curve has horizontal tangent lines. Just as for curves, stationary points are important because those could be places where the function attains a local maximum or minimum. Just as for 8
curves, however, it is often di cult to tell whether or not a stationary point is a max, a min, or neither (in the case of a surface, the case of a stationary point which is neither a max nor a min is called a saddle point.) For the following functions, nd the critical points (by hand). [This means set the gradient vector equal to (0; 0) and solve for x & y: Some functions will have more than one stationary point!] Then plot the functions using Mathematica in a neighborhood of the stationary point(s) and see if you can classify them as maxima, minima, or saddle points. You may nd the ContourPlot command helpful. a) z x + y x y Solution: Set the gradient equal to zero and solve to nd the stationary points: rz (x ; y ) (0; 0) x 0 y 0 x y 8 So the common solutions are: (x; y) (; ) and ( ; ): b) f(x; y) x y + xy x x + y Solution: Set the gradient equal to zero and solve to nd the stationary points: xy + y 6x 0 rz (xy + y 6x ; x + x + ) (0; 0) x + x + 0 From the second equation we obtain (x + )(x + ) 0; whence x x : When x ; the rst equation becomes: or xy + y 6x 0 y + y + 6 0 y + 0 So ( ; ) is a stationary point. When x the rst equation becomes: xy + y 6x 0 y + y + 0 y + 8 0 So ( ; 8) is another stationary point. c) z x + y + xy + 9
Solution: Set the gradient equal to zero and solve to nd the stationary points: Dividing by : rz (x + y; y + x) (0; 0) x + y 0 y + x 0 x + y 0 y + x 0 From the rst equation we obtain y second yields: x ; and substituting this into the x + x 0 x(x + ) 0 Thus x 0 or x : Since y x ; we see the two stationary points are: (0; 0) and ( ; ): Next week, we will see in class that we can classify the stationary points by means of a "second derivative test" much like you did in the case of curves in Calculus I. [Remark: It relies on parts & of the "Discovery Project" on page 9-9 of our text.] 0