Skip to content

Why Lagrange multipliers work

7 min read

Short answer

At a constrained maximum or minimum, the level curve of ff just touches the constraint curve g=cg=c without crossing it. Touching curves share a tangent, so their normals are parallel: ∇f=λ∇g\nabla f=\lambda\nabla g. That equation, together with the constraint, locates the candidates.

Diagram∇fmax
Maximize x + y on the circle x² + y² = 2. The best level line x + y = 2 touches the circle at (1,1); any larger level line misses the circle entirely.

The tangency picture

Sweep the level curve f=kf=k upward in kk. While it still crosses the constraint curve, some constrained points have a larger ff available by sliding along the constraint. The last value of kk at which the level curve still meets the constraint is the maximum, and there the two curves touch. Crossing curves have different tangents; touching curves share one.

The short proof

Parametrize the constraint near the optimum as a curve r(t)\mathbf{r}(t) with g(r(t))=cg(\mathbf{r}(t))=c. Two facts follow:

  1. f(r(t))f(\mathbf{r}(t)) has an extremum at the optimum, so its derivative vanishes: ∇f⋅r′=0\nabla f\cdot\mathbf{r}'=0, so ∇f⊥r′\nabla f\perp\mathbf{r}'.
  2. gg is constant along the curve, so ∇g⋅r′=0\nabla g\cdot\mathbf{r}'=0, so ∇g⊥r′\nabla g\perp\mathbf{r}'.

In the plane, two vectors perpendicular to the same nonzero tangent are parallel, so ∇f=λ∇g\nabla f=\lambda\nabla g. This needs ∇g≠0\nabla g\neq\mathbf{0}, which is the regularity condition: where the constraint has a corner or cusp the method can miss solutions.

What the multiplier means

The multiplier measures how fast the optimal value changes if you loosen the constraint: if F∗(c)F^*(c) is the optimum with constraint g=cg=c, then dF∗dc=λ\dfrac{dF^*}{dc}=\lambda. In economics this is the "shadow price" of the constraint.

Remember the method only finds candidates. Compare their values, and check endpoints or boundaries separately if the constraint region has any.

Worked example

Maximize f(x,y)=xyf(x,y)=xy subject to x+y=10x+y=10, and interpret λ\lambda.

∇f=(y,x)=λ(1,1)\nabla f=(y,x)=\lambda(1,1) gives y=x=λy=x=\lambda. The constraint x+y=10x+y=10 then gives x=y=5x=y=5 and λ=5\lambda=5, with maximum value 2525.

Interpretation: with x+y=cx+y=c the maximum is c2/4c^2/4, whose derivative at c=10c=10 is c/2=5=λc/2=5=\lambda. ✓

Try it yourself

Find the maximum and minimum of f(x,y)=x+yf(x,y)=x+y on the circle x2+y2=2x^2+y^2=2.

Show the answer

(1,1)=λ(2x,2y)(1,1)=\lambda(2x,2y) gives x=y=12λx=y=\tfrac1{2\lambda}. The constraint gives 24λ2=2\tfrac{2}{4\lambda^2}=2, so λ=±12\lambda=\pm\tfrac12. The points are (1,1)(1,1) with f=2f=2 (maximum) and (−1,−1)(-1,-1) with f=−2f=-2 (minimum).

Keep going with practice

Vidi's constrained-optimization lessons practice the setup this geometric picture justifies.