Lagrange Multipliers
Optimise something while a constraint holds. The answer is where the level lines just graze the constraint, and lambda is what that costs.
Lagrange Multipliers
This module needs JavaScript: the numbers are computed in the page rather than recorded.
Worth knowing
∇f = λ ∇g. That proportionality is the whole method.Overview
The tangency condition
To optimise f(x,y) subject to g(x,y) = c, form the Lagrangian L = f − λ(g − c). At a regular constrained optimum, the gradients satisfy ∇f = λ∇g. The constraint curve and a level curve of f are tangent there: moving along the constraint gives no first-order improvement.
Example: maximise xy subject to x + y = 10 with x,y > 0. Set ∇(xy) = (y,x) and ∇(x+y) = (1,1), so y = λ and x = λ; hence x = y = 5 and the maximum product is 25. The boundary condition and positivity are part of the problem, not optional details.
The tangency condition
To optimise f(x,y) subject to g(x,y) = c, form the Lagrangian L = f − λ(g − c). At a regular constrained optimum, the gradients satisfy ∇f = λ∇g. The constraint curve and a level curve of f are tangent there: moving along the constraint gives no first-order improvement.
Example: maximise xy subject to x + y = 10 with x,y > 0. Set ∇(xy) = (y,x) and ∇(x+y) = (1,1), so y = λ and x = λ; hence x = y = 5 and the maximum product is 25. The boundary condition and positivity are part of the problem, not optional details.