Loading…

Lagrange Multipliers Optimizer

Math Calculus • Differential Equations

View all topics

Solve constrained optimization problems using Lagrange multipliers. The calculator builds \(\nabla f=\lambda_1\nabla g_1+\lambda_2\nabla g_2\), solves the stationarity system, ranks the candidates found, and shows the constraint set in a draggable animated graph.

One constraint \(\displaystyle \nabla f=\lambda\nabla g,\qquad g=0\) Two constraints \(\displaystyle \nabla f=\lambda\nabla g+\mu\nabla h\) 3D example \(\displaystyle f=xyz,\quad x+y+z=9\) Candidate check \(\displaystyle f_x-\lambda g_x-\mu h_x=0\)

Objective and constraints

Supported variables: x, y, and optionally z. Supported functions: sin, cos, tan, sqrt, abs, exp, ln, and log.
More starting points can find more candidates, but they take longer.
Live preview

Quick examples

Ready
Enter an objective and constraints, then click “Optimize”.

Rate this calculator

0.0 /5 (0 ratings)
Be the first to rate.
Your rating
You can update your rating any time.

Frequently Asked Questions

What form should I use for constraints?

Enter constraints as expressions equal to zero. For example, x + y + z = 9 should be entered as x + y + z - 9.

What does the Lagrange multiplier equation mean?

At a constrained optimum, the gradient of the objective is a linear combination of the gradients of the active equality constraints.

Does this calculator prove a global maximum or minimum?

It finds and ranks numerical Lagrange candidates inside the selected search box. For a formal global proof, endpoints, boundaries, compactness, and inequality constraints may also need to be checked separately.

Can it solve problems with two constraints?

Yes. In three variables it can use two equality constraints and solves grad f = lambda grad g1 + mu grad g2 together with both constraints.

Why might no candidate be found?

The selected search box may not contain a solution, the constraints may not intersect, the numerical solver may need more starting points, or the system may be singular.

What does the graph show?

The graph shows the constraint set in variable space and marks the numerical Lagrange candidates found by the solver.