Worked example: the Lagrange method (equality) end-to-end
Parent: lagrangian · Prereq: lagrangian
A representative equality-constrained instance — pure Lagrange multipliers, no inequality (so no complementary slackness). Note the method returns all constrained stationary points at once: here a minimum and a maximum.
Problem. Extremize f(x,y)=x+2y on the circle h(x,y)=x²+y²−1=0. Geometrically: how far can the linear function x+2y reach while staying on the unit circle.
1. Lagrangian & stationarity
∇ₓL=0 gives 1+2λx=0, 2+2λy=0 ⟹ x=−1/(2λ), y=−1/λ; and ∂L/∂λ=0 recovers x²+y²=1.
2. Solve — both stationary points
Substitute into the constraint: 1/(4λ²)+1/λ²=1 ⟹ 5/(4λ²)=1 ⟹ λ=±√5/2.
λ=+√5/2:(x,y)=(−1/√5,−2/√5),f=−√5— minimum;λ=−√5/2:(x,y)=(+1/√5,+2/√5),f=+√5— maximum.
3. Geometric check
The known result: min aᵀx subject to ‖x‖=1 is −‖a‖, attained at x=−a/‖a‖. Here a=(1,2), ‖a‖=√5, so x*=−(1,2)/√5 ✓. At x*, ∇f=(1,2) is parallel to ∇h=(2x,2y) (∇f=−λ∇h) — the level line of f is tangent to the circle.
4. Shadow price
Relax the constraint to x²+y²=c. By scaling, p*(c)=−√(5c), so dp*/dc=−√5/(2√c). At c=1: =−√5/2=−λ. Hence ∂p*/∂c=−λ — the multiplier is the marginal value of the constraint level, exactly as derived in general. ✓
Inequality version (with complementary slackness) → kkt-worked-example.