Lagrange Multipliers: Example and Explanation
Introduction
The method of Lagrange multipliers finds extrema of a function
f (x, y, . . . )
subject to a constraint
g(x, y, . . . ) = 0.
At a constrained extremum the gradients satisfy
∇f = λ∇g.
Worked Example
Problem: Find the maximum and minimum of
f (x, y) = xy
subject to the constraint
x2 + y 2 = 1.
Lagrangian and Stationarity Conditions
Form the Lagrangian
L(x, y, λ) = xy − λ(x2 + y 2 − 1).
Setting partial derivatives to zero gives
∂L
: y − 2λx = 0,
∂x
∂L
: x − 2λy = 0,
∂y
∂L
: x2 + y 2 − 1 = 0.
∂λ
From the first two equations,
y = 2λx,
x = 2λy.
1
Combining gives x = 4λ2 x, so either x = 0 or 4λ2 = 1.
Note: If x = 0 then the first equation forces y = 0, contradicting x2 + y 2 = 1. Therefore
x = 0 is not admissible. Hence 4λ2 = 1 and
λ = ± 12 .
Solutions
• For λ = 12 we have y = 2λx = x, and x2 + y 2 = 2x2 = 1, so x = ± √12 . Thus
√1 , √1
2
2
,
− √12 , − √12
,
where f = 21 .
• For λ = − 12 we have y = −x, giving
√1 , − √1
,
2
2
− √12 , √12 ,
where f = − 21 .
Conclusion
max f (x, y) = 21 ,
x2 +y 2 =1
min f (x, y) = − 12 .
x2 +y 2 =1
Maxima occur at (± √12 , ± √12 ) (same signs) and minima at (± √12 , ∓ √12 ) (opposite signs).
Quick verification by parameterization
Let x = cos t, y = sin t. Then
f (x, y) = cos t sin t = 12 sin(2t),
which achieves its global maximum 21 and minimum − 12 on the circle that is consistent with
the Lagrange result.
Visualization of the Example
The figure shows the unit circle and several level curves of f (x, y) = xy. The tangency points
correspond to the constrained extrema.
2
y
− √12 , √12
√1 , √1
2
2
x
− √12 , − √12
3
√1 , − √1
2
2