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
| f | objective |
| g=c | equality constraint |
| λ | multiplier |
| ∇f=λ∇g | optimality |
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
- Enter f, g and c;
- Enter start values;
- Click Calculate;
- 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.