Lagrange Multipliers Calculator

Published on: August 9, 2026

This Lagrange Multipliers Calculator helps you solve constrained optimization problems for a function of two variables with one equality constraint. The calculator sets up the Lagrange multiplier equations, solves the resulting system together with the constraint, and identifies the candidate points for maxima and minima. This makes it easier to find extreme values subject to a condition. It is a simple way to check answers, understand the method clearly, and practise multivariable calculus step by step.

Step-by-step method

  1. Identify the objective function f(x,y) and the constraint g(x,y)=0.
  2. Compute f_x, f_y, g_x, and g_y with substeps.
  3. Set up the Lagrange system f_x = λg_x, f_y = λg_y, and g = 0.
  4. Solve the system for x, y, and λ.
  5. List the candidate points on the constraint.
  6. Evaluate the objective function at each candidate point.
  7. Compare the values to identify the constrained maximum and constrained minimum.

Formulas:

Lagrange multiplier condition

∇f = λ∇g
fx = λgx
fy = λgy

Constraint equation

g( x, y ) = 0

Classification idea

Solve for all candidate points first
Then compare the objective values f at those points

Example 1: f(x,y)=xy; x^2+y^2=1

Step 1A - Identify the objective function.

In this problem: Read the function to optimize.

f( x, y ) = xy

Step 1B - Identify the constraint.

In this problem: Write the constraint in the form g(x,y) = 0.

g( x, y ) = −1 + x2 + y2 = 0

Step 2A - Differentiate objective term 1 with respect to x.

In this problem: Rule shown by the math.

∂x
(xy) = y·
∂x
(x)

Step 2B - Differentiate objective term 1 with respect to x.

In this problem: Rule shown by the math.

∂x
(x) = 1

Step 2C - Differentiate objective term 1 with respect to x.

In this problem: Rule shown by the math.

∂x
(xy) = y

Step 2D - Combine the results.

In this problem: Add the derivatives from the previous substeps.

fx = y = y

Step 3A - Differentiate objective term 1 with respect to y.

In this problem: Rule shown by the math.

∂y
(xy) = x·
∂y
(y)

Step 3B - Differentiate objective term 1 with respect to y.

In this problem: Rule shown by the math.

∂y
(y) = 1

Step 3C - Differentiate objective term 1 with respect to y.

In this problem: Rule shown by the math.

∂y
(xy) = x

Step 3D - Combine the results.

In this problem: Add the derivatives from the previous substeps.

fy = x = x

Step 4A - Differentiate constraint term 1 with respect to x.

In this problem: Rule shown by the math.

∂x
( -1 ) = 0

Step 4B - Differentiate constraint term 2 with respect to x.

In this problem: Rule shown by the math.

∂x
(x2) = 2x

Step 4C - Differentiate constraint term 3 with respect to x.

In this problem: Rule shown by the math.

∂x
(y2) = 0

Step 4D - Combine the results.

In this problem: Add the derivatives from the previous substeps.

gx = 0 + 2x + 0 = 2x

Step 5A - Differentiate constraint term 1 with respect to y.

In this problem: Rule shown by the math.

∂y
( -1 ) = 0

Step 5B - Differentiate constraint term 2 with respect to y.

In this problem: Rule shown by the math.

∂y
(x2) = 0

Step 5C - Differentiate constraint term 3 with respect to y.

In this problem: Rule shown by the math.

∂y
(y2) = 2y

Step 5D - Combine the results.

In this problem: Add the derivatives from the previous substeps.

gy = 0 + 0 + 2y = 2y

Step 6A - Set up the first Lagrange equation.

In this problem: Use f_x = λg_x.

y = λ·2x

Step 6B - Set up the second Lagrange equation.

In this problem: Use f_y = λg_y.

x = λ·2y

Step 6C - Include the constraint equation.

In this problem: The candidate points must lie on the constraint.

−1 + x2 + y2 = 0

Step 7 - Solve the system.

In this problem: Solve the three equations together for x, y, and λ.

Candidates: (
2
2
,
2
2
)
, λ =
1
2
; (
2
2
,
2
2
)
, λ =
-1
2
; (
2
2
,
2
2
)
, λ =
-1
2
; (
2
2
,
2
2
)
, λ =
1
2

Step 8A - Evaluate the objective function at the candidate point.

In this problem: Substitute the candidate point into f.

f(
2
2
,
2
2
)
=
1
2

Step 8B - Classify the candidate point.

In this problem: Compare this objective value with the others.

(
2
2
,
2
2
)
: Constrained maximum

Step 9A - Evaluate the objective function at the candidate point.

In this problem: Substitute the candidate point into f.

f(
2
2
,
2
2
)
=
-1
2

Step 9B - Classify the candidate point.

In this problem: Compare this objective value with the others.

(
2
2
,
2
2
)
: Constrained minimum

Step 10A - Evaluate the objective function at the candidate point.

In this problem: Substitute the candidate point into f.

f(
2
2
,
2
2
)
=
-1
2

Step 10B - Classify the candidate point.

In this problem: Compare this objective value with the others.

(
2
2
,
2
2
)
: Constrained minimum

Step 11A - Evaluate the objective function at the candidate point.

In this problem: Substitute the candidate point into f.

f(
2
2
,
2
2
)
=
1
2

Step 11B - Classify the candidate point.

In this problem: Compare this objective value with the others.

(
2
2
,
2
2
)
: Constrained maximum

Final answer: Lagrange multiplier candidates classified

Example 2: f(x,y)=x+y; x^2+y^2=1

Step 1A - Identify the objective function.

In this problem: Read the function to optimize.

f( x, y ) = x + y

Step 1B - Identify the constraint.

In this problem: Write the constraint in the form g(x,y) = 0.

g( x, y ) = −1 + x2 + y2 = 0

Step 2A - Differentiate objective term 1 with respect to x.

In this problem: Rule shown by the math.

∂x
(x) = 1

Step 2B - Differentiate objective term 2 with respect to x.

In this problem: Rule shown by the math.

∂x
(y) = 0

Step 2C - Combine the results.

In this problem: Add the derivatives from the previous substeps.

fx = 1 + 0 = 1

Step 3A - Differentiate objective term 1 with respect to y.

In this problem: Rule shown by the math.

∂y
(x) = 0

Step 3B - Differentiate objective term 2 with respect to y.

In this problem: Rule shown by the math.

∂y
(y) = 1

Step 3C - Combine the results.

In this problem: Add the derivatives from the previous substeps.

fy = 0 + 1 = 1

Step 4A - Differentiate constraint term 1 with respect to x.

In this problem: Rule shown by the math.

∂x
( -1 ) = 0

Step 4B - Differentiate constraint term 2 with respect to x.

In this problem: Rule shown by the math.

∂x
(x2) = 2x

Step 4C - Differentiate constraint term 3 with respect to x.

In this problem: Rule shown by the math.

∂x
(y2) = 0

Step 4D - Combine the results.

In this problem: Add the derivatives from the previous substeps.

gx = 0 + 2x + 0 = 2x

Step 5A - Differentiate constraint term 1 with respect to y.

In this problem: Rule shown by the math.

∂y
( -1 ) = 0

Step 5B - Differentiate constraint term 2 with respect to y.

In this problem: Rule shown by the math.

∂y
(x2) = 0

Step 5C - Differentiate constraint term 3 with respect to y.

In this problem: Rule shown by the math.

∂y
(y2) = 2y

Step 5D - Combine the results.

In this problem: Add the derivatives from the previous substeps.

gy = 0 + 0 + 2y = 2y

Step 6A - Set up the first Lagrange equation.

In this problem: Use f_x = λg_x.

1 = λ·2x

Step 6B - Set up the second Lagrange equation.

In this problem: Use f_y = λg_y.

1 = λ·2y

Step 6C - Include the constraint equation.

In this problem: The candidate points must lie on the constraint.

−1 + x2 + y2 = 0

Step 7 - Solve the system.

In this problem: Solve the three equations together for x, y, and λ.

Candidates: (
2
2
,
2
2
)
, λ =
2
2
; (
2
2
,
2
2
)
, λ =
2
2

Step 8A - Evaluate the objective function at the candidate point.

In this problem: Substitute the candidate point into f.

f(
2
2
,
2
2
)
= −2 ≈ -1.41

Step 8B - Classify the candidate point.

In this problem: Compare this objective value with the others.

(
2
2
,
2
2
)
: Constrained minimum

Step 9A - Evaluate the objective function at the candidate point.

In this problem: Substitute the candidate point into f.

f(
2
2
,
2
2
)
= 2 ≈ 1.41

Step 9B - Classify the candidate point.

In this problem: Compare this objective value with the others.

(
2
2
,
2
2
)
: Constrained maximum

Final answer: Lagrange multiplier candidates classified