Lagrange Multipliers Notes

Published on: September 29, 2026

This Lagrange Multipliers Calculator finds the largest and smallest values a function can take while a constraint is obeyed, and shows the working line by line. At such a point the two gradients line up, because otherwise you could still slide along the constraint and improve. Setting one gradient to a multiple of the other gives the equations to solve. Following the same pattern every time keeps the constraint in play throughout.

Step-by-step method

  1. Set up the problem.
  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\)
See Example 1 Hide Example 1

Problem

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

Approach

Step-by-step method

  1. Set up the problem.
  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.

Step 1

Step 1 - Set up the problem.

In this problem:

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

Step 2

Step 2 - Find the gradients of f and g.

In this problem:

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

Step 3

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

In this problem:

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

Step 4

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

In this problem:

\(\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

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

In this problem:

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

Final Answer

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

Problem

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

Approach

Step-by-step method

  1. Set up the problem.
  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.

Step 1

Step 1 - Set up the problem.

In this problem:

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

Step 2

Step 2 - Find the gradients of f and g.

In this problem:

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

Step 3

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

In this problem:

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

Step 4

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

In this problem:

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

Step 5

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

In this problem:

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

Final Answer

\(f_{\max} = 2,\quad f_{\min} = -2\)
See Example 3 Hide Example 3

Problem

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

Approach

Step-by-step method

  1. Set up the problem.
  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.

Step 1

Step 1 - Set up the problem.

In this problem:

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

Step 2

Step 2 - Find the gradients of f and g.

In this problem:

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

Step 3

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

In this problem:

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

Step 4

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

In this problem:

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

Step 5

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

In this problem:

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

Final Answer

\(f_{\max} = 5,\quad f_{\min} = -5\)
See Example 4 Hide Example 4

Problem

\(f = x y,\; g = x + y = 10\)

Approach

Step-by-step method

  1. Set up the problem.
  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.

Step 1

Step 1 - Set up the problem.

In this problem:

\(f = x y,\; g = x + y = 10\)

Step 2

Step 2 - Find the gradients of f and g.

In this problem:

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

Step 3

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

In this problem:

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

Step 4

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

In this problem:

\(\begin{gathered} f(5,5) = 25 \end{gathered}\)

Step 5

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

In this problem:

\(f_{\max} = 25,\quad f_{\min} = 25\)

Final Answer

\(f_{\max} = 25,\quad f_{\min} = 25\)