Lagrange multipliers
∇f = λ∇g
The idea
Optimization with a constraint: at the optimal point the gradients of the goal and the constraint are parallel.The board
- Maximize f(x, y) subject to g(x, y) = c.
- At the optimum: ∇f = λ∇g — the two arrows point the same way.
- Example: the largest area of a rectangle with perimeter 20 → a 5 × 5 square.
- λ has a meaning: how much you'd gain if the constraint were loosened by one unit (the “shadow price”).
The most common mistake
Forgetting to include the constraint g = c itself in the system.The trick
Economists call λ the “marginal utility” of the resource.Problems
At the optimum, ∇f and ∇g are…
- parallel
- perpendicular
- equal in length
- zero
Show the answer
parallel — Lagrange.
Largest area with perimeter 20?
- 25
- 20
- 100
- 24
Show the answer
25 — A 5 × 5 square.