MAT257Y1/Unit 8
Unit 8 · Analysis II

Extrema & Lagrange Multipliers

Finding a maximum is two separate problems: locating the candidates, and deciding which is which. The first is a first-derivative condition, the second a second-derivative one, and both change shape when the domain carries a constraint. The multiplier method turns a constrained problem into an unconstrained one, and the implicit function theorem is what makes it legal.

By the end you can
Why it matters & where it comes from
Why it exists

Optimisation under constraints is most of applied mathematics. Solving the constraint and substituting works only when you can solve it; the multiplier method never needs to, which is why it survives into settings where the constraint is a differential equation.

In the real world

Support vector machines, portfolio optimisation, maximum entropy distributions, and the equilibrium conditions of thermodynamics are all multiplier computations. The multiplier itself usually has a meaning: a price, a temperature, a marginal cost.

Story & open questions

Lagrange introduced the method in his 1788 Mécanique analytique as a way to handle mechanical constraints. The inequality version — the Karush–Kuhn–Tucker conditions of the 1940s–50s — is the foundation of modern nonlinear programming and is where the subject went next.

Unconstrained extrema

Theorem First-order condition

If $f$ is differentiable at an interior point $a$ of its domain and $a$ is a local maximum or minimum, then $Df(a)=0$.

For each direction $u$, the function $t\mapsto f(a+tu)$ has an interior extremum at $t=0$, so its one-variable derivative $Df(a)u$ vanishes. True for every $u$, so $Df(a)=0$. Such an $a$ is called a critical point.

Definition Definiteness

A symmetric matrix $H$ is positive definite if $h^{T}Hh>0$ for all $h\ne0$, negative definite if the inequality reverses, and indefinite if $h^{T}Hh$ takes both signs. By the spectral theorem from MAT247H1, the sign pattern of the eigenvalues decides which.

Theorem Second-order test

Let $f$ be $C^2$ with $\nabla f(a)=0$.

$Hf(a)$ positive definite gives a strict local minimum.
$Hf(a)$ negative definite gives a strict local maximum.
$Hf(a)$ indefinite gives a saddle: neither.
$Hf(a)$ singular but semidefinite: no conclusion.

The proof is Taylor. With $\nabla f(a)=0$, $f(a+h)-f(a)=\tfrac12h^{T}Hf(a)h+o(\|h\|^2)$. If $H$ is positive definite its smallest eigenvalue $\mu>0$ gives $h^{T}Hh\ge\mu\|h\|^2$, and for small $h$ that beats the remainder. Indefinite: pick eigenvectors of opposite sign and the two restrictions of $f$ go opposite ways.

Example The degenerate case is genuinely undecided

All of $x^4+y^4$, $-x^4-y^4$ and $x^4-y^4$ have zero gradient and zero Hessian at the origin, and the origin is a minimum, a maximum and a saddle respectively. When the Hessian is singular, the second-order test cannot possibly decide, and you must look at $f$ itself.

In $\mathbb{R}^2$ use the discriminant. With $D=f_{xx}f_{yy}-f_{xy}^2$: $D>0$ and $f_{xx}>0$ is a minimum, $D>0$ and $f_{xx}<0$ a maximum, $D<0$ a saddle, $D=0$ no information. It is the determinant and trace of a $2\times2$ symmetric matrix in disguise.

Constrained extrema

Theorem Lagrange multipliers

Let $f$ and $g_1,\dots,g_k$ be $C^1$ near $a$, let $M=\{x:g_1(x)=\dots=g_k(x)=0\}$, and suppose the gradients $\nabla g_1(a),\dots,\nabla g_k(a)$ are linearly independent. If $f$ restricted to $M$ has a local extremum at $a$, then there are scalars $\lambda_1,\dots,\lambda_k$ with

$\nabla f(a)=\lambda_1\nabla g_1(a)+\dots +\lambda_k\nabla g_k(a).$
Proof Via the tangent space
Independence of the $\nabla g_i$ means $Jg(a)$ has rank $k$, so by Unit 7 the set $M$ is near $a$ a graph, and its tangent space is $T=\ker Jg(a)$.
Take any $v\in T$. There is a $C^1$ curve $\gamma$ in $M$ with $\gamma(0)=a$ and $\gamma'(0)=v$ — run along the graph. Then $f\circ\gamma$ has an extremum at $0$, so $\nabla f(a)\cdot v=0$.
So $\nabla f(a)$ annihilates $\ker Jg(a)$, which by linear algebra means it lies in the row space of $Jg(a)$: a linear combination of the $\nabla g_i$. ∎

The geometry in one line: at a constrained extremum the level set of $f$ is tangent to $M$, so their normals are parallel.

Example Largest product on a sphere

Maximise $f(x,y,z)=xyz$ on $x^2+y^2+z^2=3$. The condition $\nabla f=\lambda\nabla g$ reads $yz=2\lambda x$, $xz=2\lambda y$, $xy=2\lambda z$. Multiplying the three by $x,y,z$ and comparing gives $x^2=y^2=z^2=1$, so the candidates are the eight points $(\pm1,\pm1,\pm1)$. The maximum value is $1$, attained where an even number of coordinates are negative.

Example The AM–GM inequality

Maximise $x_1\cdots x_n$ subject to $x_1+\dots+x_n=s$ with all $x_i>0$. The multiplier equations force all $x_i$ equal, so the maximum of the product is $(s/n)^n$. Rearranged, that is exactly $\sqrt[n]{x_1\cdots x_n}\le(x_1+\dots+x_n)/n$.

Global extrema on a compact set

Method Three places to look

A continuous $f$ on a compact $K$ attains its maximum, by Unit 3. To find it:

(1) Interior critical points: solve $\nabla f=0$ inside.
(2) Boundary: parametrise it or run Lagrange with the boundary equation as constraint.
(3) Corners and edges where the boundary is not smooth, and points where the rank condition fails. These carry no derivative test at all; evaluate $f$ directly.

Then compare finitely many values. No second-order test is needed: the extreme value theorem already promised the maximum exists, so the largest candidate is it.

Example On a square

Maximise $f(x,y)=x^2-y^2+2x$ on $[-1,1]^2$. Interior: $\nabla f=(2x+2,-2y)$ vanishes at $(-1,0)$, which is on the boundary, so there is no interior critical point. Edges: on $x=1$, $f=3-y^2$ with maximum $3$ at $y=0$; on $x=-1$, $f=-1-y^2$ with maximum $-1$; on $y=\pm1$, $f=x^2+2x-1$ with maximum $2$ at $x=1$. Largest value $3$ at $(1,0)$.

Multipliers find candidates, not answers. The method produces necessary conditions. Deciding which candidate is the maximum needs either compactness plus comparison, or a second-order condition on the tangent space — the bordered Hessian test.
Common pitfalls

• Applying the first-order condition at a boundary point. It holds at interior points only; the maximum of $x$ on $[0,1]$ has nonzero derivative.
• Concluding "saddle" from a singular Hessian. Singular means the test is silent, not that the point is a saddle.
• Forgetting to check that the constraint gradients are independent. Where they are dependent the multiplier equation can fail outright.
• Solving the multiplier equations and forgetting the constraint itself. It is one of the equations of the system.
• Assuming a critical point exists. On a non-compact set $f$ may have no extremum at all, and $e^x$ on $\mathbb{R}$ has neither.

Practice

Original problems written for this guide in the style of Spivak and Munkres exercises. Write a full solution before opening the answer.

Practice 1 · Classify

Find and classify the critical points of $f(x,y)=x^3-3xy+y^3$.

Solution
$\nabla f=(3x^2-3y,\,-3x+3y^2)=0$ gives $y=x^2$ and $x=y^2$, so $x^4=x$: $x=0$ or $x=1$. Points $(0,0)$ and $(1,1)$. The Hessian is $\begin{smallmatrix}6x&-3\\-3&6y\end{smallmatrix}$, with determinant $36xy-9$: at $(0,0)$ it is $-9<0$, a saddle; at $(1,1)$ it is $27>0$ with $f_{xx}=6>0$, a local minimum.
Practice 2 · Closest point

Find the point of the plane $x+2y+3z=6$ nearest the origin.

Solution
Minimise $\|x\|^2$ subject to the plane. $\nabla f=2(x,y,z)=\lambda(1,2,3)$, so $(x,y,z)$ is a multiple of $(1,2,3)$; substituting into the constraint gives $t\cdot14=6$, so the point is $\tfrac37(1,2,3)$ with distance $6/\sqrt{14}$.
Practice 3 · Two constraints

Maximise $x+y+z$ on the intersection of $x^2+y^2=1$ and $z=x+y$.

Solution
Substitute: maximise $2(x+y)$ on the unit circle, which is $2\sqrt2$ at $x=y=1/\sqrt2$, so $z=\sqrt2$. Multipliers give the same answer; substitution is legitimate here because the second constraint solves cleanly.
Practice 4 · Degenerate Hessian

Classify the origin for $f(x,y)=x^2y^2$.

Solution
Gradient and Hessian both vanish. But $f\ge0$ with $f(0,0)=0$, so the origin is a (non-strict) global minimum. The test was silent; direct inspection answered.
Practice 5 · Rectangle in an ellipse

Find the largest-area axis-aligned rectangle inscribed in $x^2/a^2+y^2/b^2=1$.

Solution
Maximise $4xy$ subject to the ellipse. Multipliers give $x=a/\sqrt2$, $y=b/\sqrt2$, area $2ab$. For a circle of radius $r$ that is $2r^2$, the inscribed square.
Practice 6 · Independence fails

Minimise $x$ on $\{y^2=x^3\}$ and explain why the multiplier equation breaks.

Solution
The minimum is at the origin, where $\nabla g=(-3x^2,2y)=(0,0)$ is not independent of anything. The equation $\nabla f=\lambda\nabla g$ reads $(1,0)=\lambda(0,0)$, which has no solution. The hypothesis failed, so the conclusion is not available.
Practice 7 · Meaning of the multiplier

If the constraint is $g(x)=c$, show $\lambda=dM/dc$ where $M(c)$ is the constrained maximum value.

Solution
Let $x(c)$ be the maximiser. Then $M(c)=f(x(c))$ and $M'(c)=\nabla f\cdot x'(c)=\lambda\nabla g\cdot x'(c)$. Differentiating $g(x(c))=c$ gives $\nabla g\cdot x'(c)=1$, so $M'(c)=\lambda$. The multiplier is the shadow price of the constraint.
Practice 8 · Extreme eigenvalues

Show the maximum of $x^{T}Ax$ on the unit sphere, for symmetric $A$, is the largest eigenvalue.

Solution
Multipliers give $2Ax=2\lambda x$, so critical points are unit eigenvectors and the value there is $x^{T}Ax=\lambda$. The sphere is compact, so the maximum is attained, and it is the largest eigenvalue. This is the variational characterisation behind the spectral theorem.

Expanded topic checklist

Course coverage. This unit is part of the complete MAT257Y1 topic map. It should cover the following items before you move on:

Textbook/source alignment

Spivak treats maxima briefly and Lagrange multipliers as an exercise; Munkres gives the tangent space argument in full. For the second-order constrained test, look up the bordered Hessian in an optimisation text. Confirm what the syllabus expects.

Core theorem map

Implicit function theorem gives the tangent space, which gives Lagrange. Taylor gives the second-order test. Extreme value theorem is what guarantees the maximum you are hunting for exists at all.

Study routine. Write every constrained problem twice: once by substitution, once by multipliers. Where substitution is impossible you will see exactly what the method is buying, and where it is possible you get a free check.

Deep practice extensions

Use these after the main practice set. They are designed to force definition-level reasoning, theorem selection, and mixed application rather than routine calculation only.

Extension 1 · Why interior

Why does the first-order condition need an interior point?

Guide
The one-variable argument needs to move in both directions along each line. At a boundary point one direction leaves the domain.
Extension 2 · Geometry of the multiplier

State the Lagrange condition geometrically.

Guide
At a constrained extremum the level set of $f$ is tangent to the constraint set, so $\nabla f$ is normal to the constraint set.
Extension 3 · Silent test

When does the second-order test say nothing?

Guide
When the Hessian is singular. Then the quadratic term does not dominate the remainder in every direction.
Extension 4 · Existence first

Why check compactness before hunting for a maximum?

Guide
Without it the maximum may not exist, and a list of critical points then proves nothing. With it, the largest candidate value is the answer.