Home

Lagrange Multipliers Calculator

Numerically solve a constrained optimization problem.

展开更多 ▾
∇f = λ ∇g , g(x,y)=c
e.g. x*y
e.g. x+y

📖 Tutorial | Lagrange Multipliers

1. Theorem
To optimize f subject to g=c, set up L=f−λ(g−c) and solve ∇f=λ∇g with g=c. λ is the Lagrange multiplier.
2. Symbols
fobjective
g=cequality constraint
λmultiplier
∇f=λ∇goptimality
3. How it works
  • Iterate from a start;
  • Estimate λ from ∇f and ∇g;
  • Descend L and project back to the constraint;
  • Report the solution and λ.
4. Steps
  1. Enter f, g and c;
  2. Enter start values;
  3. Click Calculate;
  4. Retry with another start if needed.
5. Example
Example: maximize xy on x+y=1.
Solution: (y,x)=λ(1,1) gives x=y; x+y=1 → x=y=0.5, f=0.25.
6. Pitfalls
Multiple extrema may exist; the start matters;
Compare candidates to decide max/min;
λ measures marginal sensitivity to c.

❓ FAQ | Lagrange Multipliers

What does it solve?
Equality-constrained extrema.
Why change the start?
The constraint curve may have several stationary points.
Meaning of λ?
Approx. change in f per unit relaxation of c.
Max or min?
Compare candidate f values.
Is it rigorous?
It is numerical; use theory for proof.