Worked examples — Lagrange multipliers — one and two constraints
Before anything: three words we will use constantly.
The scenario matrix
Every cell below is a distinct way this topic can bite. Each worked example names the cell(s) it covers.
| # | Cell class | What makes it distinct | Example |
|---|---|---|---|
| C1 | One constraint, both signs of | max and min from | Ex 1 |
| C2 | Constraint level + shadow price | verify , units | Ex 2 |
| C3 | Degenerate: (singular point) | method silently misses an extremum | Ex 3 |
| C4 | Boundary / product-of-vars, branch | must check the branch you divided away | Ex 4 |
| C5 | Real-world word problem (economics) | translate words → ; interpret | Ex 5 |
| C6 | Two constraints, two real roots (max & min) | in span of two normals | Ex 6 |
| C7 | Two constraints, degenerate: parallel normals | when the method breaks / no solution | Ex 7 |
| C8 | Limiting behaviour: | constraint becomes inactive → unconstrained | Ex 8 |
| C9 | Exam twist: unbounded / no extremum exists | Lagrange returns a point that is a saddle on the curve | Ex 9 |
Ex 1 — Both signs of (cell C1)
Forecast: guess where on the circle is biggest. (Hint: weights more heavily.)
Figure s01 (below): the black unit circle carries four candidate points. The red ones are the maximum, the black ones the minimum; the red arrow shows at the top pointing straight out along the radius — parallel to , exactly the Lagrange condition. Look at how has no sideways (tangential) component there.

- Write the gradients. , . Why this step? Lagrange compares the two arrows; we need them explicitly.
- Set . and . Why? At the extremum has no tangential component, so it is parallel to .
- Read each equation carefully. From the first: , so or . From the second: , so or . Why split like this? Dividing by or would silently drop the / solutions — the very poles of the circle. Never divide away a variable without checking it can be zero.
- Enumerate branches.
- : points , .
- : points , .
- Assign roles. (at ) is the minimum; (at ) is the maximum.
Ex 2 — Nonzero constraint level & shadow price (cell C2)
Forecast: the closest point sits where the line's perpendicular from the origin lands. Guess it before computing.
Figure s02 (below): the black line is the constraint . The red arrow is the shortest path from the origin — it hits the line at right angles at the red point . That perpendicularity is exactly what forces here.

- Gradients. , . Why? Distance-squared is smoother than distance and has the same minimizer — no square roots to differentiate.
- : , . So , . Why keep symbolic? We want as a function of to test the shadow-price claim.
- Impose the constraint : . Why substitute back into the constraint? Steps 1–2 only fixed the direction to the answer (the ratio ); the constraint is what pins the single actual location on the line.
- Point & value. Substitute into and : , so . Why compute as a formula in ? Because the whole point of this cell is to differentiate with respect to and compare it to — a formula lets us do that.
- Plug : , ; distance . Why report distance too? The original question asked for the closest point, so we translate (a squared distance) back into an actual distance.
Ex 3 — Degenerate: misses an extremum (cell C3)
Forecast: the curve looks like a leftward-pointing spike. Where is smallest? Will Lagrange find it?
Figure s03 (below): the black curve is the cusp ; the black arrow points in the "decrease " direction. The red dot marks the cusp tip where the curve has a sharp corner and — there is no normal arrow to draw, which is exactly why Lagrange's equation cannot reach it.

- Gradients. , .
- : and . From the second: or . But makes the first equation — impossible. So . Why does this matter? forces , i.e. the point .
- Check the point. At : . The multiplier equation reads — no finite works. Why? At the cusp the surface has no well-defined normal; is exactly the singular case the parent note warned about (Mistake C).
- Resolve by hand. On the curve , so is minimized at , the cusp . The extremum is real — Lagrange's equation just couldn't produce it.
Ex 4 — Product of variables, the branch (cell C4)
Forecast: is negative in quadrants II/IV, positive in I/III. So max and min should be symmetric values.
- Gradients. , .
- Set : , . Why? At a constrained extremum has no tangential component along the ellipse, so it must be parallel to the ellipse's normal — that parallelism is precisely .
- Multiply them: . So . Why factor, not divide? Dividing by hides the branch . Factoring keeps both branches.
- Branch A: . Then ; points and . These are saddle-value candidates (neither max nor min).
- Branch B: , .
- : ; constraint , . .
- : ; same magnitude, .
Ex 5 — Real-world word problem: economics (cell C5)
Forecast: with capital 4× pricier, will the firm buy more labour or capital?
- Translate. Constraint with budget level (spend the whole budget). Maximize . Why full budget? Output rises in both inputs, so the optimum spends everything. Why keep symbolic? We will need as a function of to interpret .
- Gradients. , .
- Equations. and .
- Divide the two (both sides positive, so safe): . Why divide here? It cancels instantly, giving the ratio of inputs — the economic heart of the answer.
- Budget in terms of : . Why solve for general ? So the optimal-value formula falls out directly in the next step.
- Optimal value as a function of . . Why? This is the general solution before plugging numbers; differentiating it gives the shadow price with no guesswork.
- Plug . , output . Multiplier .
Ex 6 — Two constraints, two real roots (cell C6)
Forecast: the intersection is a tilted circle. should hit a highest and a lowest point on it.
Figure s04 (below): a side view of the tilted intersection circle (black). The red dot is the top of the circle, , where is largest; the black dot at the bottom, , is where is smallest. Two extremes on one closed curve — that's why we expect two real roots.

- Gradients. , , .
- : . Why a combination? On the intersection curve, must lie in the span (plane) of the two normals — no single normal suffices.
- Subtract first two: or . If then eqn 3 gives but eqns 1,2 give — contradiction. So . Why subtract the two equations? Both equal , so their difference eliminates the unknown in one stroke and hands us a clean relation between and — the fastest route to collapse three variables toward one.
- Use constraints to find the points. : . : .
Why now bring in ? Step 3 fixed a direction on the curve; the two constraint equations pin the actual points where that direction meets the circle.
- : : point , (minimum).
- : : point , (maximum).
- Recover the multipliers. Take . From eqn 1: . Substitute into eqn 3: , then . Why bother with ? They confirm genuinely sits in the span of the two normals (a valid solution exists), and are the two shadow prices — sensitivities of to relaxing the sphere and the plane respectively.
- Why two roots? The tilted circle has a top and a bottom in the -direction; the two signs are exactly those two points — one max, one min.
Ex 7 — Two constraints, degenerate parallel normals (cell C7)
Forecast: look hard at the two planes before computing.
- Read the constraints. . But says , so . Why check first? The two planes are parallel () and don't coincide — so the feasible set is empty.
- Confirm via gradients. , . They are linearly dependent (one is a stretch of the other). Why fatal? Lagrange's two-constraint formula needs independent so their span is a genuine plane. If they are parallel, the "plane" collapses to a single line and the method's assumption fails (parent Mistake C, two-constraint version).
- Conclusion. No feasible point exists ⇒ no extremum. Lagrange correctly refuses to produce a solution.
Ex 8 — Limiting behaviour : constraint goes inactive (cell C8)
Forecast: the unconstrained minimum of is , where . What does the constraint do at ?
- Gradients. , .
- Equations. , . So .
- Constraint. .
- Multiplier. . Why watch this? measures how hard the constraint "pushes". As , .
- Interpret. At the constrained minimizer is — the unconstrained minimizer, which already lies on the line. The constraint costs nothing, so its shadow price is zero. This is the limit linking to Unconstrained optimization — critical points.
Ex 9 — Exam twist: Lagrange point that is not a maximum (cell C9)
Forecast: sketch the hyperbola. Does have a maximum on it at all?
Figure s05 (below): the black hyperbola has two branches. The red dot at is the vertex Lagrange lands on; the black annotation shows climbing without bound as you slide up the right branch — so that red dot is the branch's minimum of , not a maximum.

- Gradients. , . Why? We still form both arrows even for a "twist" problem — the trap is in interpreting the result, not in the setup.
- Equations. and . The second gives (rejected, since it kills equation 1) or . So . Why reject ? If , equation 1 reads , impossible — so the only live branch is .
- Impose the constraint. With : . Candidates , with . Why compute here? It confirms both candidates are legitimate stationary points (finite non-zero ); the problem is not that Lagrange failed, but what the points mean.
- Classify honestly. Parametrize the right branch as . As , — grows without bound. So on that branch has no maximum; the point is where is smallest (the vertex), i.e. a minimum, not a maximum. Why parametrize? It converts the implicit curve into an explicit function of one variable so we can watch 's behaviour directly and settle max-vs-min instead of guessing.
- Conclusion. The problem as posed has no maximum of on the hyperbola (). Lagrange truthfully returned as a stationary point, but it is the branch minimum; is the analogous vertex on the left branch. Moral: always ask whether an extremum can even exist (is the objective bounded on the feasible set?) before labelling a Lagrange point.
Recall Self-test
On the unit circle, why does give two different values? ::: Because the max (at , ) and min (at , ) are different constrained extrema, each with its own parallel-scaling factor. What single check would have instantly killed Ex 7? ::: Test if and are linearly independent — here , so the feasible set can be empty and the method is inapplicable.
Connections
- Lagrange multipliers — one and two constraints — the parent theory these examples exercise.
- Gradient and directional derivative — every arrow above.
- Tangent planes and normal vectors — as normals (Ex 6, 7).
- Unconstrained optimization — critical points — the limit (Ex 8).
- KKT conditions — what to do when constraints are inequalities / boundaries appear (Ex 9).
- Level sets and contours — tangency picture behind Ex 1, 4.
- Dual problem and shadow prices — the interpretation in Ex 2, 5.