Skip to main content

Lagrange Multiplier Calculator

Optimize a quadratic objective with one linear constraint.

Solve with Lagrange multiplier
Objective coefficients (ax^2 + by^2 + cxy)
Constraint d·x + e·y = k

How to Use

  1. Enter the quadratic coefficients a, b, c for f(x, y) = ax^2 + by^2 + cxy.
  2. Set the linear constraint d·x + e·y = k.
  3. Run the calculation to solve the Lagrange system for x, y, and λ.
  4. Review the optimized point and objective value on the constraint line.

How the Lagrange multiplier method works

Lagrange multipliers incorporate constraints into the objective by adding λ times the constraint equation. Stationary points satisfy the gradient equations and the constraint simultaneously.

  • Form the Lagrangian L = f(x, y) + λ(d x + e y - k).
  • Set partial derivatives ∂L/∂x, ∂L/∂y, and the constraint to zero.
  • Solve the resulting linear system for x, y, and λ.
  • Evaluate the objective at the stationary point to classify performance on the constraint.

Model assumptions in this calculator

  • The objective is quadratic in x and y: ax^2 + by^2 + cxy.
  • There is a single linear equality constraint d·x + e·y = k.
  • A unique stationary point exists when the linear system is solvable.
  • If the determinant is zero, the method cannot provide a unique solution.

Use this setup for quick intuition on constrained quadratics. More complex objectives or multiple constraints require a full symbolic solver.

Frequently Asked Questions

What if d and e are both zero?
The constraint becomes degenerate and cannot restrict the objective. Enter at least one non-zero coefficient for the constraint to find a valid stationary point.
How do I know if this point is a minimum or maximum?
This tool returns the stationary point on the constraint. To classify it, examine the quadratic form (e.g., via eigenvalues of the Hessian) or test nearby feasible points.
Can I extend this to more variables?
The method generalizes, but this calculator focuses on two variables with one linear constraint for clarity. For larger systems, apply the same gradient and constraint equations with additional multipliers.

Related Calculators

math
Absolute Value Inequalities Calculator

Solve absolute value inequalities with steps

math
Add Fractions Calculator

Add, subtract, multiply, and divide fractions

math
Adjugate Matrix Calculator

Calculate adjugate matrix with steps