Multivariable Calculus · Undergraduate
Lagrange Multipliers
Quick answer
To find the largest or smallest value of f(x, y) subject to a constraint g(x, y) = k, look for points where the gradients are parallel: ∇f = λ∇g, with g = k. At such a point a level curve of f touches the constraint curve without crossing it, which is exactly what happens at a constrained maximum or minimum. The multiplier λ is an extra unknown; solving the equations gives candidate points, and comparing f at them picks out the answers. The method extends to three variables unchanged.
What you'll learn
- Set up the Lagrange equations for a constrained problem
- Explain why the gradients are parallel at the optimum
- Solve for candidate points and compare values
- Apply the method to geometry and economics problems
Optimizing along a curve
Maximize when . The points allowed form a line, not the whole plane, so setting does not help: the answer need not be a critical point of . The constraint restricts where to look.
Lagrange’s method. The extreme values of on the curve occur at points where
and
for some number , called the Lagrange multiplier.
Why the gradients line up
Picture the level curves of drawn over the constraint curve. Moving along the constraint, increases as the constraint crosses higher and higher level curves. As long as the constraint crosses a level curve, there is a higher one still reachable. The largest value is reached at the last level curve the constraint meets, which it touches without crossing. Two curves that touch share a tangent line there. The gradients are perpendicular to their curves, so and lie along the same line. At a constrained maximum or minimum, a level curve of is tangent to the constraint, so the gradients are parallel: .
- x + y = 10
- xy = 16
- xy = 25
- xy = 36
Worked examples
Common mistakes
Practice problems
-
Maximize subject to .
Answer
, at
Full solution
and give , and gives . The value is at and at , the minimum.
-
Minimize subject to .
Answer
, at
Full solution
and give .
-
A rectangle has area . Use Lagrange multipliers to find the least possible perimeter.
Answer
, for the square
Full solution
Minimize subject to : and give , so and .
-
Maximize on the circle .
Answer
, at
Full solution
and give parallel to . The unit vector in that direction is , where .
-
Maximize subject to with all positive.
Answer
, at
Full solution
As in Example 4, the equations force , so each is .
-
Write the Lagrange equations for maximizing subject to .
Answer
, ,
Full solution
and . Setting with gives , so , and .
-
In the figure, why is not the answer?
Answer
It crosses the line, so higher level curves are still reachable.
Full solution
Between its two crossings, at and , the line passes through points where . Only a level curve that touches the line without crossing can mark the maximum.
-
What does the constraint look like on the level curves of ? What does Lagrange’s method give?
Answer
The constraint is a level curve of , so everywhere on it.
Full solution
holds with at every point, so every point is a candidate, and every point gives the same value. The method is consistent with a constant function.
-
Find the point of the line closest to the origin.
Answer
Full solution
Minimize : and give , so and . The distance is , matching .
-
A student solves Example 1 by setting and finds only . What went wrong?
Hint
Is on the line ?
Answer
The constraint was ignored. is not even on the line; the method needs .
Full solution
The unconstrained critical point of is a saddle at the origin, which does not satisfy . Along the line, the extreme is where a level curve touches it, at .
Frequently asked questions
What is the method of Lagrange multipliers?
To optimize f(x, y) subject to g(x, y) = k, solve ∇f = λ∇g together with g = k, then compare the values of f at the solutions.
Why must the gradients be parallel?
At a constrained extreme, the level curve of f through the point touches the constraint curve. Touching curves share a tangent line, so their normals, the gradients, point along the same line.
What is λ?
An extra unknown, the Lagrange multiplier. It usually is not needed in the final answer, but it measures how fast the optimal value changes as the constraint level k changes.
How do you tell the maximum from the minimum?
Evaluate f at every candidate point. On a closed, bounded constraint curve, the largest value is the maximum and the smallest is the minimum.
Does the method work in three variables?
Yes. Solve ∇f = λ∇g with g(x, y, z) = k: four equations in the four unknowns x, y, z and λ.