Lagrange Multipliers
Lagrange's Method Of Multipliers To find extrema of f(x, y) with the constraint g(x, y), form L(x, y, ) = f(x, y) + g(x, y); is Lagrange multiplier. Example: Find extrema of f(x, y) = 7(1 - x/4 – y/6) with constraint g(x, y) = (x – 2)2 + (y – 3)2 – 1 = 0; L(x, y, ) = 7(1 – x/4 – y/6) + [(x – 2)2 + (y – 3)2 – 1] Lx = -7/4 + 2 (x – 2) = 0 => = 7/8(x - 2) Ly = -7/6 + 2 (y – 3) = 0 => = 7/12(y - 3) L = (x – 2)2 + (y – 3)2 – 1; and 2x – 3y + 5 = 0 x = (3y – 5)/2; (1.5y – 4.5)2 + (y – 3)2 – 1 = 0 (quadratic 3.25 -22.5 28.25) (5.275358 1.647719) y (5.413037 -0.02842) x rd 5/13/2019
Lagrange Multiplier Suppose we have a problem: Maximize f(x, y) = 5 – (x – 2)2 – 2(y - 1)2 subject to g(x, y) = x + 4y = 3 Ignore the constraint to get fy and fx = 0 => x = 2 and y = 1 fxx = -2; fyy = -4; D = 8 and fxx < 0 => relative maximum With constraint: L(x, y, ) = 5 – (x – 2)2 – 2(y - 1)2 + (3 - x - 4y) Lx = -2(x – 2) - = 0; Ly = -4(y – 1) - 4 = 0 = - 2x + 4 = - y + 1 or 2x – 1y = 3 (solve '((2 -1 3)(1 4 3))) 1x + 4y = 3 x = 5/3; y = 1/3; f(5/3, 1/3) = 4, maximum; = 2/3. x = 3 - 4y => 2(3 – 4y - 2) = = 2 – 4y and = 1 - y (SOLVE ‘((-2 0 -1 -4)(0 -4 -4 -4) (1 4 0 3))) (5/3 1/3 2/3) rd 5/13/2019
Lagrange Multiplier Use a Lagrange multiplier to find the maximum rectangular area fenced in by 100 feet of fencing. L(x, y, ) = xy + (2x + 2y -100) Lx = y + 2; Ly = x + 2; and L = 2x + 2y – 100 = 0 y + 2 = x + 2 => x = y => 4x = 100 or x = y = 25. (solve '((0 1 2 0)(1 0 2 0)(2 2 0 100))) (25 25 -25/2) x y rd 5/13/2019
Lagrange Multiplier Max Z = -2x2 – y2 + xy + 8x + 3y s.t. 3x + y = 10 Observe y = 10 - 3x can be substituted into Z to get Z(x) = -14x2 + 69x – 70; Z' = -28x + 69 = 0 => x = 28/69 L(x, y, ) = -2x2 – y2 + xy + 8x + 3y + (3x + y – 10) Lx = -4x + y + 8 + 3 = 0 => y = -3 - 8 + 4x (1) Ly = -2y + x + 3 + = 0 => 2y = + 3 + 1x (2) L = 3x + y – 10 = 0 => y = 10 – 3x (3) (solve '((-4 1 3 -8)(1 -2 1 -3)(3 1 0 10))) (69/28 73/28 -1/4) Z = 15.0179 Without constraint, the max occurs at x = 19/7, y = 20/7, max = 15.142857 rd 5/13/2019
Lagrange Multiplier Find critical points for f(x, y) = 25 - x2 - y2 with constraint x2 + y2 - 4y = 0 L(x, y, ) = 25 – x2 - y2 + (x2 + y2 – 4y) Lx = -2x + 2x = 0 => x = x => = 0 or 1; = 1 Ly = -2y + 2y - 4 = 0 => = 2y/(2y – 4); 1 L = x2 + y2 - 4y = 0 Conclude x = 0, y = 0, = 0 is only consistent condition. with critical points (0, 0) f(0, 0) = 25 which is absolute maximum rd 5/13/2019
Lagrange Multipliers Find minimum of f(x, y, z) = 3x2 + 2y2 + 4z2 subject to 2x + 4y - 6z + 5 = 0 L(x, y, z, ) = 3x2 + 2y2 + 4z2 + (2x + 4y - 6z + 5) Lx = 6x + 2 Ly = 4y + 4 Lz = 8z - 6 L = 2x + 4y – 6z + 5 (solve '((6 0 0 2 0)(0 4 0 4 0)(0 0 8 -6 0)(2 4 -6 0 -5))) ( x y z ) = (-2/11 -6/11 9/22 6/11) f(-2/11, -6/11, 9/22) = 1.289256 and |D| = 192 > 0 => minimum
Power Plant A power plant (PP) is 1000 feet down stream on opposite bank of a 200 feet wide river. Cable costs $50/ft on land and $80/ft under water. Find best cost of installation. 1000 - x x d C(x) = 50(1000 – x) + 80(x2 + 2002)1/2 C'(x) = -50 + 80/ (x2 + 2002)1/2 = 0 when x = 160.1 => d = 256.2 => 1000 - x = 840 Cost = 840 * 50 + 256 * 80 = $62,488. 200 Power Plant x rd 5/13/2019
Unconstrained Extrema Given f(x, y) = 2x4 + y2 - x2 -2y, determine the relative extremea of f, if any. fx = 8x3 - 2x = 0; fy = 2y – 2 = 0 x = 0; ½, -½ ; y = 1 3 candidates (0, 1), (½ , 1) (-½, 1) fxx = 24x2 - 2 > 0 for x = ½ & -½ and negative for x = 0. D = = -4 for (0, 1) saddle, 8 for (½, 1) f( ½ , 1) = -9/8; f(0, 1) = -1 relative minimum at ( ½, 1) and saddle point at (0, 1) rd 5/13/2019
Constrained Minimum Find minimum value of W(x, y, z) = x2 + y2 + z2 subject to x + y + z =1. Let L(x, y, z, ) = x2 + y2 + z2 + (x + y + z – 1) Then Lx = 2x + = 0, Ly = 2y + = 0, Lz = 2z + = 0, L = x + y + z – 1 = 0 (solve '((2 0 0 1 0)(0 2 0 1 0)(0 0 2 1 0)(1 1 1 0 1))) (1/3 1/3 1/3 -2/3) => W = 1/3. 2 0 0 0 2 0 = 8 > 0 => minimum 0 0 2 rd 5/13/2019
Constrained Maxima Find the maximum value of w = xy + z subject to x2 + y2 + z2 = 1. L(x, y, z, ) = xy + z = (x2 + y2 + z2 - 1) Lx = y + 2x = 0 y2z + 2 xyz = 0 Ly = x + 2y = 0 x2z + 2 xyz = 0 Lz = 1 + 2z = 0 xy + 2 xyz = 0 L = x2 + y2 + z2 -1 = 0 y2z = x2z = xy => z = 0 or y2 = x2 z = 0 can't be; thus y2 = x2; if x = y then x2z = xy = x2 => x = 0 or z = 1. Max at (0, 0, 1); w(0, 0, 1) = z = 1. rd 5/13/2019
Critical Points Find and label the critical points of F(x, y) = 2x2 + y2 – 2xy + 5x - 3y + 1 Fx = 4x - 2y + 5 = 0 Fxx = 4 Fxy = -2 Fy = 2y - 2x - 3 = 0 Fyx = -2 Fyy = 2 \ (solve '((4 -2 -5)(-2 2 3))) (-1, ½ ) D = 12 => (-1, ½ ) is relative minimum F(-1, ½) = 2 + ¼ + 1 - 5 - 3/2 + 1 = -9/4. rd 5/13/2019
Find the inverse of the following matrices by forming the adjacency matrix with the identity matrix attached and converting the initial matrix to the identity matrix. A = B = A-1 = B-1 = 1 4 1 0 1 4 1 0 1 0 -3/5 4/5 2 3 0 1 0 -5 -2 1 0 1 2/5 -1/5 rd 5/13/2019
Problems 1. Maximize the rectangular area with perimeter p. Symmetry => p/4 per side with p2/16 area. 2. f(x) = 2x2 –10x + 50 for x 0. 5/2 f'(x) = 4x -10 = 0 when x = 5/2, f(5/2) = 37.5 f"(x) = 4 => minimum, f(0) = 50; f() = 3. f(x) = x3 – 100x2 + 3125x => f(0) = 0 f'(x) = 3x2 -200x + 3125 = 0 and f"(x) = 6x – 200 (quadratic 3 -200 3125) (41.667 25) f(25) = 31,250 is relative maximum and f(41.67) = 28,935.18 is relative minimum (poly-eval '(3 -200 3125) '(41 42) (-32 17 ) => crossing rd 5/13/2019
Practice S-1 Write the equation of the tangent to the curve y = x3 - 6x2 + 9x + 1 where its slope is a minimum. S-2 Find the inverse of matrix 1 2 3 4 S-3 The cost for a machine is $1000 the first 5 years and $2000 the next 5 years. At i = 10% per year, the annual worth is closest to a) $1225 b) $1302 c) $1383 d) $1426 S-4 Max 3x1 + 4x2 subject to 2x1 + 3x2 <= 12 and 5x1 + 3x2 <= 15 S-5 Min 12x1+ 15x2 subject to 2x1 + 5x2 >= 3 and 3x1 + 3x2 >= 4 S-6 Write and sole the duals if S-4 and S-5. rd 5/13/2019
Solution S-1 Write the equation of the tangent to the curve y = x3 - 6x2 + 9x + 1 where its slope is a minimum. Slope function is S(x) = 3x2 –12x + 9 = 0 S'(x) = 6x – 12 = 0 when x = 2 S(2) = -3 is the minimum slope at x = 2, y = 3 (y – 3) = -3(x – 2) or slope fn y = -3x + 9 (cubic 1 -6 9 1) -0.1038 (quadratic 3 -12 9) 1, 3 rd 5/13/2019
Example Find the inverse of matrix 1 2 3 4 Inverse matrix Method I a + 3b = 1; 2a + 4b = 0 => a = -2b, => b = 1 c + 3d = 0 => c = -3d; 2c + 4d = 1 => -2d = 1 or d = -1/2 c = 3/2, b = 1, a = -2 Method II 1 2 1 0 1 2 1 0 1 0 -2 1 3 4 0 1 0 -2 -3 1 0 1 3/2 -1/2 (solve '((1 3 0 0 1)(2 4 0 0 0)(0 0 1 3 0)(0 0 2 4 1))) (-2 1 3/2 -1/2) rd 5/13/2019
Lagrange Multipliers You need 100 units made at 2 plants with the total cost function C = 0.1x2 + 7x + 15y + 1000. How should you divide the units between plants x and y to minimize the cost? L(x,y,) = 0.1x2 + 7x + 15y +1000 + (x + y – 100) Lx = 0.2x + 7 + = 0 Ly = 15 + = 0 => = -15 and 0.2x + 7 = 15 or x = 40; y = 60. (solve '((.2 0 1 -7)(0 0 1 -15)(1 1 0 100))) (40 60 -15) C(40, 60) = $2349 min. See that Lxx and Lyy are > 0; D > 0 rd 5/13/2019
Lagrange Multipliers Find critical points for f(x, y, z) = x2 + 2y – z2 ; subject to 2x – y = 0; y + z = 0 L(x,y,z,1 2) = x2 + 2y –z2 + 1 (2x – y) + 2(y + z) Lx = 2x + 21 = 0 => 1 = -x Ly = 2 - 1 + 2 = 0 => 1 - 2 = 2 Lz = -2z + 2 = 0 => 2 = 2z L 1 = 2x – y = 0 => y = 2x L 2 = y + z = 0 => y = -z (solve '((2 0 0 2 0 0)(0 0 0 -1 1 -2)(0 0 -2 0 1 0) (2 -1 0 0 0 0)(0 1 1 0 0 0))) (2/3 4/3 -4/3 -2/3 -8/3) rd 5/13/2019
Unconstrained Extrema Given f(x, y) = 2x4 + y2 - x2 -2y, determine the relative extreme of f, if any. fx = 8x3 - 2x = 0; fy = 2y – 2 = 0 x = 0; ½, -½ ; y = 1 3 candidates (0, 1), (½ , 1) ( -½, 1) fxx = 24x2 - 2 > 0 for x = ½ & -½ and negative for x = 0. D = = -4 for (0, 1) saddle, 8 for (½, 1) f(½, 1) = -9/8; f(0, 1) = -1 relative minimum at ( ½, 1) and saddle point at (0, 1) rd 5/13/2019
Constrained Minimum Find minimum value of W(x, y, z) = x2 + y2 + z2 subject to x + y + z =1. Let L(x, y, z, ) = x2 + y2 + z2 + (x + y + z – 1) Then Lx = 2x + = 0, Ly = 2y + = 0, Lz = 2z + = 0, L = x + y + z – 1 = 0 (solve '((2 0 0 1 0)(0 2 0 1 0)(0 0 2 1 0)(1 1 1 0 1))) (1/3 1/3 1/3 -2/3) => W = 1/3. 2 0 0 0 2 0 = 8 > 0 => minimum 0 0 2 rd 5/13/2019
Critical Points Find and label the critical points of F(x, y) = 2x2 + y2 – 2xy + 5x - 3y + 1 Fx = 4x - 2y + 5 = 0 Fxx = 4 Fxy = -2 Fy = 2y - 2x - 3 = 0 Fyx = -2 Fyy = 2 \ (solve '((4 -2 -5)(-2 2 3))) (-1, ½ ) D = 12 => (-1, ½ ) is relative minimum F(-1, ½) = 2 + ¼ + 1 - 5 - 3/2 + 1 = -9/4. rd 5/13/2019
Optimization 1. Maximize the rectangular area with perimeter p. Symmetry => p/4 per side with p2/16 area. 2. f(x) = 2x2 –10x + 50 for x 0. 5/2 f'(x) = 4x -10 = 0 when x = 5/2, f(5/2) = 37.5 f"(x) = 4 => minimum, f(0) = 50; f() = 25 41.6 f(x) = x3 – 100x2 + 3125x => f(0) = 0 f'(x) = 3x2 -200x + 3125 = 0 and f"(x) = 6x – 200 (quadratic 3 -200 3125) (41.667 25) f(25) = 31,250 is relative maximum and f(41.67) = 28,935.18 is relative minimum (poly-eval '(3 -200 3125) 41) -32, but at 42 17 rd 5/13/2019
Point of plane nearest to Given Point Find the point of the plane 2x – 3y – 4z = 25 which is nearest to the point (3, 2, 1) D2 = (x – 3)2 + (y – 2)2 + (z – 1)2 where z = ¼ (2x – 3y – 25) D2 = (x – 3)2 + (y – 2)2 + [½ x – ¾y – (29/4)]2 D2x = 2(x – 3) + 2[½ x – ¾y – (29/4)]½ = 0 D2y = 2(y – 2) = 2[½ x – ¾y – (29/4)]-¾ Simplify to 10x – 3y = 53 -6x + 25 y = -55 (solve '((10 -3 53)(-6 25 -55))) (5, -1) => z = -3 rd 5/13/2019
Circle in Polar Coordinates Graph r = 5 rd 5/13/2019
Partials Given z = 3x3y2 – 4x2y4, find zxx b) zyx c) zyy d) zxxx zx = 9x2y2 – 8xy3 => zxx = 18xy2 – 8y3 zy = 6x3y – 16x2y3 => zyx = 18x2y – 32xy3 zyy = 6x3 – 48x2y2 zxxx = 18y2 rd 5/13/2019
Minimum Distance Find the minimum distance s between the origin and the plane 2x + 2y + z = 6. S2 = f(x, y) = x2 + y2 + z2 = x2 + y2 + (6 – 2x – 2y)2 fx = 2x + 2(6 – 2x – 2y)(-2) = 0 = 2x - 4(6 – 2x – 2y) 10x + 8y = 24 fy = 2y + 2(6 – 2x – 2y)(-2) = 0 = 2y – 4(6 – 2x – 2y) 8x + 10y = 24 (Solve '((10 8 24)(8 10 24))) (4/3, 4/3) Z = 18/3 – 16/3 = 2/3 S = (16/9 + 16/9 + 4/9)1/2 = 2 rd 5/13/2019
Diophantine Equation Find integral solutions to 12x + 7y = 220. x = (220 – 7y)/12 = 18 – (7y - 4)/12 (7y - 4)/12 <= 17 or 0 < y < 29 x = 2; y = 28 rd 5/13/2019
Average Speed 60 You travel from a to b averaging 30mph. How fast must you travel back from b to a to average 60 mph for the round trip? rd 5/13/2019