Lagrange Multipliers
Extremize f on g = c by solving f = λ g.
The idea
Lagrange's condition. To find the largest or smallest value of $f(x, y)$ among the points that satisfy a constraint $g(x, y) = c$, look for the points where $\nabla f$ is a scalar multiple of $\nabla g$: $\nabla f = \lambda \nabla g, \qquad g(x, y) = c.$ The scalar $\lambda$ is the Lagrange multiplier. Written out in components, the vector equation is two equations, and with the constraint that is three equations for the three unknowns $x$, $y$ and $\lambda$.
The condition is geometric. The constraint $g = c$ is a curve, and the search is confined to it. At a constrained extremum, $f$ cannot still be increasing in either direction along the curve, so the rate of change of $f$ along the curve is zero — that is, $\nabla f$ is perpendicular to the curve. And $\nabla g$ is perpendicular to the same curve, because $g$ is constant along it. Two vectors in the plane perpendicular to the same line are scalar multiples of one another, which is exactly what the equation asserts. In the figure below, the constraint curve $g = c$ crosses several level curves of $f$ and is tangent to one of them — there the two gradients align, while elsewhere sliding along the constraint still changes $f$.
The method returns candidates, not a verdict: evaluate $f$ at each solution and compare the values to decide which is the maximum and which the minimum.
Ways to work on it
- Walkthrough. Maximize a product under a sum constraint — geometric picture, full system, and meaning of the multiplier.
- Practice. Maximize a product of two variables under a randomized sum constraint.
- Hardest. Maximize a linear objective on a circle — a nonlinear constraint.
Not sure where to start? Take the ten-question placement test.