Master's · Master's

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

  1. Maximize f(x, y) subject to g(x, y) = c.
  2. At the optimum: ∇f = λ∇g — the two arrows point the same way.
  3. Example: the largest area of a rectangle with perimeter 20 → a 5 × 5 square.
  4. λ 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.

Take the lesson · exercises and XPFree, no sign-up needed.

You need to know