Chapter 12: MultivariableFunctionsand partial Derivatives |.' LagrangeMultipliers i' Free maximum z=4 9-* 2 -y2 Constrained maximum x + 3 y -1 0 = constraint on x andy As we saw in section 12.8, we sometimesneed to find the extreme values of a function whose domain is constrained to lie within some particular subset of the plane-a disk, for example, or a closed triangular region. But, as Fig. 12.5g suggests,a function may be subjectto other kinds of constraintsas well. In this section, we explore a powerful method for finding extreme values of constrained functions: the method of ktgrange multipliers. Lagrange developed the method in 1755 to solve max-min problems in geometry. Today the method is important in economics, in engineering (where it is used in designing multistage rockets, for example), and in mathematics. Constrained Maximaand Minima Find the point p (x, y, z) closest to the origin on rhe plane 2x a EXAMPLE 1 y-z-5:0. solution The problem asks us to find the minimum value of the function lo F l:W : J x 2 + v 2 + it x 12.58 The function f (x, y) : 49 - x2 - y2, subject to the constraint g(x,y) : x+3y-10 :0. subject to the constraint that 2x* j -z-5:0. Since lOFl has a minimum value wherever the tunction f(x,y;Z):x2+ y' + z' has a minimum value, we may solve the problem by finding the minimum value of f (x,y, z) subjectto the constraint2x * y - z -5 : 0. If we regardx and y as the independentvariables in this equation and write z as z:2x* y-5, our problem reducesto one of finding the points (x, y) at which the function h(x,y) : f(x,y,2x - 5) : x2 * y2 + (Zx + y _ 5) z *) has its minimum value or values. since the domain of ft is the entire ly-plane, the first derivative test of Section 12.8 tells us that any minima that ft might have must occur at points where h, :2x * 2(2x * y - 5)(2) : O, hy:2y * 2(2x f y - 5) : 0. This leads to l Ox * 4y:20, 4x * 4y: l Q, and the solution J -t- 5 6 we may apply a geometric argurnent together with the second derivative test to show that these values minimize h. The z-coordinate of the corresponding point on 12.9 LagrangeMult iplier s 981 th e pl anez:2x * y-5i s /5\ s z:2lll+ ;- 5- - \31 6 5 6 Therefore, the point we seek is . Clo s eps o t in t : s\ /ss r^ (r, a . -O / D The distancefrom P to the origin is 5lJ6 x 2'04. Attemptsto solvea constrainedmaximum or minimum problemby substitution, as we might call the methodof Example l, do not always go smoothly.This is one of the reasonsfor learning the new method of this section. EXAMPLE 2 x 2 -22-1:0. 12.59 The hyperboliccylinder x2- 22- 1: 0inE x a m p l e 2 . Find the points closest to the origin on the hyperbolic cylinder Solution 1 The cylinder is shown inFig. 12.59.We seekthe points on the cylinder closest to the origin. These are the points whose coordinatesminimize the value of the function f(x, y, z) : xz + yz + z2 of thedistance Square subject to the constraintthat x2 - zz - 1 : 0. If we regard x and y as independent variables in the constraint equation, then z2:x2-l a n d theval uesoff(x,y,Z):x2+ y' + z2onthecyl i nderaregi venbyt hef unct ion h(x,y) : x2 * y2 + @ 2- 1) : 2x2 + Y 2 - l . To find the points on the cylinder whose coordinates minimize /, we look for the points in the xy-plane whose coordinatesminimize h.The only extremevalue of ft occurs where h, :4x The hJperbolic cylinderx2 - z2 = | - 0 and hy:2Y - 0, that is, at the point (0, 0). But now we're in trouble-there are no points on the cylinder where both x and y are zero. What went wrong? What happenedwas that the first derivative test found (as it should have) the point ln the domain of h whete ft has a minimum value. we, on the other hand, want ihe points on the cylinder where h has a minimum value. While the domain of /r is the entire xy-plane, the domain from which we can select the first two coordinates o f t hepoi nts(x,y,z) onthecyl i nderi srestri ctedtothe" shadow"oft hecylinder on the ry-plane; it doesnot include the band betweenthe lines x : -l and x : I (Fig. 12.60). We can avoid this problem if we treat y and z as independentvariables (instead of x and y) and express.x in terms of y and z as x2:22* 1. 12.60 The regionin the xy-planefrom of the which the first two coordinates points(x,y,z) on the hyperboliccylinder the band x2 - z2: 1 are selectedexcludes -1 < x < l int hex y -p l a n e . With this substitution,f (x, y, z) : x2 + y' + z2 becomes k(y, z) : 722* I) * yz * zz : | + y2 + 2zz and we look for the points where ft takes on its smallest value. The domain of 982 Chapt er12: M u l ti v a ri a b l eF u n c ti o n sa n d Parti alD eri vati ves k in the yz-plane now matches the domain from which we select the y- and z-coordinatesof the points (x, y, z) on the cylinder.Hence,the points that minimize ft in the plane will have correspondingpoints on the cylinder. The smallestvalues of k occur where kY :2Y -0 or where | : z :0. and kr:42-0, This leadsto x 2 : 2 2 *l : 1 , - - - Lt The conesponding points on the cylinder are (* 1,0,0). We can see from the inequality k(Y .d:l + y2+ 222> l that the points (* 1,0,0) give a minimum value for k. we can also see that the minimum distance from the origin to a point on the cylinder is 1 unit. " 2_ 2 2 _ l : 0 x 2+ y 2+ a2- o2= solution 2 Another way to find the points on the cylinder closest to the origin is to imagine a small spherecenteredat the origin expanding like a soap bubble until it just touches the cylinder (Fig. 12.61). At each point of contact, the cylinder and sphere have the same tangent plane and normal line. Therefore, if the sphere and cylinder are representedas the level surfacesobtained by setting g(x,y,Z):x2-z' -l and f(x,y,Z):x2+ y' ,+ 22-a2 equal to 0, then the gradients V/ and vg will be parallel where the surfacestouch. At any point of contact we should therefore be able to find a scalar l. ("lambda") such that V /: l V g' or 2x i | 2y j * Zzk : ).(2x i - 2zk). 12.61 A sphereexpandinglike a soap bubblecenteredat the origin until it just touchesthe hyperboliccylinder Thus, the coordinatesx, y, and z of any point of tangency will have to satisfy the three scalarequations x 2- 22- 1 :0 . SeeSolution2 of Example2. 2x : 2).x, 2y :0, 2z : -2),2. ( l) For what valuesof ), will a point (x, y, z) whose coordinatessatisfy the equations in (1) also lie on the surfacex2 - z2 - I : 0? To answer this question,we use the fact that no point on the surface has a zero x-coordinate to conclude that x l0 in the first equationin (l). This meansthat 2x :2)"x only if 2:2)' , or ,1": 1. For )" : l, the equation 27 : -2)"2 becomes2z : -Zz. If this equation is to be satisfiedas well, z must be zero. Since y : 0 also (from the equation2y :0), we conclude that the points we seek all have coordinates of the form (-r,0, 0). What points on the surface x2 - zz : I have coordinates of this form? The points (x, 0, 0) for which x2 - :1, 1072 x2 :1, or x : * 1. The points on the cylinder closestto the origin are the points (* 1,0,0). D 12.9 LagrangeM ult iplier s 983 Multipliers The Methodof Lagrange In Solution 2 of Example 2, we solved the problem by the method of Lagrange multipliers. In generalterms,the methodsaysthat the extremevaluesof a function : 0 are to be found f (*, y, z) whosevariablesare subjectto a constraint,g(-r,y, z) : on the surf'ace8 0 at the points where Y1 : )"Vg for some scalar,tr(called a Lagrange multiplier). To explorethe methodfurther and seewhy it works, we first make the following observation,which we stateas a theorem. Theorem9 Theorem Gradient TheOrthogonal Supposethat /(x, ), z) is differentiablein a region whose interior contains a smooth curve C: r : s (t )i+ h (t )i+ f t (/ )k . If Ps is a point on C where / has a local. maximum or minimuin relative to its values on C, then V/ is orthogonal to C at Ps. Proof We show that V.f is orthogonal to the curve's velocity vector at Ps. The valuesof f on C are given by the composite/(S(t), h(t),k(t)), whosederivative with respectto t is d f : a f lg * { 4 ! " { 4 ! dt 0x dt 3y dt 3z dt :vr.r. At any point P6 where / has a local maximum or minimum relative to its values SO o n the curve,df l dt:0, D V ./.v:0. By droppingthe z-termsin Theorem9, we obtain a similar result for functions of two variables. Corollaryof Theorem 9 At the pointson a smoothcurve r: g(/) i+h(t)i where a differentiable function f (x, y) takeson its local maxima and minima relative to its values on the curve,V / . v:0. Theorem 9 is the key to the method of Lagrange multipliers. Suppose that (x,y,z) and g?,y,z) are differentiableand that Pe is a point on the surface f g@,y,2):0 where / has a local maximum or minimum value relative to its other values on the surface. Then / takes on a local maximum or minimum at Pe relative to its values on every differentiable curve through Ps on the surface Therefore,V/ is orthogonalto the velocity vector of every such C@,y,2):0. differentiable curve through Ps. But so is Vg (becauseVg is orthogonal to the level surface 8 : 0, as we saw in Section 12.7). Therefore, at Ps, V/ is some scalar multiple I of V6. 984 Chapter '12:MultivariableFunctionsand partial Derivatives The Method of Lagrange Multipliers Supposethat f (x,),2) and g(r,y,a) are differentiable.To find rhe local maximum and minimum valuesof subjectto the constraintg(x, / !, z) :0, find the valuesof x, y,z, and.i. that simultaneouslysatisfy the equations yf : Lyg and g(x, y, z) : 0. For functions of two independentvariables,the appropriateequations are yf : ),V g EXAMPLE3 and :0. E k, i Find the greatestand smallestvaruesrharthe function f(x' Y) : xY takeson the ellipse(Fig. 12.62) ^-2 ,/ .,2 T- t:t' 12.62 Example3 showshow to find the largestand smallestvaluesof the product xy on this ellipse. Solution We want the extremevaluesof (x,y):x), f x2 subjectto the constraint r,2 s \ x , y ) : T * i_ r : 0 . To do so, we first findthe valuesof x,y, Vf : ),YS and), for which and g(x, y) :0. The gradient equation gives Y i-f x i: 1 * i* ry i, 4 from which we find l J:4* , r x:)' Y , and A .V ::(,l V ):-vA' .t L' a+ s: l'*: so that ) : 0 or I : * 2. We now considerthesetwo cases. Case1: If y :0, then x : | :0. But (0,0) is not on the ellipse.Hence,y + 0. Case2: If y * 0, then i_: * 2 and x : +2y.Substituting this in the equation s(x,y):0gi ves and v- * l The function f (x, y) : .ry therefore takes on its extreme values on the ellipse at the four points (+ 2, l), (+2, -l). The extremevalues are x! : 2 andxy _ _2. 12.53 When subjectedto the constraint sU,9 : x2l8+ y2/2- I : o, the function t(x,y): xy takeson extremevaluesat the four points(+2,*1). Theseare the pointson the ellipsewhen Vf (red)is a scalarmultipleof vg (blue)(Example3). The Geometry of the Solution The level curvesof rhe funcrion (x, y) : xy .f are the hyperbolas xy -- c (Fig. 12.63). The farther the hyperboras lie from the origin, the larger the absolute value of /. we want to find the extreme values of f (x, y), given that the poinr (x, y) also lies on the ellipse xz + 4y2: g. Which hyperbolas intersecting the ellipse lie farthest from the origin? The hyperbolas that Multipliers 985 12.9 Lagrange just graze the ellipse, the ones that are tangentto it. At these points, any vector is a m ult iple normal to the hyperbola is normal to the ellipse, so Y f :yi * xj (l : + 2) of Yg : (x 14)i + t' j. At the point (2, 1), for example, vs: ji+ j. Yf:i+ 2i, and Y f :2Yg. and Yf : -2Yg. At the poi nt (-2,l ), v f : i-2 j, v g : -] i+ 1 , z D Findthemaximumandminimumvaluesofthefunction EXAMPLE4 f(x, y) : 3x -l 4y on the circle x2 + y2 : 1. Solution We model this as a Lagrangemultiplier problem with f (x,y) -- 3x * 4y, x2 + y2 - | S O,9: and look for the valuesof x, y, and I that satisfy the equations V /:),V g : 3i + 4j :2x),i * 2y),j , x2+ Y 2-l :0. 8(x' y):o: and gives The gradientequationimplies that )" l0 -t z y:;. D. These equationstell us, among other things, that r and y have the same sign. With thesevaluesfor x and y, the equationg(x, )) :0 gives z l r2 94 + aiz u: Thus. so g + 16 - 4),2, I' JJ - vf.:3i + 4i: zv8 6. >l :) * 3i /.t\2 .(;) (;,) 11 -l-_ { -,:0 4),2 : 25, and ), : + :. 2 24 ., - _ - -{-'i" ) and f(x,y) :3x l 4y has extremeval uesat (x,y) : + (3/5,4/ 5) . By calculatingthe value of 3x * 4y at the points * (315, 415), we seethat its maxlmum and minimum valueson the circle x2 + v2: 1 are 4l )) /3\ x 3x + 4y : J 3x + 4y = - 5 12.64 The functionf(x,y) :3x + 4y takes on its largestvalueon the unit circle S(x,y) : x'+ y' - 1 : 0 at the point (315,415)and its smallestvalueat the point (-3l5, -4l5) (Example4). At each of thesepoints,Vf is a scalarmultipleof Vg. The figure showsthe gradientsat the first point but not the second. /4\ 2s ' l s /* * l s /: s :5 and , ( j) . - ( - i) ')< (FiS. 12.6q The level curvesof f (x,y): The Geometry of the Solution 3x * 4y are the lines 3r * 4y : c. The farther the lines lie from the origin, the larger the absolutevalue of /. We want to find the extreme values of /(x, y) given l. Which lines intersecting that the point (r,y) also lies on the circle x2 +y2: the circle lie farthest from the origin? The lines tangent to the circle. At the points of tangency, any vector normal to the line is normal to the circle, so the gradient At t he Y f :3i f 4j i s a mul ti pl e(),: * 512) of the gradi entY g:2"i+2y: . point (3/5 , 4 I 5) , for example, vf:3i+ 4i, vs::t+;j, and vf:ttv s E 986 Chapt e r1 2 : Mu l ti v a ri a b l eF u n c ti o n sa n d parti alD eri vati ves LagrangeMultiplierswith Two Constraints Many problemsrequire us to find the extreme values of a differentiablefunction f (x, y, z) whose variablesare subjectto two constraints.If the constraintsare gt@ , y, z) : 0 gz/, y, z) :0 and and g1 and g2 are differentiable, with Vg1 not parallel to yg2, we find the constrained local maxima and minima of / by introducing two Lagrangemultipliers I and pr (mu, pronounced"mew"). That is, we locate the points p (x, y, z) where / takes on its constrainedextreme values by finding the values of x,y,z,)", and,p 111a1 simultaneouslysatisfy the equations V/ : lVgr * ttYgz, 12.65 The vectorsVg1 and Vg2 lie in a planeperpendicular to the curveC becauseVg1 is normalto the surface 9r : 0 and Vg2 is normalto the surface 9z : 0' gr?, y, z) : 0, 8z@,y, z) : o. (2) The equationsin (2) have a nice geometricinterpretation.The surfacesgr :0 and g2: 0 (usually) intersectin a smooth curve, say c (Fig. 12.65),and alons this curve we seek the points where / has local maximum and minimum valuei relative to its other values on the curve. These are the points where V/ is normal to c, as we saw in Theorem 9. But Vg1 and yg2 are also normal to c at these points becauseC lies in the surfacesgr : 0 and 92:0. Therefore V/ lies in the plane determined by Vg1 and Vg2, which means that V/ : lVgr * ttygz for some )' and p'. Since the points we seek also lie in both surfaces,their coordinates must satisfy the equationsg{x, y, z) : 0 and g2(x, !, z) :0, which are the remainine requirementsin Eqs. (2). E XA MP LE 5 The pl ane xl yl z:l cuts the cyl i nder,r +yr : l in an ellipse (Fig- 12.66). Find the points on the ellipse that lie closest to and farthest from the origin. Solution We find the extreme values of f(x,y,z):x2+ y2+ 22 (the square of the distance from (x, y, z) to the origin) subject to the constraints gr?,y,Z):x2+ y2-l :O (3) 8z@ ,y,2):x* y* z-l :0. (4) The gradient equation in (2) then gives V/ : lVSr * ltYgz 2xi * 2y j * 2zk: 2xi * 2y j -t2zk Eq (2) L(2xi + 2y j ) + rr.(i + j + k) - (Z).x* tD i * (2)" y* tt)j + pk x- l!*7 :l 2x : 2)"x * l.t, 2y :2Ly * 1t, 2z : F. (s) The scalarequationsin (5) yield 12.66 On the ellipsewherethe plane and cylindermeet,what are the points closestto and farthest from the origin (Example5)? 2x : 2),xl2z + (l - X)x :7, 2y :2Ly *22 + (l - L)y :7. Equations (6) are satisfied simultaneously if either ). : I and z : 0 or ), I .tr:. I : z/(l - )" ). (6) I and 12.9 Exercises 987 If z : 0, then solving Eqs.(3) and (4) simultaneouslyto find the corresponding poinrson the ellipsegivesthe two points(1,0,0) and (0, 1,0). This makessense when you look at Fig. 12.66. If x : ), then Eqs. (3) and (4) give x * x 11- I : 0 z : | -2x z: l+J2 . 6 ,\L ^--2 pointson the ellipseare The corresponding ,,:(+,+,'-t) and P->: /- IJ' ---:-, | t \- 1 -- J' t+Jr) 2' But here we need to be careful.While Pr and P2 both give local maxima of / on the ellipse, P2 is farther from the origin than P1. The points on the ellipse closestto the origin are (1, 0, 0) and (0, 1, 0). The D point on ihe ellipse farthest from the origin is P2. 12.9 Exercises Two Independent Variableswith One Constraint 1. Find the pointson the ellipsex2 +2y2: has its extreme values. 1 where f (x,y): ay 2' Find the extreme values of f (r ' y) : ;ry subject to the constraint s(x,y):x2 * Y2- lo: 0. 3. Find the maximum value of f (x, y) : 49 - x2 - yz on the line x * 3 y :10 ( Fie. 12. 58) . 4. Find the local extreme values of f(x,y):r'y on the line x+Y:3. 5. Find the points on the curve x!2 : 54 nearestthe origin. 6. pind the points on the curve ,ty:2 nearestthe origin. 7. Use the method of Lagrange multipliers to find a) b) the minimum value of x * y, subject to the constraints xJ:16 ,'r > 0, Y> 0; the maximum value of ;ry, subject to the constraint x+Y:16 ' Comment on the geometry of each solution. 8. Find the points on the curve x2 + xy -f y2 :1 in the .ry-plane that are nearest to and farthest from the origin. 9. Find the dimensions of the closed right circular cylindrical can of smallestsurfacearea whose volume is 16rr cm310. Find the radius and height of the open right circular cylinder of largest surface area that can be inscribed in a sphereof radius a. What is the largest surface area? 11. Use the method of Lagrange multipliers to find the dimensions of the rectangle of greatestarea that can be inscribed in the ellipse x2 116+ y219 :1 with sidesparallel to the coordinateaxes' 12. Find the dimensions of the rectangle of largest perimeter that can be inscribedin the ellipse x21a2 + y2lb2 :1 with sidesparallel to the coordinate axes. What is the largest perimeter? 13. Find the maximum and minimum valuesof x2 + y2 subjectto the constraintx2 - 2x I y2 - 4y :0. 14. Find the maximum and minimum values of 3x - y * 6 subject to the constraintx2 * Y2 :4. 15. The temperatureat a point (x,)) on a metal plate is T(x'y): 4x2 - 4xy + y2. An ant on the plate walks around the circle of radius 5 centered at the origin. What are the highest and lowest temperaturesencounteredby the ant? 16. Your firm has been asked to design a storage tank for liquid petroleum gas. The customer's specificationscall for a cylindrical iank with hemispherical ends, and the tank is to hold 8000 m3 of gas. The customer also wants to use the smallest amount of material possible in building the tank. What radius and height do you recofirmend for the cylindrical portion of the tank? with OneConstraint Variables ThreeIndependent 17. Find the point on the planex * 2y * 3z : 13 closestto the point (1,1,1). 18. Find the point on the spherex2 + y2 * z2 :4 from the point (1, -1, l). which is farthest