max xy with x + y = 10
x = y = 5
xy = 25, λ = 5.
To optimise subject to , solve together with the constraint .
This page is easier if you are comfortable with:
At a constrained maximum or minimum, the level curve of is tangent to the constraint curve, so the gradients are parallel: for some multiplier .
This gives equations in , and , which you solve with the constraint.
The multiplier has a meaning: it measures how the optimal value changes with . At a constrained extremum the gradients are parallel, the nature of the point can be tested with the Hessian test, and the one-variable idea is stationary points. A closely connected idea is Partial derivatives commute.
This page is part of Multivariable calculus in Calculus. Topics that work alongside it: Hessian and second-derivative test, Gradient and directional derivative, Stationary points, Jacobian for a change of variables, Double integral in polar coordinates and Spherical coordinates.
Lagrange multipliers find the maximum or minimum of a function subject to a constraint, by requiring that the gradients of the function and the constraint are parallel.
The largest value of xy that still touches the line is where the curve xy = 25 just touches it, at (5, 5).
These examples are worked by hand, step by step, so you can compare your own working.
Maximise subject to .
Minimise subject to .
Maximise subject to .
A few situations come up again and again. Knowing them saves time and helps you spot answers that cannot be right.
x = y = 5
xy = 25, λ = 5.
x = y = 1
value 2.
x = y = 1
value 2.
∇(xy) = (y, x) = λ(1, 1)
λ = 5.
To optimise f subject to g = c, solve ∇f = λ∇g together with g = c. The multiplier λ is the rate of change of the optimum with c.
f = xy, g = x + y = 10: y = λ, x = λ so x = y. Find x.
Find xy at x = y = 5.
min x² + y² with x + y = 2: value at (1, 1).
Find λ = x for xy with x + y = 10.
only ∇f = λ∇g ✗
also g = c ✓
Include it.
assume ✗
compare values ✓
Test.
sign conventions ✗
be consistent ✓
Check.
x = 0 case ✗
consider all cases ✓
Divide carefully.
Try each one on paper, then open the answer. Use the solver above to see the full working.
16
8
36
10
4
18
Unlimited fresh questions with instant marking. Choose a level, work it out on paper, then type your answer.
Solve: …
A method for optimising f subject to g = c.
∇f = λ∇g and g = c.
The rate of change of the optimum with c.
Compare all candidate values.
Hessian and second derivative test.
double integrals in polar coordinates.
More in Calculus and the formula sheets.