Lagrange Multipliers Calculator

Published on: July 21, 2026
Final Answer: Free Full Steps: Pro

This Lagrange Multipliers Calculator maximizes or minimizes \(f(x, y)\) subject to a constraint \(g(x, y) = k\). It sets up \(\nabla f = \lambda \nabla g\) with the constraint, solves the system, and compares the values step by step.

Step-by-step method

  1. Set up the objective f and the constraint g = k.
  2. Find the gradients of f and g.
  3. Write the Lagrange system grad f = lambda grad g together with the constraint.
  4. Solve the system for x, y, and lambda.
  5. Evaluate f at each solution and pick the largest and smallest.

Formula:

\(\nabla f = \lambda \nabla g, \quad g(x,y) = k\)

Example 1:

\(f = x y,\; g = x^{2} + y^{2} = 1\)

Step 1 - Set up the objective f and the constraint g = k.

In this problem: Maximize/minimize \(f = x y\) subject to \(x^{2} + y^{2} = 1\).

\(f = x y,\; g = x^{2} + y^{2} = 1\)

Step 2 - Find the gradients of f and g.

In this problem: \(\nabla f = \langle y, x \rangle\), \(\nabla g = \langle 2 x, 2 y \rangle\).

\(\nabla f = \langle y,x \rangle,\quad \nabla g = \langle 2 x,2 y \rangle\)

Step 3 - Write the Lagrange system grad f = lambda grad g together with the constraint.

In this problem: Set the gradient equations equal with the multiplier, plus the constraint.

\(\begin{cases} y = \lambda\left(2 x\right) \\ x = \lambda\left(2 y\right) \\ x^{2} + y^{2} = 1 \end{cases}\)

Step 4 - Solve the system for x, y, and lambda.

In this problem: Solving the system gives the candidate points.

\(\begin{gathered} f(- \frac{\sqrt{2}}{2},\frac{\sqrt{2}}{2}) = - \frac{1}{2} \\ f(\frac{\sqrt{2}}{2},- \frac{\sqrt{2}}{2}) = - \frac{1}{2} \\ f(- \frac{\sqrt{2}}{2},- \frac{\sqrt{2}}{2}) = \frac{1}{2} \\ f(\frac{\sqrt{2}}{2},\frac{\sqrt{2}}{2}) = \frac{1}{2} \end{gathered}\)

Step 5 - Evaluate f at each solution and pick the largest and smallest.

In this problem: At \((- \frac{\sqrt{2}}{2}, \frac{\sqrt{2}}{2})\): \(f = - \frac{1}{2}\). At \((\frac{\sqrt{2}}{2}, - \frac{\sqrt{2}}{2})\): \(f = - \frac{1}{2}\). At \((- \frac{\sqrt{2}}{2}, - \frac{\sqrt{2}}{2})\): \(f = \frac{1}{2}\). At \((\frac{\sqrt{2}}{2}, \frac{\sqrt{2}}{2})\): \(f = \frac{1}{2}\). The maximum is \(\frac{1}{2}\) and the minimum is \(- \frac{1}{2}\).

\(f_{\max} = \frac{1}{2},\quad f_{\min} = - \frac{1}{2}\)

Final answer:

\(f_{\max} = \frac{1}{2},\quad f_{\min} = - \frac{1}{2}\)

Example 2:

\(f = x + y,\; g = x^{2} + y^{2} = 2\)

Step 1 - Set up the objective f and the constraint g = k.

In this problem: Maximize/minimize \(f = x + y\) subject to \(x^{2} + y^{2} = 2\).

\(f = x + y,\; g = x^{2} + y^{2} = 2\)

Step 2 - Find the gradients of f and g.

In this problem: \(\nabla f = \langle 1, 1 \rangle\), \(\nabla g = \langle 2 x, 2 y \rangle\).

\(\nabla f = \langle 1,1 \rangle,\quad \nabla g = \langle 2 x,2 y \rangle\)

Step 3 - Write the Lagrange system grad f = lambda grad g together with the constraint.

In this problem: Set the gradient equations equal with the multiplier, plus the constraint.

\(\begin{cases} 1 = \lambda\left(2 x\right) \\ 1 = \lambda\left(2 y\right) \\ x^{2} + y^{2} = 2 \end{cases}\)

Step 4 - Solve the system for x, y, and lambda.

In this problem: Solving the system gives the candidate points.

\(\begin{gathered} f(-1,-1) = -2 \\ f(1,1) = 2 \end{gathered}\)

Step 5 - Evaluate f at each solution and pick the largest and smallest.

In this problem: At \((-1, -1)\): \(f = -2\). At \((1, 1)\): \(f = 2\). The maximum is \(2\) and the minimum is \(-2\).

\(f_{\max} = 2,\quad f_{\min} = -2\)

Final answer:

\(f_{\max} = 2,\quad f_{\min} = -2\)