Lagrange Multiplier Calculator
Work out lagrange multiplier instantly with clear inputs, formula shown and shareable results.
About Lagrange Multiplier Calculator
At a constrained optimum the objective's gradient must be parallel to the constraint's gradient, so ∇f = λ∇g. Consistency of λ across the components is the test, and the cross product vanishing confirms parallelism.
Formula
Lagrange condition
∇f = λ∇g, so λ = (∂f/∂x)/(∂g/∂x) = (∂f/∂y)/(∂g/∂y)
Worked example
With the default values below, Lagrange Multiplier Calculator returns Lagrange multiplier λ of 0.50000000. Change any input above and every figure here is recalculated in your browser.
Inputs used
- ∂f/∂x
- 2
- ∂f/∂y
- 3
- ∂g/∂x
- 4
- ∂g/∂y
- 6
Results
- Lagrange multiplier λ
- 0.50000000
- Lagrange condition
- The gradients are parallel, so this is a stationary point of the constrained problem
- ∂f/∂x·∂g/∂y − ∂f/∂y·∂g/∂x (zero when parallel)
- 0.00000000
- λ from the x equation
- 0.50000000
Step by step
- 1Values used
- 2Lagrange condition
- 3Lagrange multiplier λ= 0.50000000
- 4Lagrange condition= The gradients are parallel, so this is a stationary point of the constrained problem
- 5∂f/∂x·∂g/∂y − ∂f/∂y·∂g/∂x (zero when parallel)= 0.00000000
- 6λ from the x equation= 0.50000000
Assumptions and limits
- The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 8 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
For ∇f = (2, 3) and ∇g = (4, 6)?
λ = 0.5 from both components, so the gradients are parallel and the Lagrange condition holds.
What does λ mean?
It is the shadow price: the rate at which the optimal objective value improves as the constraint is relaxed by one unit.
