Optimisation: Hessian and Lagrange
Critical points and their classification with the Hessian, leading principal minors for three or more variables, constrained optimisation with a Lagrange multiplier, and economic word problems.
Course notes: Syllabus ch. 8 (Unconstrained and constrained optimization) · Exercise sessions: Sheet 11, exam problems · About 55 minutes
Unconstrained extrema of f(x, y)Important
A local maximum or minimum of a smooth function can only occur at a critical point, where all first partials vanish: fx = 0 and fy = 0. To classify it, evaluate the second partials there and the Hessian determinant D = fxxfyy − fxy2:
| Condition at the critical point | Conclusion |
|---|---|
| D > 0 and fxx > 0 | local minimum |
| D > 0 and fxx < 0 | local maximum |
| D < 0 | saddle point |
| D = 0 | the test is inconclusive |
Two critical points
f(x, y) = x3 + y3 − 3xy.
First order conditions
Solve
Second partials
At (0, 0)
At (1, 1)
Classify every critical point separately: one function can have several types.
A firm with two products
Profit π(x, y) = 60x + 50y − 2x2 − xy − y2.
First order conditions
Solve
Hessian
Produce 10 and 20 units for a maximal profit of π(10, 20) = 800.
Three or more variables: leading principal minorsNeutral
With n variables solve ∇f = 0 and look at the Hessian H at the point. Its leading principal minors D1, D2, ..., Dn are the determinants of the top-left 1 × 1, 2 × 2, ..., n × n blocks.
| Signs of D1, D2, D3, ... | Conclusion |
|---|---|
| all positive: +, +, + | local minimum (H positive definite) |
| alternating, starting negative: −, +, − | local maximum (H negative definite) |
| Dn ≠ 0 but neither pattern | saddle point |
| Dn = 0 | inconclusive |
Three variables
f(x, y, z) = 2x2 + y2 + 3z2 + 2xy − 4x − 2z.
Gradient = 0
Critical point
Hessian
Minors
A local (here even global) minimum with value f(2, −2, 1/3) = −13/3.
For two variables the rule is the same: D1 = fxx and D2 = D.
Constrained optimisation with LagrangeImportant
To optimise f(x, y) subject to a constraint g(x, y) = c, form the Lagrangian and set all its partials to zero:
The first two equations say ∇f = λ∇g: at the optimum the level curve of f touches the constraint curve. The third equation is the constraint itself. The multiplier λ is the shadow price: the approximate change of the optimal value when c rises by one unit. When the constraint is easy to solve for one variable, substitution into f is an equivalent shortcut.
Utility under a budget
Maximise U = xy subject to 3x + 2y = 60.
Lagrangian
Conditions
Solve
Multiplier
Best bundle (10, 15) with U = 150. One extra unit of budget raises maximal utility by about λ = 5.
A word problem: the cheapest closed box
A closed box with a square base x by x and height h must hold 16 m3. Bottom and lid cost 2 per m2, the sides 1 per m2. Minimise the cost.
Objective and constraint
Substitute
Differentiate
Back to h
A 2 by 2 by 4 box costing 16 + 32 = 48. With Lagrange you get the same point and λ = 2 (the extra cost of one more m3).
Key takeaways
- Critical point: all first partials zero.
- D = fxxfyy − fxy2: D > 0 with fxx > 0 min, fxx < 0 max; D < 0 saddle; D = 0 no conclusion.
- n variables: leading principal minors all positive means min, alternating from negative means max.
- Lagrange: L = f − λ(g − c), three equations for x, y and λ.
- λ is the shadow price of the constraint.
- Substitution is an equivalent route when the constraint is simple.
True or false (5)
Every critical point is a local maximum or minimum.
At a critical point with fxx = 2, fyy = 3, fxy = 1 there is a local minimum.
In L = f − λ(g − c), the equation Lλ = 0 gives back the constraint.
If the leading principal minors are 3, −2, 5, the point is a local minimum.
f = x2 − y2 has a saddle point at the origin.
Multiple choice (7)
The critical point of f = x2 + 4y2 − 6x + 8y is...
At a critical point fxx = −2, fyy = −5, fxy = 3. The point is...
Maximise xy subject to x + y = 20. The maximum is...
With Lagrange, λ = 4 at the optimum. If c rises by 0.5, the optimal value changes by about...
The Hessian of f = x2 + xy + y2 is...
Leading principal minors −1, 2, −3 mean...
Minimise x2 + y2 subject to x + y = 4. The minimum is at...
Exam-style open questions (3)
Find and classify
Find and classify all critical points of f(x, y) = x3 − 12x + y2 − 2y.
Show a model answer outline
- fx = 3x2 − 12 = 0 gives x = ±2; fy = 2y − 2 = 0 gives y = 1.
- fxx = 6x, fyy = 2, fxy = 0.
- (2, 1): D = 24 > 0, fxx > 0: local minimum, f = 8 − 24 + 1 − 2 = −17.
- (−2, 1): D = −24 < 0: saddle point.
Revenue under a marketing budget
Ads cost 20 each (a) and campaigns 100 each (c), with a budget of 2000. Revenue is R = 10√(ac). Maximise R.
Show a model answer outline
- L = 10√(ac) − λ(20a + 100c − 2000).
- La: 5√(c/a) = 20λ; Lc: 5√(a/c) = 100λ. Dividing: a/c = 5, so a = 5c.
- 100c + 100c = 2000: c = 10, a = 50; R = 10√500 ≈ 223.6, half the budget on each instrument.
Lagrange with a quadratic
Minimise f = x2 + 2y2 subject to x + y = 3, and interpret λ.
Show a model answer outline
- L = x2 + 2y2 − λ(x + y − 3).
- 2x = λ, 4y = λ, so x = 2y; then 3y = 3: y = 1, x = 2, λ = 4.
- Minimum f = 4 + 2 = 6. Raising the 3 to 3.1 raises the minimum by about 0.4.
LabCritical point finder
The default has a saddle point and a minimum. Try x^2 - y^2 or a profit function.
LabThree-variable Hessian lab
Flip the sign of one squared term to see a saddle point.
LabLagrange multiplier lab
The utility example and a cost example are built in.
LabCobb-Douglas optimiser
Notice the budget share rule: a/(a + b) of the budget goes to x.