Constrained Optimization and Lagrange Multipliers MATH 311, Calculus III J. Robert Buchanan Department of Mathematics Fall 2011
Constrained Optimization In the previous section we found the local or absolute extrema of a function either on the entire domain of the function or on a bounded region. Now we will look for extrema which satisfy some side condition(s) known as constraint(s).
Example Find the point on the parabola y = x 2 + 3x + 2 closest to the origin. f (x, y) = x 2 + (x 2 + 3x + 2) 2 2.0 1.5 1.0 0.5 2 1 1 2 x 0.5 1.0 1.5
Geometry (1 of 2) Note: At the minimum distance from the origin the parabola and the circle are tangent. The normals to the parabola and the circle are parallel at the point of tangency. The gradient is always normal to the curve.
Geometry (2 of 2) Gradients: parabola: x 2 + 3x + 2 y = 0 circle: x 2 + y 2 = r 2 (x 2 + y 2 ) = λ (x 2 + 3x + 2 y) 2x, 2y = λ 2x + 3, 1 Equivalent system of equations: 2x = λ(2x + 3) 2y = λ 0 = x 2 + 3x + 2 y
Solution y = x 2 + 3x + 2 λ = 2(x 2 + 3x + 2) 0 = 2(x 2 + 3x + 2)(2x + 3) 2x x 0.682817 which implies y 0.417788.
Method of Lagrange Multipliers (1 of 2) Problem: find the extreme values of f (x, y, z) subject to the constraint g(x, y, z) = 0. Solution: Suppose f has an extremum at (x 0, y 0, z 0 ) on the surface S defined by g(x, y, z) = 0. Let C be a curve traced out by the vector-valued function r(t) = x(t), y(t), z(t) such that r(t 0 ) = x 0, y 0, z 0. Define h(t) = f (x(t), y(t), z(t)), then at the extremum h (t 0 ) = 0.
Method of Lagrange Multipliers (2 of 2) 0 = h (t 0 ) = f x (x(t 0 ), y(t 0 ), z(t 0 ))x (t 0 ) + f y (x(t 0 ), y(t 0 ), z(t 0 ))y (t 0 ) + f z (x(t 0 ), y(t 0 ), z(t 0 ))z (t 0 ) = f x (x 0, y 0, z 0 ), f y (x 0, y 0, z 0 ), f z (x 0, y 0, z 0 ) x (t 0 ), y (t 0 ), z (t 0 ) = f (x 0, y 0, z 0 ) r (t 0 ) Thus f (x 0, y 0, z 0 ) is orthogonal to r (t 0 ).
Method of Lagrange Multipliers (2 of 2) 0 = h (t 0 ) = f x (x(t 0 ), y(t 0 ), z(t 0 ))x (t 0 ) + f y (x(t 0 ), y(t 0 ), z(t 0 ))y (t 0 ) + f z (x(t 0 ), y(t 0 ), z(t 0 ))z (t 0 ) = f x (x 0, y 0, z 0 ), f y (x 0, y 0, z 0 ), f z (x 0, y 0, z 0 ) x (t 0 ), y (t 0 ), z (t 0 ) = f (x 0, y 0, z 0 ) r (t 0 ) Thus f (x 0, y 0, z 0 ) is orthogonal to r (t 0 ). Since r(t) is arbitrary, f (x 0, y 0, z 0 ) is orthogonal to S and hence parallel to g(x 0, y 0, z 0 ). f (x 0, y 0, z 0 ) = λ g(x 0, y 0, z 0 )
Result Theorem Suppose that f (x, y, z) and g(x, y, z) are functions with continuous first partial derivatives and g(x, y, z) 0 on the surface g(x, y, z) = 0. Suppose that either 1 the minimum value of f (x, y, z) subject to the constraint g(x, y, z) = 0 occurs at (x 0, y 0, z 0 ); or 2 the maximum value of f (x, y, z) subject to the constraint g(x, y, z) = 0 occurs at (x 0, y 0, z 0 ). Then f (x 0, y 0, z 0 ) = λ g(x 0, y 0, z 0 ), for some constant λ (called a Lagrange multiplier).
Equivalent Set of Equations f x (x, y, z) = λg x (x, y, z) f y (x, y, z) = λg y (x, y, z) f z (x, y, z) = λg z (x, y, z) g(x, y, z) = 0
Equivalent Set of Equations f x (x, y, z) = λg x (x, y, z) f y (x, y, z) = λg y (x, y, z) f z (x, y, z) = λg z (x, y, z) g(x, y, z) = 0 For functions of two variables this becomes: f x (x, y) = λg x (x, y) f y (x, y) = λg y (x, y) g(x, y) = 0
Example (1 of 3) Find the extreme values of f (x, y) = 2x 3 y subject to x 2 + y 2 = 4. 3 2 1 y 0 1 2 3 3 2 1 0 1 2 3 x
Example (2 of 3) 2 y 0 1 1 10 2 5 z 0 5 10 2 1 0 x 1 2
Example (3 of 3) System of equations: 6x 2 y = 2λx 2x 3 = 2λy x 2 + y 2 = 4 Cases: If x = 0 then λ = 0 and y = ±2. If x 0 then x 2 = 3y 2 and y = ±1 and x = ± 3. Maximum f (± 3, ±1) = 6 3, minimum f (± 3, 1) = 6 3.
Inequality Constraint (1 of 3) Find the extrema of f (x, y) = 4xy subject to x 2 + 4y 2 8. 3 2 1 y 0 1 2 3 3 2 1 0 1 2 3 x
Example (2 of 3) 2 y 0 2 5 z 0 5 2 0 x 2
Example (3 of 3) System of equations: Cases: 4y = 2λx 4x = 8λy x 2 + 4y 2 = 8 If λ = 1 then (x, y) = (±2, ±1). If λ = 1 then (x, y) = (±2, 1). Maximum f (±2, ±1) = 8, minimum f (±2, 1) = 8. There is a critical point at (x, y) = (0, 0) but this is a saddle point according to the Second Derivatives Test.
Two Equality Constraints (1 of 3) Example Maximize f (x, y, z) = 3x + y + 2z subject to y 2 + z 2 = 1 and x + y z = 0. 2 y 1 0 1 2 2 1 z 0 1 2 2 1 x 0 1 2
Two Equality Constraints (2 of 3) (3x + y + 2z) = λ (y 2 + z 2 1) + µ (x + y z) This is equivalent to the system of equations: 3 = µ 1 = 2λy + µ 2 = 2λz µ 1 = y 2 + z 2 0 = x + y z
Two Equality Constraints (3 of 3) The five equations can be reduced to: 1 = λy 5 = 2λz 1 = y 2 + z 2 0 = x + y z The first 3 equations yield λ = ± 29/2, then (x, y, z) = (±7/ 29, 2/ 29, ±5/ 29). Maximum: f (7/ 29, 2/ 29, 5/ 29) = 29 and minimum: f ( 7/ 29, 2/ 29, 5/ 29) = 29.
Homework Read Section 12.8. Pages 1020-1022: 1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45