Tutorials › Calculus III › Solving One-Constraint Systems by Substitution

Lagrange Multipliers · Tutorial 455 of 999

Solving One-Constraint Systems by Substitution

Use the constraint to reduce a Lagrange system to equations in the variables, then factor, solve, and check all resulting candidates.

Intermediate 10 min read

What You'll Learn

  • Eliminate the multiplier from a two-variable Lagrange system using a determinant condition.
  • Substitute a constraint into the resulting equation and factor it into solvable cases.
  • Recognize why regularity of the constraint allows the multiplier to be recovered.
  • Solve polynomial examples and verify every candidate against the original system.
  • Distinguish necessary stationary-point candidates from conclusions about maximum or minimum values.

Why Solve the System by Substitution?

For a differentiable objective \(f(x,y)\) subject to a smooth equality constraint \(g(x,y)=c\), the Lagrange equations introduce a multiplier \(\lambda\). The equations are often straightforward to write down, but solving them can be the harder part. A useful strategy is to eliminate \(\lambda\), use the constraint to reduce the variables, and factor the resulting equation.

This approach is especially effective when the objective and constraint are polynomials. Substitution may turn a system of three equations in \(x\), \(y\), and \(\lambda\) into one equation whose factors identify the possible cases. Each case must still be solved against the constraint, and every resulting point must be checked in the original Lagrange equations.

Definition: For the constraint \(g(x,y)=c\), a Lagrange candidate is a point \((x,y)\) satisfying the constraint and the equations \(\nabla f(x,y)=\lambda\nabla g(x,y)\) for some real number \(\lambda\). If \(\nabla g(x,y)\ne\mathbf{0}\), the constraint is regular at that point.

When the constraint is regular, the Lagrange theorem says that a differentiable objective can have a constrained local extremum there only if the Lagrange equations hold. Thus solving the equations finds necessary candidates; it does not by itself prove that a candidate is a maximum or minimum. The method below assumes regularity at the feasible points being considered.

Eliminating the Multiplier

Write the Lagrange equations in components:

$$ f_x=\lambda g_x, \qquad f_y=\lambda g_y, \qquad g(x,y)=c. $$

Multiply the first equation by \(g_y\) and the second by \(g_x\). Their right-hand sides are both \(\lambda g_xg_y\), so subtracting gives an equation that does not contain \(\lambda\):

$$ f_xg_y-f_yg_x=0. $$

This determinant condition says that the two gradient vectors are parallel. It is equivalent to the existence of a multiplier when \(\nabla g\ne\mathbf{0}\): if \(g_x\ne0\), set \(\lambda=f_x/g_x\), and the determinant equation then gives \(f_y=\lambda g_y\). If \(g_x=0\), regularity forces \(g_y\ne0\); the determinant equation gives \(f_x=0\), and setting \(\lambda=f_y/g_y\) satisfies both component equations.

Why the elimination works: In two variables, two vectors are parallel exactly when their \(2\)-by-\(2\) determinant is zero. Under the regularity condition \(\nabla g\ne\mathbf{0}\), this parallelism is precisely the Lagrange condition for some \(\lambda\).

After forming \(f_xg_y-f_yg_x=0\), use the constraint to substitute for one variable where convenient. Factoring the resulting expression reveals branches of possible solutions. This elimination step is a way to solve the equations, not a replacement for checking them: degenerate points where \(\nabla g=\mathbf{0}\) must be treated separately if they are feasible.

A Linear Constraint

Worked Example: A Quadratic Objective on a Line

Find the Lagrange candidates for \(f(x,y)=x^2+y^2\) subject to \(x+2y=6\).

Let \(g(x,y)=x+2y\) and \(c=6\). The gradients are \(\nabla f=(2x,2y)\) and \(\nabla g=(1,2)\). The Lagrange equations are

$$ 2x=\lambda, \qquad 2y=2\lambda, \qquad x+2y=6. $$

The first equation gives \(\lambda=2x\); the second gives \(\lambda=y\). Equating these expressions yields \(y=2x\). Substituting into the constraint gives \(x+2(2x)=6\), so \(5x=6\), \(x=6/5\), and \(y=12/5\). The multiplier is \(\lambda=2x=12/5\).

Check the constraint: \(6/5+2(12/5)=30/5=6\). Check the gradient equations: \(2x=12/5=\lambda\) and \(2y=24/5=2\lambda\). Thus the only Lagrange candidate is \((6/5,12/5)\). The constraint gradient \((1,2)\) is nonzero everywhere, so it is regular at this point.

Factoring After Substitution

For a nonlinear constraint, the determinant equation often gives a polynomial that factors into separate cases. The constraint then determines the points in each case. It is important to solve every factor branch: dividing by a factor before checking whether it can be zero may discard valid candidates.

Worked Example: A Product on the Unit Circle

Find all Lagrange candidates for \(f(x,y)=xy\) subject to \(x^2+y^2=1\).

Here \(g(x,y)=x^2+y^2\), so \(\nabla f=(y,x)\) and \(\nabla g=(2x,2y)\). The determinant condition is

$$ f_xg_y-f_yg_x =y(2y)-x(2x) =2(y^2-x^2) =2(y-x)(y+x) =0. $$

Thus \(y=x\) or \(y=-x\). For \(y=x\), the constraint gives \(2x^2=1\), hence \(x=y=1/\sqrt{2}\) or \(x=y=-1/\sqrt{2}\). For \(y=-x\), it again gives \(2x^2=1\), hence \((x,y)=(1/\sqrt{2},-1/\sqrt{2})\) or \((-1/\sqrt{2},1/\sqrt{2})\).

Check the multiplier for the first branch. The component equations are \(y=2\lambda x\) and \(x=2\lambda y\). At \(y=x\ne0\), both give \(\lambda=1/2\). At \(y=-x\ne0\), both give \(\lambda=-1/2\). Each point satisfies \(x^2+y^2=1\), and substituting the stated multiplier satisfies both gradient equations. Since \(\nabla g=(2x,2y)\ne\mathbf{0}\) on the unit circle, these four points are exactly the Lagrange candidates.

A Polynomial Objective with a Zero-Factor Branch

The next example shows why every factor branch matters. One factor will set a coordinate equal to zero, and those points must be retained even though a later algebraic step on the other branch will divide by that coordinate.

Worked Example: A Cubic Objective on the Unit Circle

Find all Lagrange candidates for \(f(x,y)=x^2y\) subject to \(x^2+y^2=1\).

The gradients are \(\nabla f=(2xy,x^2)\) and \(\nabla g=(2x,2y)\). Eliminating \(\lambda\) gives

$$ f_xg_y-f_yg_x =(2xy)(2y)-(x^2)(2x) =4xy^2-2x^3 =2x(2y^2-x^2) =0. $$

First consider \(x=0\). The constraint becomes \(y^2=1\), so the candidates on this branch are \((0,1)\) and \((0,-1)\). At either point, \(\nabla f=(0,0)\), while \(\nabla g=(0,2y)\ne\mathbf{0}\). The Lagrange equations hold with \(\lambda=0\).

Now consider \(2y^2-x^2=0\), or \(x^2=2y^2\). Substituting into the constraint gives \(2y^2+y^2=1\), so \(y^2=1/3\) and \(x^2=2/3\). Therefore this branch gives all four sign choices:

$$ (x,y)=\left(\pm\sqrt{\frac{2}{3}},\ \pm\frac{1}{\sqrt{3}}\right). $$

To check these four points, use the first component equation \(2xy=2\lambda x\). Since \(x\ne0\), it gives \(\lambda=y\). The second component equation requires \(x^2=2\lambda y=2y^2\), which holds by construction. The constraint also holds because \(x^2+y^2=2/3+1/3=1\). The two points on the \(x=0\) branch and the four points on the other branch exhaust the factors and satisfy the original system. The constraint gradient is nonzero everywhere on the unit circle.

A Reliable Solving Procedure

The examples use the same logical sequence. Keeping the branches visible prevents missed solutions and makes the final verification systematic.

1
Write the full system.
Set \(\nabla f=\lambda\nabla g\) and include the constraint \(g(x,y)=c\).
2
Eliminate the multiplier.
Form \(f_xg_y-f_yg_x=0\), or eliminate \(\lambda\) directly from the component equations.
3
Substitute and factor.
Use the constraint to reduce the equation, then list every factor branch without dividing away possible zeros.
4
Solve each branch and verify.
Find the points satisfying both the branch and constraint, recover \(\lambda\) when regular, and check the original equations.

Common Pitfall: Dividing by a Variable Too Soon

In the cubic example, the condition was \(2x(2y^2-x^2)=0\). A mistaken solution might divide by \(x\) and keep only \(2y^2-x^2=0\). That would discard \(x=0\) and miss the valid candidates \((0,1)\) and \((0,-1)\).

The correction is to apply the zero-product property first: either \(x=0\), or \(2y^2-x^2=0\). Solve both branches with the constraint, then check both against the original Lagrange equations. More generally, cancellation is valid only after establishing that the canceled quantity cannot be zero among the solutions.

Important limitation: Solving the Lagrange system produces necessary candidates at regular feasible points; it does not classify them as maxima or minima. Singular feasible points with \(\nabla g=\mathbf{0}\) also require separate attention, because the regular Lagrange theorem does not cover them.

Check Your Understanding

Use the determinant condition and the constraint where appropriate. Keep every factor branch and verify proposed points in the original system.

  1. For \(f(x,y)=x^2+y^2\) subject to \(x-y=2\), write the Lagrange equations and solve for the candidate and multiplier.
  2. For \(f(x,y)=xy\) subject to \(x^2+y^2=4\), factor the multiplier-free equation and find all candidate points.
  3. Why does \(f_xg_y-f_yg_x=0\) imply a multiplier exists when \(\nabla g\ne\mathbf{0}\)?
  4. In solving \(2x(2y^2-x^2)=0\), what solutions might be lost by dividing by \(x\) immediately?
  5. Does satisfying the Lagrange equations alone prove that a point is a constrained maximum? Explain.