Linear Algebra
17.59 min read

Solving with Lagrange — A Worked Example

Let us minimize f(x,y)=xy3+x2yf(x,y) = xy^3 + x^2 - y subject to g(x,y)=x2+y2=5g(x,y) = x^2 + y^2 = 5 (a circle of radius 5\sqrt{5}).

The Jacobians are Df(x,y)=[y3+2x,  3xy21]Df(x,y) = [y^3 + 2x,\; 3xy^2 - 1] and Dg(x,y)=[2x,  2y]Dg(x,y) = [2x,\; 2y]. The Lagrange condition λDg=Df\lambda Dg = Df gives two equations: 2λx=y3+2x2\lambda x = y^3 + 2x and 2λy=3xy212\lambda y = 3xy^2 - 1.

Assuming x,y0x, y \neq 0: divide the first by xx and the second by yy to isolate 2λ2\lambda. Equating gives y3/x+2=3xy1/yy^3/x + 2 = 3xy - 1/y — a curve. Intersect this with the constraint circle x2+y2=5x^2 + y^2 = 5 to get candidate points.

Special cases (x=0x = 0 or y=0y = 0) must be handled separately. For each candidate, evaluate ff to find the minimum. The key point: Lagrange finds a finite list of candidates; we just evaluate ff at each and pick the best.

Formal View

Example 17.1 — Lagrange Computation
Minimize f(x,y)=xy3+x2yf(x,y) = xy^3 + x^2 - y s.t. g(x,y)=x2+y2=5g(x,y) = x^2 + y^2 = 5. \n\nLagrange condition: λ[2x,2y]=[y3+2x,  3xy21]\lambda [2x, 2y] = [y^3 + 2x,\; 3xy^2 - 1]. \n\nFor x,y0x, y \neq 0: divide to get 2λ=y3/x+2=3xy1/y2\lambda = y^3/x + 2 = 3xy - 1/y. \nCombined with x2+y2=5x^2 + y^2 = 5, solve numerically for constrained Lagrange points. \n\nA computer can find these intersections; the minimum is the constrained Lagrange point with the smallest ff value.
Remark 17.2 — Practical Solution Strategy
In general, simultaneously solving the Lagrange equations and constraint can be hard. Practical approaches: (1) parameterize the constraint surface and minimize ff restricted to it, or (2) use numerical methods. The Lagrange framework tells us *where to look*, not always *how to find*.

Why This Matters

Solving constrained systems appears in physics, economics, engineering design, and statistical estimation. Lagrange is the standard first tool.

  • Finding eigenvalues of symmetric matrices (next section shows this)
  • Maximum likelihood estimation with constraints in statistics
  • Optimal control: trajectory optimization with dynamics constraints
  • Chemical equilibrium: minimize free energy subject to stoichiometric constraints

Quiz

Question 1

To find constrained optima using Lagrange multipliers, you solve:

Question 2

After finding all constrained Lagrange points, how do you identify the minimum?

Question 3

Special cases like x=0x = 0 or y=0y = 0 must be checked separately in Lagrange problems.

Question 4

For minx+y\min x + y s.t. x2+y2=1x^2 + y^2 = 1, the Lagrange condition gives:

Question 5

Minimize f(x,y)=x+2yf(x,y) = x + 2y s.t. x2+y2=1x^2 + y^2 = 1. The constrained minimum is at:

Common Mistakes

  • Forgetting the constraint g(x)=kg(\mathbf{x}) = k when solving — the Lagrange equations alone are not enough.
  • Treating all Lagrange points as minima without evaluating and comparing ff values.
  • Dividing by zero when eliminating λ\lambda — always check the special cases.