LESSON 5: LAGRANGE MULTIPLIERS OCTOBER 30, 017 Lagrange multipliers is another method of finding minima and maxima of functions of more than one variable. In fact, many of the problems from the last homework would have been easier via this method. However, this method only applies if you need to find the extrema subject to some constraint. So not every homework problem could have been done using this method. The Method of Lagrange Multipliers: Suppose we want to minimize or maximize a function f(x, y) subject to the constraint g(x, y) = C. Introduce a dummy variable, λ, and solve the system of equations (1) () (3) for (x, y). f x (x, y) = λg x (x, y) f y (x, y) = λg y (x, y) g(x, y) = C Ex 1. Maximize the area of a rectangular garden subject to the constraint that its perimeter is 100 ft. Solution: Let x be the length and y the width of the garden. Then the function we are maximizing is But this is subject to the constraint that f(x, y) = xy. x + y = 100. perimeter By our method, we set up a system of equations We solve for x and y. y = λ () f x g x x = λ () f y x + y g(x,y) g y = 100 C = λ = λ Since x = λ and y = λ, we see that given x + y = 100, 100 = ( λ ) + ( λ ) = 4λ + 4λ = 8λ. x y 1
MATH 1600 Then λ = 100 8 = 5. Therefore, x = ( ) ( ) 5 5 = 5 and y = = 5. We conclude that the area is maximized when x = 5 and y = 5 and the maximum area of the garden is 5(5) = 65 ft. Question: How do we know this is a maximum and not a minimum? Because the minimum area of the garden is 0 ft. For these problems, you always need to consider whether your answer makes sense in context. Note 1. Lagrange multipliers will never tell you if there is a saddle point. Examples. 1. Minimize f(x, y) = (x + 1) + (y ) subject to g(x, y) = x + y = 15. Solution: Taking derivatives, we see that f x = (x + 1), f y = (y ), g x = x, g y = y. Setting up our equations (x + 1) = λ(x) = λx (y ) = λ(y) = λy x + y = 15 The method of Lagrange multipliers calls for a little creativity so try to be flexible when solving these types of problems. We focus on the first two equations. We have Thus, (x + 1) = λx x + 1 = λx (y ) = λy y = λy x + 1 = λx x λx + 1 = 0 x(1 λ) + 1 = 0 x(1 λ) = 1 y = λy y λy = 0 y(1 λ) = 0 y(1 λ) = From this we gather that x, y 0 else these equations can t be true. This means that we may divide by x and y. Hence, 1 x = 1 λ = y, but by cross-multiplication this becomes y = x y = x.
By our constraint, g(x, y) = x + y = 1, we see 15 = x + y = x + ( x) = x + 4x = 5x 5 = x MATH 1600 3 We conclude that x = ±5, which implies y = (±5) = 10. extrema points are (5, 10) and ( 5, 10). Evaluating f(x, y) at these points, Thus, our f(5, 10) = (5 + 1) + ( 10 ) = 6 + ( 1) = 36 + 144 = 180 Max f( 5, 10) = ( 5 + 1) + (10 ) = ( 4) + (8) = 16 + 64 = 80 Min Therefore, the minimum of our function is 80.. Find the minimum value of x e y subject to y + x = 6. Solution: Whatever function we are finding the extrema for is our f(x, y) and the constraint is g(x, y). Thus, we have Next, we find derivatives: f(x, y) = x e y and g(x, y) = y + x = 6. f x = xe y, f y = x ye y, g x =, g y = 4y. We set up our equations to get xe y = λ x ye y = 4λy y + x = 6 By the first equation, we see that xe y = λ xe y = λ. Substituting this into the second equation, we get yx e y = 4 (xe y ) y. λ We may divide both sides by e y because this is never 0. Thus, this equation becomes x y = xy. Subtracting y from both sides, this becomes yx xy = 0 y(x x) = 0.
4 MATH 1600 Hence, either y = 0 or x x = 0 x(x ) = 0 x = 0 or x =. We check all three of these cases: Case 1. y = 0 Case. x = 0 Case 3. x = If y = 0, then our constraint implies that Thus, one solution is (3, 0). 0 + x = 6 x = 3. If x = 0, then by our constraint: y + 0 = 6 y = 3 y = ± 3. So two of our solutions are (0, 3) and (0, 3). If x =, then y + () = 6 y = y = 1 y = ±1. This adds another two solutions: (, 1) and (, 1). Putting this all together, our solutions are (3, 0), (0, 3), (0, 3), (, 1), (, 1). Finally, we check the function values: f(3, 0) = (3) e (0) = 9(1) = 9 f(0, 3) = (0) e ( 3) = 0 min f(0, 3) = (0) e ( 3) = 0 min f(, 1) = () e (1) = 4e max f(, 1) = () e ( 1) = 4e max Therefore, the function s minimum value is 0. 3. Find the extrema of f(x, y) = e xy subject to 9x + 4y 7. Solution: This is a slightly different problem than what we have encountered so far. Here, our constraint is an inequality rather than an equality. Fortunately, this is not as daunting as this may appear. We break this problem into two parts: first, we find the critical points of f(x, y) which are contained in the region described by g(x, y) = 9x + 4y 7, and second, we apply the Lagrange multiplier method to f(x, y) subject to g(x, y) = 9x + 4y = 7.
The derivatives of f(x, y) are MATH 1600 5 f x = ye xy and f y = xe xy. Setting these equal to 0, we see that x = 0, y = 0 because e xy is never 0. Since the point (0, 0) satisfies g(x, y) = 9x + 4y 7, we include this in our list of solutions. Now, we assume that g(x, y) = 9x + 4y = 7 and proceed with the Lagrange multiplier method as we have been. The derivatives of g(x, y) are g x = 18x and g y = 8y. Setting up our system of equations, Next, we solve for (x, y). ye xy = 18λx xe xy = 8λy 9x + 4y = 7 We observe that if any of x, y, or λ are 0, then x = 0 and y = 0. But this case has already been covered, so we assume that x, y, λ 0. This means we can divide by x and y to get λ by itself. Write y 18x e xy = λ and x 8y e xy = λ. Thus, y 18x e xy = x 8y e xy. Because e xy is never zero, we may divide through on both sides to get Cross-multiplying, we get y 18x = x 8y. 8y = 18x y = 18 8 x = 9 4 x. Now, we return to our constraint and substitute for y, 7 = 9x + 4y ( ) 9 = 9x + 4 4 x y = 9x + 9x = 18x.
6 MATH 1600 Solving for x, we see that x = ±. Since y = 9 4 x, we get y = 9 y = ±3. Therefore, we get the following 4 solutions: (, 3), (, 3), (, 3), (, 3). We need to check the function values at each of our solutions: f(0, 0) = e (0)(0) = 1 f(, 3) = e ()(3) = e 6 min f(, 3) = e ()( 3) = e 6 max f(, 3) = e ( )(3) = e 6 max f(, 3) = e ( )( 3) = e 6 min is e 6. Thus, the minimum function value is e 6 and the maximum function value 4. Find the minimum value of f(x, y) = y x 4x subject to y = 8 x. Solution: Our f(x, y) = y x 4x but we need to determine our g(x, y). We are told our constraint is y = 8 x and, adding x to both sides, we have x + y = 8. Hence g(x, y) = x + y = 8. Next, we differentiate: Setting up our equations, f x = x 4, f y = y, g x =, g y = 1. x 4 = λ y = λ x + y = 8 We know immediately that y = λ, so, substituting into the first equation, we get Dividing both sides by 4, we get x 4 = (y) = 4y. λ y = 1 x 1. According to our constraint, 8 = x + y = x + ( 1 ) x 1 = x 1 x 1 = 3 x 1. y
MATH 1600 7 We solve 8 = 3 x 1 for x: 8 = 3 x 1 9 = 3 x 18 = 3x 6 = x Since x = 6, we have y = 1 (6) 1 = 3 1 = 4. Thus, our solution is (6, 4). Plugging this into the function, f(6, 4) = ( 4) (6) 4(6) = 16 36 4 = 44. Note. We should check that this is actually a minimum as opposed to a maximum. To do this, we check any other point that satisfies x + y = 8, say (0, 8). If 44 is a minimum, then we must have 44 < f(0, 8) = 8 (0) 4(0) = 64. So we can rest easy knowing that this really is the minimum of the function subject to the given constraint. 5. Find the maximum value of f(x, y) = 3 x3/ y subject to x = 10 y. Solution: Again, we need to rearrange our constraint a little to determine our g(x, y). Adding y to both sides of x = 10 y, we get x + y = 10. Hence, Next, we differentiate: g(x, y) = x + y = 10. f x = x 1/ y, f y = 3 x3/, g x = 1, g y = 1. Now, we set up our equations: x 1/ y = λ 3 x3/ = λ x + y = 10 Since λ = x 1/ y and λ = 3 x3/, we can write x 1/ y = 3 x3/. Multiplying through by x 1/, we get xy = 3 x.
8 MATH 1600 Subtracting xy from both sides and regrouping, this becomes 0 = ( ) 3 x xy = x 3 x y. Hence, either x = 0 or 3 x y = 0 x = y. We check both cases. 3 Case 1. x = 0 If x = 0, our constraint implies that 0 + y = 10 y = 10. Hence, one solution is (0, 10). Case. 3 x = y If x = y, then 3 10 = x + y = x + 3 x = 5 3 x 10 = 5 3 x x = 6. Thus, since y = (6) = 4, one solution is (6, 4). 3 Putting this together, we have two solutions: (0, 10) and (6, 4). We check the function values at these points: f(0, 10) = 3 (0)3/ (10) = 0 min f(6, 4) = 3 (6)3/ (4) = 16 6 max Therefore, the maximum value is 16 6.