Near a point, a C² field equals its value, plus its gradient dotted with the step, plus half a quadratic form in the step whose symmetric matrix is the Hessian. At a critical point the gradient term is zero, so the sign of the quadratic form, read off from the Hessian's eigenvalues by the spectral theorem, decides between maximum, minimum and saddle. Absolute extrema on a closed bounded set are found by comparing the critical points with the boundary.
Taught in 375/376Apostol, not taughtBeyond the courseApostol Vol. 2, 9.9 to 9.13 (Theorems 9.4 to 9.7), 9.13 #5, #6, #16, #18, #21, #23, #24, #25Spagnolie, Lecture 24 and the Final ReviewMATH 375 Practice Final 2013 (problems 2 and 8)Peano's surface (1899), history only
In one variable, a point where f′=0 is a maximum if f′′<0, a minimum if f′′>0, and the test says nothing if f′′=0. The reason is Taylor’s formula: f(a+h)≈f(a)+21f′′(a)h2 when f′(a)=0. In many variables the same argument works, but the second derivative is now a matrix, and “positive” has to mean “positive in every direction at once”. This chapter makes that precise. The matrix of second derivatives is symmetric (5.5), so the spectral theorem (3.1) turns the question into one about its eigenvalues. The last section does the other half of an optimisation problem: on a closed bounded set the extremum may sit on the boundary, where the gradient need not vanish.
Before you start
1.4: Taylor’s theorem with the Lagrange remainder, and the one-variable second-derivative test. 3.2: positive definite matrices and their eigenvalues. 5.2: the gradient is zero at an interior extremum. 5.5: the matrix of second partials is symmetric.
Quick checkFor f(x)=x4 we have f′(0)=0 and f′′(0)=0. What does the one-variable second-derivative test say about x=0?
When f′′(a)=0 the test gives no information: x4 has a minimum, −x4 a maximum and x3 neither, all with f′=f′′=0 at 0. The many-variable test has the same blind spot, now whenever an eigenvalue of the Hessian is 0.Review: Taylor polynomials and the second-derivative test
Quick checkA symmetric matrix A has eigenvalues 3 and −1. The quadratic form vTAv is:
In the eigenvector coordinates vTAv=3w12−w22, which is positive for w=(1,0) and negative for w=(0,1). A form with eigenvalues of both signs is indefinite; its level sets are hyperbolas.Review: definiteness and eigenvalues
Quick check∇f(a)=O. Must a be a local maximum or a local minimum?
Move the two eigenvalue sliders. Both positive: a bowl, with level curves that are ellipses. Both negative: a dome. One of each: a saddle, whose level curves are hyperbolas and whose zero level set (the orange curve, through the critical point) is two crossing lines. The dashed coloured lines in the right-hand map are the eigenvector directions of the Hessian: the surface curves up along a green one and down along a red one. Rotate the axes with the angle slider: the surface does not change shape, only the matrix entries do, and the type stays the same. That is the whole content of the chapter: the type of a critical point is the sign pattern of the eigenvalues, and it does not depend on the coordinates. The same saddle, as a real surface with contours:
The idea, in words
Suppose ∇f(a)=O. The first-order Taylor formula of 5.3 says f(a+v)−f(a) is smaller than any multiple of ∥v∥. To see which sign it has, go one order further. In one variable the next term is 21f′′(a)v2. In n variables it is 21∑i,jDijf(a)vivj=21vTHv: a quadratic form (3.2) in the step. Whatever the leftover is, it is small compared with ∥v∥2. So if the quadratic form is positive for every nonzero v, with room to spare, then f(a+v)>f(a) for small v: a minimum. If it takes both signs, then f is above f(a) in some directions and below it in others: a saddle. The eigenvalues are how one reads off the signs: rotate to the eigen-axes and the form becomes ∑λiwi2.
Where this came from· Taylor, Hesse and a surface that looked like a minimum
Brook Taylor published the series that bears his name in his 1715 book Methodus incrementorum directa et inversa, as a formula with no careful treatment of convergence or of the size of the error. The remainder in the form used in 1.4 is credited to Lagrange, in his Théorie des fonctions analytiques of 1797. The determinant of the matrix of second derivatives was introduced by Otto Hesse in the early 1840s, in his work on the inflection points of cubic curves (he called it a functional determinant), and the matrix now carries his name. Serret’s calculus textbook of 1886 gave a criterion for maxima and minima in terms of the terms of order two, three and four. Peano’s example (2x2−y)(y−x2), which he presented in 1899 in the German translation of Genocchi’s calculus textbook, defeats it: along every line through the origin the function has a strict maximum, and yet it takes positive values arbitrarily close to the origin, so the origin is a saddle. The one-variable habit of checking each direction fails because the positive region lies between two parabolas, which every straight line through the origin misses near the origin.
Definitions
Definition T
Hessian matrix
For a scalar field f with second partials at a, the Hessian matrix is Hf(a)=[Dijf(a)]i,j=1n, where Dijf=DjDif means “differentiate in xi first, then in xj” (this is entry (i,j) of the Jacobian of ∇f, as in 5.5). Apostol (9.10) and Lecture 24 write Dijf=Di(Djf), which puts the same numbers in the transposed position; for a C2 field the two matrices are equal, so nothing below depends on the choice. In two variables
Hf(a)=[fxx(a)fyx(a)fxy(a)fyy(a)].
It is the Jacobian matrix of the gradient field ∇f (5.5). If f is C2 it is symmetric, by Schwarz’s theorem (5.5), so its eigenvalues are real and it has an orthonormal basis of eigenvectors (3.1). Also written ∇2f(a).
In one lineThe n×n matrix Hf(a) whose (i,j) entry is the second partial derivative DjDif(a) of a scalar field f at a.
Why it existsIt is the derivative of the gradient: it describes how the slope changes as you move, and its quadratic form is the second-order term of Taylor's formula.
Definition T
Critical point
A point a in the interior of the domain of a differentiable scalar field f is a critical point (stationary point) if ∇f(a)=O, that is, all partial derivatives of f vanish at a. The tangent plane of the graph there is horizontal.
In one lineA point a where a differentiable scalar field has ∇f(a)=O; Apostol calls it a stationary point.
Why it existsIt is the list of candidates for maxima and minima: by 5.2 an interior extremum of a differentiable field must be a critical point.
Definition T
Local maximum
A scalar field f has a local maximum at a if there is a ball B(a,r) in its domain with f(x)≤f(a) for all x∈B(a,r). It is a strict local maximum if f(x)<f(a) for all x=a in the ball.
In one lineA point a such that f(x)≤f(a) for all x in some ball around a (a relative maximum in Apostol).
Why it existsIt is the 'top of a hill' in the neighbourhood sense: nothing nearby is higher, though something far away might be.
Definition T
Local minimum
f has a local minimum at a if f(x)≥f(a) for all x in some ball B(a,r), and a strict local minimum if f(x)>f(a) for x=a there. A local maximum or minimum is a local extremum.
In one lineA point a such that f(x)≥f(a) for all x in some ball around a (a relative minimum in Apostol).
Why it existsIt is the 'bottom of a valley' in the neighbourhood sense, and the mirror image of a local maximum: a is a local minimum of f exactly when it is a local maximum of −f.
Definition T
Saddle point
A critical point a of a differentiable scalar field is a saddle point if every ball B(a,r) contains points x with f(x)>f(a) and points x with f(x)<f(a) (Lecture 24, Apostol 9.9).
In one lineA critical point a such that every ball around a contains points where f is larger than f(a) and points where it is smaller.
Why it existsIt names the critical points that are neither a top nor a bottom, such as a mountain pass, which is a minimum along the path through it and a maximum across.
Definition T
Absolute maximum
f:S→R has an absolute maximum at a∈S if f(x)≤f(a) for all x∈S; the number f(a) is the absolute maximum value. An absolute maximum is a local maximum when a is interior to S. Absolute extrema may sit on the boundary of S, where there is no ball inside S and the gradient need not vanish.
In one lineA point a of the domain S with f(x)≤f(a) for every x∈S (a global maximum).
Why it existsIt is the answer to the question 'where is f largest on this whole set?', which is what an optimisation problem asks.
Definition T
Absolute minimum
f has an absolute minimum at a∈S if f(x)≥f(a) for all x∈S.
In one lineA point a of the domain S with f(x)≥f(a) for every x∈S (a global minimum).
Why it existsIt is the mirror image of the absolute maximum, and the target of least squares and of training a model.
Worked example Apostol 9.9, Examples 1 to 6
Find and classify the critical points of x2+y2, −x2−y2, xy, x3−3xy2 and x2y2 at the origin, using only the definitions.
Solution.
x2+y2. Gradient (2x,2y)=O at the origin, and f(x,y)≥0=f(0,0) for all (x,y): a strict local (indeed absolute) minimum. A sum of squares.
−x2−y2. Same critical point, f≤0: a strict absolute maximum. The negative of the first.
xy. Gradient (y,x)=O at the origin. In the first and third quadrants xy>0, in the second and fourth xy<0, so every ball has both signs: a saddle. The definition of saddle point, checked directly.
x3−3xy2. Gradient (3x2−3y2,−6xy)=O at the origin. Along the x-axis f=x3 takes both signs. A saddle (the ‘monkey saddle’: three hills and three valleys, a place for a monkey’s tail). A cubic changes sign through zero.
x2y2. Gradient (2xy2,2x2y)=O at the origin, and f≥0=f(0,0) everywhere: a local (absolute) minimum, not strict, since f=0 on both axes. A product of squares is never negative.
Answer. Minimum, maximum, saddle, saddle, minimum (not strict). The last two have all second derivatives equal to 0 at the origin, a warning for the test below.
Taylor’s formula in several variables
Theorem TApostol Thm 9.4; Spagnolie Lecture 24
Second-order Taylor formula for scalar fields
Let f be of class C2 on the ball B(a,r). For every v with ∥v∥<r there is c∈(0,1) with
f(a+v)=f(a)+∇f(a)⋅v+21vTHf(a+cv)v.
Moreover f(a+v)=f(a)+∇f(a)⋅v+21vTHf(a)v+∥v∥2E2(a,v), where E2(a,v)→0 as v→O.
In one lineIf f is C2 on a ball B(a,r) and ∥v∥<r, then f(a+v)=f(a)+∇f(a)⋅v+21vTHf(a+cv)v for some c∈(0,1), and also f(a+v)=f(a)+∇f(a)⋅v+21vTHf(a)v+∥v∥2E2(a,v) with E2(a,v)→0 as v→O.
Why it is trueIt is the one-variable Taylor formula of 1.4 along each line through a, assembled into a single statement; it tells you the quadratic form that governs the shape of f near a.
ProofApostol 9.10
The idea: Restrict f to the line through a with direction v: a function g of one variable. Apply the one-variable Taylor theorem with Lagrange remainder to g, and compute g′ and g″ by the chain rule of 5.4. Then replace the Hessian at the intermediate point by the Hessian at a, paying an error that goes to zero by continuity of the second partials.
Fix v and put g(u)=f(a+uv).
B(a,r) is a ball, so the segment from a to a+v lies in it; g is defined on an open interval containing [0,1].
g′(u)=∇f(a+uv)⋅v and g′′(u)=vTHf(a+uv)v.
Chain rule along the path r(u)=a+uv, with r′=v and r′′=O (5.4: g′′=r′THr′+∇f⋅r′′).
g(1)=g(0)+g′(0)+21g′′(c) for some c∈(0,1).
Taylor's theorem with the Lagrange remainder (1.4) for g with n=1 on [0,1].
f(a+v)=f(a)+∇f(a)⋅v+21vTHf(a+cv)v.
Substitute g(1)=f(a+v), g(0)=f(a) and the formulas of step 2. This is the first claim.
So it remains to show E2→0.
Define E2 by ∥v∥2E2=21vT[Hf(a+cv)−Hf(a)]v for v=O, E2(a,O)=0. Then the second formula holds by construction.The only work left is to show E₂ → 0. The number c depends on v, but the point a + cv is always within ‖v‖ of a, which is all we need.
∣E2(a,v)∣≤21∑i,jDijf(a+cv)−Dijf(a)→0. ■
∣vivj∣≤∥v∥2 (each coordinate is at most the length). Each Dijf is continuous at a, and a+cv→a as v→O.
Proof workshopGive the reason for each line of the second-order Taylor proofApostol 9.10
Each line of the proof is shown in order. Choose the reason that justifies it, then press Check.
Fix v and set g(u)=f(a+uv), a function of one variable.
g′(u)=∇f(a+uv)⋅v and g′′(u)=vTHf(a+uv)v.
g(1)=g(0)+g′(0)+21g′′(c) for some c∈(0,1).
Hence f(a+v)=f(a)+∇f(a)⋅v+21vTHf(a+cv)v.
∥v∥2∣E2∣≤21∑i,j∣Dijf(a+cv)−Dijf(a)∣∣vivj∣, which is at most ∥v∥2 times a sum that tends to 0.
Worked example Practice Final 2013, problem 2
Practice Final 2013, problem 2. f:R2→R is smooth with f(1,2)=1, fx(1,2)=2, fy(1,2)=−1. (a) Estimate f(34,35). (b) Given also fxx(1,2)=3, fxy(1,2)=−1, fyy(1,2)=−2, improve the estimate.
Solution.
The step.a=(1,2), a+v=(34,35), so v=(31,−31). Subtract.
(a) Linear estimate.f(a+v)≈f(a)+∇f(a)⋅v=1+2⋅31+(−1)⋅(−31)=1+32+31=2. The linearization of 5.3.
(b) The quadratic form.H=[3−1−1−2] and vTHv=3⋅91+2(−1)⋅31⋅(−31)+(−2)⋅91=93+92−92=31. vTHv=fxxv12+2fxyv1v2+fyyv22.
Add half of it.f(a+v)≈2+21⋅31=613. The second-order Taylor formula.
Answer. (a) 2, (b) 613≈2.1667.
Your answerPractice Final 2013, problem 2(b): what is the second-order estimate of f(34,35)? (Give a decimal or fraction.)
First find v=(1/3,−1/3), then vTHv=fxxv12+2fxyv1v2+fyyv22.
The step is v=(31,−31). The linear part is f(a)+∇f⋅v=1+32+31=2. The quadratic form is vTHv=3⋅91+2(−1)⋅31⋅(−31)+(−2)⋅91=31, half of it is 61, so the total is 2+61=613.
Worked example MATH 375 Final Review, 9.10
Final Review. Give the quadratic approximation of F(x,y,z)=zsin(xy) about a=(π/2,1,1).
Solution.
Value and gradient.F(a)=sin2π=1. ∇F=(yzcosxy,xzcosxy,sinxy), which at a is (0,0,1). cos2π=0.
Hessian at a.H=−y2zsinxy⋅⋅zcosxy−xyzsinxy−x2zsinxy⋅ycosxyxcosxy0 (symmetric), which at a is −1−π/20−π/2−π2/40000. At a: sinxy=1, cosxy=0, so zcosxy−xyzsinxy=−π/2.
Assemble. With p=x−2π, q=y−1: F≈1+(z−1)+21(−p2−πpq−4π2q2)=z−21(p+2πq)2. The bracket is the perfect square (p+2πq)2, so the Hessian has rank 1: its eigenvalues are 0, 0 and −(1+π2/4).
Check numerically. At a+(0.1,−0.05,0.08) the true value is 1.07985; the linear approximation gives 1.08 and the quadratic one 1.07977. The quadratic is closer, as the extra term is the next order.
Answer.F(x,y,z)≈z−21(x−2π+2π(y−1))2.
Your answerUse the second-order Taylor polynomial of f(x,y)=excosy at the origin to estimate f(0.1,0.2). (Give a decimal.)
Compute fx,fy,fxx,fxy,fyy at the origin.
f(0,0)=1, ∇f(0,0)=(1,0), and the Hessian is [100−1], so f≈1+x+21(x2−y2)=1+0.1+21(0.01−0.04)=1.085. The true value is 1.0832.
Worked example Lecture 24
Lecture 24. Find the quadratic approximation of F(x)=ln(1+∥x∥2) near x=O in R2.
Solution.
Value and gradient at O.F(O)=0 and ∇F=1+∥x∥22x, which is O at O. The origin is a critical point.
Hessian.Fxx=(1+x2+y2)22(1+x2+y2)−4x2, which is 2 at O, likewise Fyy(O)=2, and Fxy=(⋯)2−4xy is 0 at O. So H(O)=[2002]. Quotient rule.
Quadratic approximation.F(x)≈0+0+21(2x2+2y2)=x2+y2=∥x∥2. This is ln(1+u)≈u with u=∥x∥2 from 1.4.
Answer.F(x)≈∥x∥2. The eigenvalues 2,2 are positive: the origin is a strict minimum, as ln(1+u)≥0 shows.
Beyond the course: for understanding· Higher orders, and the Taylor series in the lecture
If f is Ck the same proof (one variable along the line, then the chain rule k times) gives g(k)(u)=∑i1,…,ikDi1⋯Dikf(a+uv)vi1⋯vik, so
By 5.5 the partials may be grouped: the term 3!1∑DiDjDkFvivjvk in two variables is 3!1{Fxxxx3+3Fxxyx2y+3Fxyyxy2+Fyyyy3}, where the 3 counts the three orderings Fxxy,Fxyx,Fyxx (Lecture 24). In the ‘Taylor series’ version of the lecture one assumes F=∑cijk(x−a1)i(y−a2)j(z−a3)k and differentiates term by term: cijk=i!j!k!∂xi∂yj∂zkF(a), for example c122=Fxyyzz(a)/(1!2!2!). Whether the series converges to F is a separate question (it fails for e−1/x2, whose Taylor series at 0 is identically 0); that is for analysis and complex analysis.
Quick checkTrue or false (a question of the Fall 2025 final): if the level sets of a scalar field f are not smooth curves, then f is not differentiable everywhere.
The gradient is perpendicular to the level set only where ∇f=O, and the level set is a smooth curve only under that same condition (the implicit function theorem, which comes later). For f=g(x)g(y) the gradient at the origin is O, so nothing forces the zero level set to be smooth there, even though f has derivatives of every order. Differentiability of f and smoothness of its level sets are different things.
Quadratic forms and eigenvalues
The last tool is a bound on a quadratic form by the eigenvalues, a version of the fact in 3.2.
Lemma AApostol 9.5; the Rayleigh bounds
A quadratic form is squeezed by the extreme eigenvalues
Let A be a real symmetric n×n matrix with eigenvalues λ1,…,λn. Then for every v∈Rn, miniλi∥v∥2≤vTAv≤maxiλi∥v∥2.
In one lineIf A is a real symmetric matrix with eigenvalues λmin≤⋯≤λmax, then λmin∥v∥2≤vTAv≤λmax∥v∥2 for every v, with equality at the corresponding eigenvectors.
Why it is trueIt converts the sign of the eigenvalues into a quantitative lower bound, λmin∥v∥2, that beats any error of smaller order than ∥v∥2.
ProofApostol 9.5 via 3.1 and 3.2
The idea: Rotate to the eigenvector basis, where the form is a weighted sum of squares of the new coordinates with weights the eigenvalues, and compare each weight with the smallest or largest one.
Put w=QTv. Then vTAv=wTΛw=∑iλiwi2.
Spectral theorem (3.1): A=QΛQT with Q orthogonal and Λ=diag(λi).
Each wi2≥0 and λmin≤λi≤λmax, so λminwi2≤λiwi2≤λmaxwi2. Sum over i. Equality when w is a multiple of the corresponding unit vector. ■
The second-derivative test
Theorem TApostol Thm 9.6; Spagnolie Lecture 24
The second-derivative test
Let f be of class C2 on a ball around a with ∇f(a)=O, and let H=Hf(a), a real symmetric matrix with real eigenvalues λ1,…,λn.
(a) If all λi>0, then a is a strict local minimum.
(b) If all λi<0, then a is a strict local maximum.
(c) If H has a positive eigenvalue and a negative one, then a is a saddle point.
(d) If all λi≥0 with some λi=0, or all λi≤0 with some λi=0, the test decides nothing: with eigenvalues ≥0 the point can be a minimum or a saddle (it cannot be a maximum unless H=O), and with eigenvalues ≤0 a maximum or a saddle (a minimum only if H=O). If H=O, all three types occur.
In one lineLet f be C2 near a critical point a and H=Hf(a) with eigenvalues λ1,…,λn. All λi>0: strict local minimum. All λi<0: strict local maximum. Some λi>0 and some λj<0: saddle point. Otherwise (all ≥0 or all ≤0, with a zero) the test is inconclusive.
Why it is trueIt reduces the classification of a critical point to the signs of n real numbers, which the spectral theorem makes available because H is symmetric; the zero case is where the second-order information runs out.
ProofApostol 9.11; here the proof of (c) uses eigenvectors directly
The idea: At a critical point Taylor's formula says f(a + v) − f(a) is half the quadratic form plus an error of smaller order than ‖v‖². The quadratic form is at least λ_min‖v‖² when the eigenvalues are positive, which beats the error. For a saddle, walk along an eigenvector of each sign. For (d), give examples.
f(a+v)−f(a)=21vTHv+∥v∥2E2(a,v), with E2→0.
Second-order Taylor formula with ∇f(a)=O.
(a) 21vTHv≥21λmin∥v∥2.
Lemma above, with all λi>0 so that λmin>0.This is where positive eigenvalues, as opposed to 'nonnegative', are used: lambda_min must be a positive number to dominate the error.
For such v: f(a+v)−f(a)≥(21λmin−41λmin)∥v∥2>0. This proves (a).
Since E2→0, there is ρ>0 with ∣E2(a,v)∣<41λmin for 0<∥v∥<ρ.
(b) follows.
Apply (a) to −f, whose Hessian is −H with eigenvalues −λi>0.
(c) f(a+tu+)−f(a)=t2(21λ++E2(a,tu+)), which is positive for small t=0, since E2→0.
Let u+ be a unit eigenvector for an eigenvalue λ+>0 and u− one for λ−<0; then uTHu=λ for u=u±. Take v=tu+ in step 1.
f(a+tu−)−f(a)=t2(21λ−+E2(a,tu−))<0 for small t=0. So every ball around a has points above and below f(a): a saddle.
Same computation with λ−.
(d) x2+y4 and x2−y4 both have Hessian diag(2,0) at the origin; the first has a strict minimum and the second a saddle. Likewise x4+y4 (minimum) and −x4−y4 (maximum) both have the zero Hessian.
A single Hessian cannot decide between types, so no rule based on the Hessian alone can. ■
Proof workshopRebuild the proof that positive eigenvalues give a minimumApostol 9.11
Tap the lines in the order a proof would write them. Each line can only use what is already above it.
The second-order Taylor formula, with the gradient term equal to zero.
Rotate to the eigenvector basis, where the form is a sum of eigenvalues times squared coordinates.
The Taylor formula tells you which quadratic form you are bounding, so it comes first.
The error term tends to zero as v does, and lambda min is a fixed positive number.
You need to know what size of error you want to beat: that is the bound on the quadratic form.
Combine the bound on the quadratic form with the bound on the error: half of lambda min, minus a quarter of lambda min.
This needs both bounds: the one on the form and the one on the error.
This is the definition of a strict local minimum.
It is the conclusion; it needs the inequality for every small v.
Corollary AApostol 9.13 #24 and the proof of Thm 9.6(c)
A local minimum needs a positive semidefinite Hessian
If a is a critical point of a C2 field and Hf(a) has a negative eigenvalue, then a is not a local minimum. If it has a positive eigenvalue, then a is not a local maximum. Consequently, if two diagonal entries of Hf(a) have opposite signs, then a is a saddle point.
In one lineIf a C2 field has a local minimum at a critical point a, then every eigenvalue of Hf(a) is at least 0; if it has a local maximum, every eigenvalue is at most 0.
Why it is trueIt gives a necessary condition, the second-order analogue of 'the gradient is zero', and it explains why a negative eigenvalue rules out a minimum.
ProofApostol 9.13 #24
The idea: Walk along an eigenvector of a negative eigenvalue; the formula of the test shows f dips below f(a) there. For the diagonal entries, e_i^T H e_i is the entry H_ii, a value of the quadratic form.
If λ<0, there are points arbitrarily close to a with f<f(a), so a is not a local minimum.
Step (c) of the proof of the test: for a unit eigenvector u with eigenvalue λ<0, f(a+tu)−f(a)=t2(21λ+E2(a,tu))<0 for small t=0.
Likewise a positive eigenvalue rules out a local maximum.
Mirror image, with a positive eigenvalue.
If Hii>0>Hjj the eigenvalues have both signs, so by (c) of the test a is a saddle. ■
eiTHei=Hii, and by the Lemma λmin≤Hii≤λmax. So Hii>0 forces λmax>0 and Hjj<0 forces λmin<0.
Worked example Practice Final 2013, problem 8 (the 'be sure to show' part)
Practice Final 2013, problem 8. Show that I(a,b)=∫01(ax+b−x2)2dx is minimised at the critical point (1,−61).
Solution.
Second partials. From Ia=2∫01x(ax+b−x2)dx and Ib=2∫01(ax+b−x2)dx (found in 5.2): Iaa=2∫01x2dx=32, Iab=Iba=2∫01xdx=1, Ibb=2∫01dx=2. Differentiate under the integral; the integrand is a polynomial in a,b.
The Hessian is the same at every point.H=[32112]. I is a quadratic function of (a,b).
Its eigenvalues. Trace 38, determinant 34−1=31. Both are positive, so both eigenvalues are positive. The product λ1λ2=det>0 means the same sign, and the sum λ1+λ2=tr>0 means positive.
Conclude. By the test, (1,−61) is a strict local minimum. It is the absolute minimum too: I is a quadratic polynomial in (a,b), so its second-order Taylor formula has no error term, I(p+v)=I(p)+21vTHv at the critical point p, and vTHv>0 for every v=O. Alternatively the geometry of 2.9: the minimum is the projection of x2 onto span{1,x}.
Answer.H is positive definite, so (a,b)=(1,−61) is a minimum, with I(1,−61)=1801.
Worked example Apostol 9.13 #5
Classify the critical points of f(x,y)=x3−3xy+y3, and of Apostol 9.13 #5, f(x,y)=2x2−xy−3y2−3x+7y.
Solution.
First function: critical points.fx=3x2−3y=0 and fy=3y2−3x=0 give y=x2 and x=y2, so x=x4: x=0 or x=1. The points are (0,0) and (1,1). Substitute y=x2 into the second equation.
Hessian.H=[6x−3−36y]. At (0,0): [0−3−30] with eigenvalues ±3: a saddle. At (1,1): [6−3−36] with eigenvalues 9 and 3: a strict local minimum, f(1,1)=−1. Eigenvalues of [pqqp] are p±q.
Second function.fx=4x−y−3=0, fy=−x−6y+7=0 give y=4x−3 and −x−24x+18+7=0, so x=1, y=1. H=[4−1−1−6] has determinant −25<0, so its eigenvalues −1±26 have opposite signs: a saddle, with f(1,1)=2. A negative determinant means eigenvalues of opposite signs.
Answer.x3−3xy+y3: saddle at (0,0), minimum at (1,1). The quadratic: a single saddle at (1,1) (a quadratic function of this kind has only one critical point when detH=0).
Your answerFor f(x,y)=x3−3xy+y3 at the critical point (1,1), what is the larger eigenvalue of the Hessian?
For a matrix with equal diagonal entries p and off-diagonal entry q the eigenvalues are p±q.
H(1,1)=[6−3−36] has eigenvalues 6−(−3)=9 (eigenvector (1,−1)) and 6+(−3)=3 (eigenvector (1,1)).
Worked example Apostol 9.13 #25
Apostol 9.13 #25. Show that f(x,y,z)=x4+y4+z4−4xyz has a critical point at (1,1,1) and classify it by the eigenvalues of the Hessian.
Solution.
Gradient.∇f=(4x3−4yz,4y3−4xz,4z3−4xy), which at (1,1,1) is (0,0,0). 4−4=0 in each entry.
Hessian.H=12x2−4z−4y−4z12y2−4x−4y−4x12z2, which at (1,1,1) is 12−4−4−412−4−4−412=16I−4J, where J is the matrix of all ones. Diagonal 12=16−4 and off-diagonal −4.
Eigenvalues.J(1,1,1)T=3(1,1,1)T, so H(1,1,1)T=(16−12)(1,1,1)T: eigenvalue 4. For v with v1+v2+v3=0, Jv=O and Hv=16v: eigenvalue 16 with multiplicity 2. The eigenvectors of J: the all-ones vector and the plane perpendicular to it.
Conclude. All three eigenvalues 4,16,16 are positive: a strict local minimum, with f(1,1,1)=−1.
Answer. Strict local minimum (value −1). The other critical points (−1,−1,1), (−1,1,−1), (1,−1,−1) are minima too (by the symmetry (x,y,z)↦ two sign changes), and (0,0,0) has H=0: the test says nothing there.
Worked example Lecture 24
Lecture 24. Classify the critical point of f(x,y)=x2−2xy+2y and describe its Hessian.
Solution.
Critical point.∇f=(2x−2y,−2x+2)=O gives x=1, y=1, with f(1,1)=1. The second equation gives x=1, then the first gives y=x.
Hessian.H=[2−2−20], with characteristic polynomial λ2−2λ−4 and eigenvalues 1±5, one positive (3.24) and one negative (−1.24). Trace 2, determinant −4.
Answer. A saddle point. The surface rises along the eigenvector for 1+5 and falls along the one for 1−5. The next sections show why this saddle is not the answer to the question of where f is largest or smallest on a rectangle.
Quick checkAt a critical point the Hessian has eigenvalues 5 and 0. What does the second-derivative test conclude?
A zero eigenvalue means the quadratic term vanishes in that direction, and then the cubic and quartic terms decide. x2+y4 has a minimum at the origin and x2−y4 a saddle, both with Hessian diag(2,0).
Quick checkWhich result of this section lets you say that a point is a saddle even if one eigenvalue of the Hessian is 0?
Part (c) only asks for one eigenvalue of each sign. The remaining eigenvalues, even 0, do not matter, because the proof walks along the two eigenvectors. For example x2−y2+z3 has eigenvalues 2,−2,0 and is a saddle.
The 2 by 2 test
Theorem TApostol Thm 9.7
The second-derivative test for two variables
Let f be C2 with ∇f(a)=O, A=fxx(a), B=fxy(a), C=fyy(a), and D=AC−B2=detHf(a). (a) D<0: a is a saddle. (b) D>0 and A>0: a strict local minimum. (c) D>0 and A<0: a strict local maximum. (d) D=0: the test is inconclusive.
In one lineLet a be a critical point of a C2 field f(x,y) and D=fxxfyy−fxy2 at a. If D<0: saddle. If D>0 and fxx>0: strict local minimum. If D>0 and fxx<0: strict local maximum. If D=0: inconclusive.
Why it is trueIt is the 375 version of the eigenvalue test for 2×2 Hessians, needing no eigenvalues: only a determinant and one second derivative, since the determinant is the product of the eigenvalues and the trace is their sum.
ProofApostol 9.12
The idea: The determinant is the product of the eigenvalues and the trace is their sum ([2.8](/vol2/2-8-eigenvalues/)). The sign of the product says whether the eigenvalues have the same sign, and the sign of the trace (or of A) says which sign.
The eigenvalues satisfy λ1λ2=D and λ1+λ2=A+C.
Trace and determinant from the eigenvalues, 2.8: λ1λ2=detH=D and λ1+λ2=A+C.
(a) If D<0, the eigenvalues have opposite signs: a saddle.
A negative product means one factor is positive and one negative. Part (c) of the eigenvalue test.
(b), (c) If D>0, the eigenvalues have the same sign, equal to the sign of A. By (a) and (b) of the eigenvalue test, a minimum if A>0 and a maximum if A<0.
A positive product means the same sign. Also AC=D+B2>0, so A and C have the same sign, and the sign of A+C is that sign. It is also the sign of λ1+λ2, hence of both eigenvalues.
(d) If D=0, an eigenvalue is 0 and anything can happen.
D=0 means an eigenvalue is 0; the examples at the start of this section (Apostol's Examples 4 and 5: x3−3xy2 a saddle, x2y2 a minimum) have D=0 at the origin and different types. ■
Worked example
For which k does f(x,y)=x2+kxy+4y2 have a strict minimum at the origin? A saddle?
Solution.
The Hessian.H=[2kk8] at the (only) critical point O. fxx=2, fxy=k, fyy=8.
The determinant.D=16−k2. AC−B2.
Cases.D>0 and A=2>0 for ∣k∣<4: strict minimum. D<0 for ∣k∣>4: saddle. ∣k∣=4: D=0. There f=(x±2y)2, a minimum that is not strict (it vanishes on the line x=∓2y), which the test cannot see.
Answer. Minimum for ∣k∣<4, saddle for ∣k∣>4, and a degenerate (non-strict) minimum at ∣k∣=4. The same answer comes from 3.2: [1k/2k/24] is positive definite exactly for ∣k∣<4.
Your answerThe origin is a strict minimum of x2+kxy+4y2 exactly when ∣k∣ is less than what number?
D=fxxfyy−fxy2=2⋅8−k2=16−k2>0 exactly for ∣k∣<4.
When the test says nothing
Pick the functions with a zero Hessian eigenvalue. The Hessian is the same for x2+y4 and x2−y4 and x2+y3, yet the surfaces are a valley, a saddle and a saddle; the quadratic term misses all of that because it is zero in the y direction, so the quartic or cubic term decides. The table below lists the standard cases, all with a critical point at the origin.
f
Hessian at O
eigenvalues
truth
x2+y2
diag(2,2)
2,2
strict minimum (test works)
x2−y2
diag(2,−2)
2,−2
saddle (test works)
x2+y4
diag(2,0)
2,0
strict minimum
x2−y4
diag(2,0)
2,0
saddle
x2+y3
diag(2,0)
2,0
saddle
x4+y4
0
0,0
strict minimum
−x4−y4
0
0,0
strict maximum
x2y2
0
0,0
minimum, not strict
x3−3xy2
0
0,0
saddle (monkey saddle)
Worked example compare Apostol 9.9 Examples 4 and 5
Settle the type of the critical point at the origin for f=x2+y3 and g=x2−y4 when the Hessian test fails.
Solution.
Both have Hessian diag(2,0) at the origin. The test is inconclusive. One eigenvalue is 0.
Restrict to the flat direction. On the y-axis f(0,y)=y3, which is negative for y<0 and positive for y>0. On the x-axis f=x2>0. So every ball has points above and below f(0,0)=0: a saddle. The definition of saddle point, checked on two lines.
Second function. On the y-axis g(0,y)=−y4<0 and on the x-axis g(x,0)=x2>0: a saddle. Same method.
Contrast.x2+y4 has f≥0 everywhere and f=0 only at O: a strict minimum. No sign change anywhere.
Answer. Saddle for x2+y3 and for x2−y4. The method: find the direction of the null eigenvector and look at the next-order term of f along it.
Worked example Apostol 9.13 #16
Apostol 9.13 #16. Show that f(x,y)=3x4−4x2y+y2 has a minimum at the origin on every line through the origin, but no local minimum in the plane.
Solution.
Factor.f=(x2−y)(3x2−y). Roots of y2−4x2y+3x4=0 in y are x2 and 3x2.
Along y=mx with m=0.f=m2x2−4mx3+3x4=x2(m2−4mx+3x2), which is positive for small x=0 since m2>0. The leading term m2x2 dominates for small x.
Along the axes.f(x,0)=3x4>0 and f(0,y)=y2>0 for nonzero values. The two lines that the formula y=mx misses or specialises.
Along the parabola y=2x2.f=(x2−2x2)(3x2−2x2)=−x4<0 for x=0. Between the parabolas y=x2 and y=3x2 the product is negative.
Conclude. Every ball contains points of the parabola y=2x2 near O, where f<0=f(O). So O is not a local minimum; as there are also points with f>0, it is a saddle.
Answer. Minimum along every line, saddle in the plane. The Hessian at O is diag(0,2), so the test is inconclusive, and checking line by line is not a valid substitute: the curves along which f is negative are parabolas, tangent to the x-axis, which lines cannot detect. This is the shape of Peano’s surface of the history box.
Absolute extrema on a closed bounded set
The test above classifies interior critical points. The question “where is f largest on this set?” is different. If the set is closed and bounded (compact, 4.3) and f is continuous, the extreme value theorem (4.3) says a maximum and a minimum exist. By 5.2 they are critical points if they are interior. They may also lie on the boundary, where there is no ball inside the set and nothing forces ∇f=O. Lecture 24: “check the boundaries separately.”
Why· The method
To find the absolute maximum and minimum of a differentiable f on a compact set S: (1) find the critical points in the interior of S and record f there; (2) split the boundary into smooth pieces, restrict f to each piece (a function of one variable, say by parametrising), find its critical points, and include the endpoints and corners; (3) compare all the values. The largest is the absolute maximum, the smallest the absolute minimum. The classification of step 1 is not needed to decide the answer; it only explains the picture. If the set is not compact, the maximum may not exist, and the same list of candidates tells you only where it could be.
Worked example Lecture 24; Apostol 9.9
Lecture 24. Find the absolute maximum and minimum of f(x,y)=x2−2xy+2y on the rectangle S=[0,3]×[0,2].
Solution.
Interior critical points.∇f=(2x−2y,−2x+2)=O at (1,1), which lies inside S, with f(1,1)=1. It is a saddle, so it is neither the maximum nor the minimum of the rectangle. Eigenvalues 1±5 (previous section).
Bottom edge y=0.f(x,0)=x2 on [0,3]: values from 0 at (0,0) to 9 at (3,0). An increasing function: extremes at the ends.
Right edge x=3.f(3,y)=9−4y on [0,2]: from 9 at (3,0) down to 1 at (3,2). A line: extremes at the ends.
Top edge y=2.f(x,2)=x2−4x+4=(x−2)2 on [0,3]: critical point x=2 with value 0 at (2,2); ends f(0,2)=4, f(3,2)=1. The one-variable test of 1.4 on the edge, plus its endpoints (the corners).
Left edge x=0.f(0,y)=2y: from 0 to 4. A line.
Compare. Candidate values: 1 (saddle), 0 at (0,0), 9 at (3,0), 1 at (3,2), 0 at (2,2), 4 at (0,2).
Answer. Absolute maximum 9 at (3,0); absolute minimum 0, attained at two points, (0,0) and (2,2) (the notes name only the first; f(2,2)=4−8+4=0). The interior saddle is irrelevant to both.
Your answerWhat is the absolute maximum of f(x,y)=x2−2xy+2y on the rectangle [0,3]×[0,2]?
Check all four edges, including the corners, and the interior critical point.
The only interior critical point (1,1) has f=1. On the boundary, the bottom edge gives f=x2 up to 9 at (3,0), and no other edge exceeds it (the right edge starts at 9 and falls; the others stay at most 4).
Worked example Apostol 9.13 #18
Apostol 9.13 #18. Find the absolute extreme values of f(x,y)=xy(1−x2−y2) on the unit square [0,1]2.
Solution.
Interior critical points.fx=y(1−3x2−y2)=0 and fy=x(1−x2−3y2)=0; with x,y>0: 3x2+y2=1 and x2+3y2=1, so x2=y2=41, giving (21,21) with f=41⋅21=81. Subtract the two equations to get x2=y2, then substitute.
Classify it (not needed, but instructive).fxx=−6xy=−23, fyy=−23, fxy=1−3x2−3y2=−21. D=49−41=2>0 and fxx<0: a local maximum. The 2 by 2 test.
Edges x=0 and y=0.f=0 identically. The factor xy is 0.
Edge x=1.f(1,y)=y(1−1−y2)=−y3 on [0,1]: from 0 down to −1 at the corner (1,1). Edge y=1: f=−x3, the same. Monotone.
Compare. Values: 81 at (21,21), 0 along two edges, −1 at (1,1).
Answer. Absolute maximum 81 at (21,21); absolute minimum −1 at (1,1). The corner (0,0) is a critical point of the surface (Hessian with eigenvalues ±1: a saddle in the plane), but on the square f=xy(…)≥0 near it, so it is a boundary minimum of the restriction with value 0, not an extremum overall.
Worked example
Find the absolute extreme values of f(x,y)=x2+2y2−x on the closed unit disc x2+y2≤1.
Solution.
Interior.∇f=(2x−1,4y)=O at (21,0), inside the disc, with f=41−21=−41. Hessian diag(2,4): a minimum. Both eigenvalues positive.
Boundary: parametrise.x=cost, y=sint: f=cos2t+2sin2t−cost=2−cos2t−cost. With c=cost∈[−1,1]: φ(c)=2−c2−c. sin2t=1−cos2t.
One-variable problem.φ′(c)=−2c−1=0 at c=−21: φ=2−41+21=49 (a maximum, as φ′′=−2). At the ends: φ(1)=0, φ(−1)=2. Include the endpoints of the interval for c.
Compare.−41 (interior), 49 at c=−21 (the points (−21,±23)), 0 at (1,0), 2 at (−1,0).
Answer. Absolute minimum −41 at (21,0); absolute maximum 49 at (−21,±23), on the boundary, where ∇f=(−2,±23)=O.
Your answerWhat is the absolute maximum of f(x,y)=x2+2y2−x on the closed unit disc? (Give a decimal.)
It occurs on the boundary circle at x=−21, y=±23: f=41+2⋅43+21=49. The interior critical point only gives the minimum −41.
Quick checkf is continuous on a closed disc and has no critical points in the open disc. Where are its maximum and minimum?
The disc is compact, so the extrema exist (4.3). If one were at an interior point it would be a critical point (5.2), but there are none. So both are on the boundary.
Where it is used
Used inside maths· Inside maths: least squares, the centroid, and the next chapters
The least-squares line through points (xi,yi) minimises L(a,b)=∑i(axi+b−yi)2 (Apostol 9.13 #21). Its gradient is zero exactly at the normal equations, and its Hessian is 2[∑xi2∑xi∑xin], with determinant 4(n∑xi2−(∑xi)2)>0 unless all the xi are equal (Cauchy–Schwarz). So the critical point is a minimum, and since L is a quadratic function, the only one and the absolute minimum. For the points (0,1),(1,3),(2,4) the equations are 5a+3b=11 and 3a+3b=8, giving a=23, b=67, with Hessian [10666] of eigenvalues 1.68 and 14.32. In the same way (Apostol 9.13 #23) the point x minimising ∑k∥x−zk∥2 has gradient 2∑(x−zk), so it is the centroid, and the Hessian 2nI is positive definite. Constrained problems (Lagrange multipliers) use the same Hessian, restricted to the constraint surface.
Used in the real world· AI: loss landscapes, saddles, and what Newton's method does at a saddle
For the least-squares loss L(w)=∥Xw−y∥2 the Hessian is 2XTX, positive semidefinite for any data (3.2), so the loss is a bowl (possibly with flat directions) and every critical point is a global minimum. In the line-fit example above, the eigenvalues 1.68 and 14.32 give a condition number ≈8.55, and gradient descent on L converges only for a step size below 2/14.32=0.14, slowly along the direction of the small eigenvalue. Real networks are not convex. The simplest non-convex model has two scalar weights multiplied, L(w1,w2)=(w1w2−1)2, fitting the target 1. Its gradient is 2(w1w2−1)(w2,w1), so (0,0) is a critical point, and its Hessian there is [0−2−20] with eigenvalues ±2: a saddle, with loss 1. The minima form the hyperbola w1w2=1 (loss 0), where the Hessian has eigenvalues 0 (along the valley) and 2(w12+w22). Starting at (0.01,0.02) gradient descent with step 0.1 slides off the saddle along the descending direction and reaches the valley, at about (1,1) with loss ≈0, in about 35 steps. Newton’s method, which solves ∇L=O with the Hessian, jumps from (0.01,0.02) to (−4×10−6,−8×10−6) in one step and stays there: it is attracted to any critical point, including the saddle at loss 1. That is why optimisers for neural networks use first-order methods with noise, or modify the Hessian to be positive definite, and why checking the sign of the Hessian’s eigenvalues, as in the lab below, distinguishes a minimum from a saddle that only looks flat.
Python labClassify critical points from a finite-difference Hessian, then watch gradient descent and Newton's method at a saddle
import numpy as npdef num_hessian(f, x, h=1e-4): n = len(x); E = np.eye(n) * h; H = np.zeros((n, n)) for i in range(n): for j in range(n): H[i, j] = (f(x + E[i] + E[j]) - f(x + E[i] - E[j]) - f(x - E[i] + E[j]) + f(x - E[i] - E[j])) / (4 * h * h) return Hcases = [("x^2 + y^2 at 0", lambda p: p[0]**2 + p[1]**2, [0, 0]), ("x y at 0", lambda p: p[0] * p[1], [0, 0]), ("x^3 - 3xy + y^3 at (1,1)", lambda p: p[0]**3 - 3 * p[0] * p[1] + p[1]**3, [1, 1]), ("x^2 + y^4 at 0", lambda p: p[0]**2 + p[1]**4, [0, 0]), ("x^4 + y^4 at 0", lambda p: p[0]**4 + p[1]**4, [0, 0]), ("x^4+y^4+z^4-4xyz at (1,1,1)", lambda p: p[0]**4 + p[1]**4 + p[2]**4 - 4 * p[0] * p[1] * p[2], [1, 1, 1])]for name, f, x in cases: H = num_hessian(f, np.array(x, float)); ev = np.linalg.eigvalsh((H + H.T) / 2) kind = "minimum" if ev.min() > 1e-3 else "maximum" if ev.max() < -1e-3 else "saddle" if (ev.max() > 1e-3 and ev.min() < -1e-3) else "test fails" print(f"{name:30s} eigenvalues {np.round(ev, 3)} -> {kind}")L = lambda w: (w[0] * w[1] - 1)**2g = lambda w: 2 * (w[0] * w[1] - 1) * np.array([w[1], w[0]])Hs = lambda w: 2 * np.outer([w[1], w[0]], [w[1], w[0]]) + 2 * (w[0] * w[1] - 1) * np.array([[0, 1], [1, 0]])start = np.array([0.01, 0.02])w = start.copy()for _ in range(60): w = w - 0.1 * g(w)print("gradient descent ends at", w.round(4), "loss", round(L(w), 6))w = start.copy()for _ in range(5): w = w - np.linalg.solve(Hs(w), g(w))print("Newton ends at ", w.round(6), "loss", round(L(w), 6))
Try this.Run it. The first block classifies six critical points from numerically computed Hessians and agrees with the hand computations above; for x^2 + y^4 and x^4 + y^4 it prints 'test fails' because an eigenvalue is 0 (to within the finite-difference error). In the second block, gradient descent leaves the saddle of (w1 w2 - 1)^2 and ends in the valley w1 w2 = 1 with loss near 0, while Newton lands on the saddle with loss 1. Change the start to (0.0, 0.0): both methods stay at the saddle, because the gradient there is exactly zero. Change the start to (0.01, -0.02) and see where gradient descent goes (to the other branch of the valley, w1 w2 = 1 with both weights negative).
Traps
Watch out· Critical does not mean extremum
∇f(a)=O is a necessary condition for an interior extremum and nothing more: x2−y2 and x3−3xy2 have critical points that are neither maxima nor minima. The Hessian test or a direct look at the sign of f(x)−f(a) is required.
Watch out· Zero eigenvalue: no conclusion
If the Hessian has an eigenvalue 0 and none of the opposite sign, the test is silent: the types x2+y4 (minimum), x2−y4 (saddle), −x4−y4 (maximum) all have a zero eigenvalue. Look at the next-order terms along the null direction. The Final Review states this case explicitly as ‘indeterminate’.
Watch out· Minimum on every line is not a minimum
For 3x4−4x2y+y2 the origin is a strict minimum along every straight line, and a saddle in the plane. A proof that restricts to lines through the point proves nothing about a neighbourhood. In one variable there is only one line through a point, which is why the habit of checking ‘both sides’ works there.
Watch out· Do not forget the boundary
On a closed bounded set the absolute extrema may be on the boundary with a nonzero gradient. The interior saddle (1,1) in Lecture 24’s example was neither the maximum nor the minimum; the answers were at (3,0), (0,0) and (2,2). Always list the corners, and do not stop at the first minimum found: Lecture 24’s notes name only (0,0) although (2,2) gives the same value.
Watch out· Strict versus non-strict, and local versus absolute
x2y2 has a minimum at the origin that is not strict (it is 0 on both axes). A local minimum is not necessarily the absolute minimum: x3−3x has a local minimum at x=1 and no absolute minimum. A positive definite Hessian proves only a strict local minimum, unless f is known to be convex.
Watch out· The 2 by 2 test needs f_xx as well as the determinant
D>0 says the eigenvalues have the same sign; it does not say which one. Use fxx (or fyy, or the trace) to decide minimum or maximum. Also note D=fxxfyy−fxy2 uses the square of the mixed partial; in the notation of 5.5, it is fxyfyx only when they are equal.
Problems
checkApostol 9.13 #6
Locate and classify the critical points of f(x,y)=x2−xy+y2−2x+y.
Solution
fx=2x−y−2 and fy=−x+2y+1. From the first, y=2x−2; the second gives −x+4x−4+1=0, so x=1, y=0. H=[2−1−12] has D=3>0 and fxx=2>0 (eigenvalues 1,3): a strict local minimum, with f(1,0)=−1. Since H is positive definite and constant, it is the absolute minimum.
check
At a critical point the Hessian is [1221]. What is the type? What if it is [2222]?
Solution
First: D=1−4=−3<0, eigenvalues 3 and −1: a saddle (positive entries do not make the matrix positive definite, 3.2). Second: D=0, eigenvalues 4 and 0: the test is inconclusive.
check
Write the second-order Taylor polynomial of f(x,y)=x2y about (1,1).
Solution
f(1,1)=1, ∇f=(2xy,x2)=(2,1). H=[2y2x2x0]=[2220]. With p=x−1, q=y−1: f≈1+2p+q+21(2p2+4pq)=1+2p+q+p2+2pq. (Exact: f=(1+p)2(1+q)=1+2p+q+p2+2pq+p2q, so the error is exactly the cubic term p2q.)
checkApostol 9.13 #24 (a check)
At a critical point the Hessian is 3101−21015. Is it a minimum, a maximum or a saddle?
Solution
The diagonal entries 3 and −2 have opposite signs, so by the corollary the point is a saddle (a value of the quadratic form at e1 is 3>0 and at e2 is −2<0, so there are eigenvalues of both signs).
useApostol 9.13 #8 style
Find and classify the critical points of f(x,y)=x3+y3−3x−12y+20.
Solution
fx=3x2−3=0 gives x=±1; fy=3y2−12=0 gives y=±2. Four points. H=[6x006y]. At (1,2): diag(6,12), minimum, f=1+8−3−24+20=2. At (−1,−2): diag(−6,−12), maximum, f=−1−8+3+24+20=38. At (1,−2) and (−1,2): eigenvalues of opposite signs, saddles.
useApostol 9.13 #21 (least squares)
Find the line y=ax+b minimising ∑i(axi+b−yi)2 for the points (0,1),(1,3),(2,4) and verify by the Hessian that it is a minimum.
Solution
∂a=2∑xi(axi+b−yi)=0 and ∂b=2∑(axi+b−yi)=0 give 5a+3b=11 and 3a+3b=8. Subtracting, 2a=3, a=23, b=67. H=2[5333]=[10666], D=60−36=24>0, Laa=10>0: a minimum, and since L is quadratic, the absolute minimum. The residuals are 67−1=61, 23+67−3=−31, 3+67−4=61, with sum of squares 361+91+361=61.
useLecture 24 style
Find the absolute maximum and minimum of f(x,y)=x2+y2−2x on the triangle with vertices (0,0), (2,0), (0,2).
Solution
Interior: ∇f=(2x−2,2y)=O at (1,0), which lies on the bottom edge, not in the interior. Edges. Bottom (y=0, 0≤x≤2): f=x2−2x, critical at x=1 with f=−1, ends f(0,0)=0 and f(2,0)=0. Left (x=0, 0≤y≤2): f=y2, from 0 to 4. Hypotenuse (y=2−x, 0≤x≤2): f=x2+(2−x)2−2x=2x2−6x+4, critical at x=23 with f=29−9+4=−21; ends f(0,2)=4 and f(2,0)=0. Candidates: −1 at (1,0), 0, 4 at (0,2), −21. Absolute minimum −1 at (1,0), absolute maximum 4 at (0,2).
use
Show that the Hessian test fails at the origin for f(x,y)=x2−2xy+y2+y3, and decide the type of the critical point.
Solution
f=(x−y)2+y3. ∇f=(2x−2y,−2x+2y+3y2)=O at (0,0). H=[2−2−22] with eigenvalues 4 and 0: inconclusive. On the line x=y: f=y3, taking both signs. So every ball contains points with f>0 and f<0: a saddle.
proveApostol 9.13 #23
Let z1,…,zm be points of Rn and f(x)=∑k=1m∥x−zk∥2. Prove that f has an absolute minimum exactly at the centroid zˉ=m1∑kzk.
Solution
Plan. Gradient and Hessian, then the fact that a positive definite quadratic has a unique critical point which is its absolute minimum.
∇∥x−zk∥2=2(x−zk) (5.2 or 3.8), so ∇f=2∑k(x−zk)=2m(x−zˉ), which is O only at x=zˉ. Hf=2mI, positive definite. By the second-derivative test zˉ is a strict local minimum. For the absolute minimum: f(x)=f(zˉ)+m∥x−zˉ∥2 (expand x−zk=(x−zˉ)+(zˉ−zk); the cross term is 2(x−zˉ)⋅∑k(zˉ−zk)=0). So f(x)≥f(zˉ) with equality only at zˉ. ■
proveApostol 9.13 #24
Let a be a critical point of a C2 field with Hessian H. Prove that if two diagonal entries of H have opposite signs, a is a saddle point.
Solution
Plan. A diagonal entry is a value of the quadratic form, hence squeezed between the extreme eigenvalues; opposite signs force eigenvalues of both signs.
Hii=eiTHei with ∥ei∥=1. By the Lemma (the Rayleigh bounds), λmin≤Hii≤λmax for every i. If Hii>0>Hjj then λmax≥Hii>0 and λmin≤Hjj<0. Part (c) of the second-derivative test gives a saddle. ■ (Alternative without eigenvalues: f(a+tei)−f(a)=21Hiit2+t2E2>0 and f(a+tej)−f(a)=21Hjjt2+t2E2<0 for small t.)
prove
Prove that if f is C2 and its Hessian is positive definite at every point of an open convex set S, then f has at most one critical point in S, and if it has one, it is the absolute minimum of f on S.
Solution
Plan. Restrict to the segment between two points; the restriction is a function of one variable with positive second derivative.
Let p,q∈S be distinct and g(t)=f(p+t(q−p)) for t∈[0,1] (the segment lies in S by convexity). By 5.4, g′′=(q−p)TH(⋅)(q−p)>0, so g′ is strictly increasing. If p is a critical point, g′(0)=∇f(p)⋅(q−p)=0, so g′(t)>0 for t>0 and g(1)>g(0): f(q)>f(p). So a critical point p is an absolute minimum, strictly (every other point has a larger value). If q were also critical, f(p)>f(q) would follow symmetrically, a contradiction. ■
provenew (uses 5.4)
Prove that the type of a nondegenerate critical point does not depend on the coordinates: if Φ is a C2 change of variables with invertible Jacobian, h=f∘Φ, and f has a critical point at b=Φ(a), then a is a critical point of h and Hh(a)=DΦ(a)THf(b)DΦ(a); this matrix has as many positive and negative eigenvalues as Hf(b) (Sylvester’s law of inertia).
Solution
Plan. Use the second-derivative chain rule of 5.4 and note that the term involving ∇f vanishes.
By 5.4, ∇h(a)=DΦ(a)T∇f(b)=O, and Hh(a)=DΦTHfDΦ+∑kDkf(b)HΦk(a); the sum is 0 since ∇f(b)=O. So Hh(a)=PTHf(b)P with P=DΦ(a) invertible. The quadratic forms satisfy wTHhw=(Pw)THf(Pw): they take the same values on corresponding vectors. So the largest subspace on which Hh is positive definite has the same dimension as the one for Hf, and likewise for negative; hence the numbers of positive and negative eigenvalues agree (Sylvester’s law of inertia, which we use without proof). In particular a minimum, maximum or saddle in the b coordinates is one in the a coordinates. ■ (The eigenvalues themselves do change: only their signs are invariant.)
stretchApostol 9.13 #20
Let f(x,y)=Ax2+2Bxy+Cy2+2Dx+2Ey+F with A>0 and B2<AC. Prove that f has an absolute minimum, at the solution (x1,y1) of the linear system Ax+By=−D, Bx+Cy=−E.
Solution
Plan. A quadratic function with positive definite quadratic part: critical point from the gradient equations, then Taylor’s formula is exact.
∇f=2(Ax+By+D,Bx+Cy+E), which vanishes exactly at the solution of the system; the coefficient matrix M=[ABBC] has det=AC−B2>0, so there is exactly one solution. H=2M, with det>0 and A>0: positive definite, so it is positive definite everywhere and, since f equals its second-order Taylor polynomial, f(p+v)=f(p)+∇f(p)⋅v+vTMv exactly. At p=(x1,y1) the middle term is 0 and vTMv>0 for v=O, so f(x1+v)>f(x1,y1) for every v=O: an absolute minimum. ■
stretch
Let f(x,y)=(y−x2)(y−2x2). Show that the origin is a critical point at which f has a strict local minimum along every line through it, give the Hessian, and show that the origin is nevertheless a saddle. Check that −f is the function (2x2−y)(y−x2) of the history box, so that function has a strict maximum along every line and is also a saddle.
Solution
Plan. Expand along lines, then find a curve on which the sign is the opposite.
f=y2−3x2y+2x4, ∇f=(−6xy+8x3,2y−3x2)=O at the origin, and H=[0002] there (eigenvalues 0 and 2): the test is inconclusive. Along y=mx with m=0: f=x2(m2−3mx+2x2)>0 for small x=0. Along the x-axis f=2x4>0 and along the y-axis f=y2>0. So f has a strict local minimum along every line through O. But on the parabola y=23x2: f=(21x2)(−21x2)=−41x4<0, and f>0 on every line, so every ball around O contains points with f<0=f(O) and points with f>0: a saddle. Finally −f=−(y−x2)(y−2x2)=(2x2−y)(y−x2), and negating all the statements turns the strict minima along lines into strict maxima. ■
Summary
Taylor, order two. For f of class C2, f(a+v)=f(a)+∇f(a)⋅v+21vTHf(a)v+∥v∥2E2 with E2→0; the HessianHf=[Dijf] is symmetric (5.5). Proof: restrict to a line, apply the one-variable theorem, and use the chain rule of 5.4 twice.
A critical point has ∇f=O; every interior local maximum or minimum is one (5.2), but a critical point can also be a saddle point (points above and below in every ball).
Second-derivative test. At a critical point of a C2 field, with Hessian eigenvalues λi (real, by the spectral theorem): all positive, strict local minimum; all negative, strict local maximum; both signs, saddle; a zero with no opposite sign, inconclusive. Proof: 21vTHv≥21λmin∥v∥2 beats the error, and eigenvectors detect saddles.
Two variables. With D=fxxfyy−fxy2 (product of eigenvalues): D<0 saddle; D>0 and fxx>0 minimum; D>0 and fxx<0 maximum; D=0 inconclusive.
Degenerate cases need the next-order terms along the null direction (x2+y4 minimum, x2−y4 saddle). A minimum on every line is not a minimum (3x4−4x2y+y2). A local minimum needs a positive semidefinite Hessian.
Absolute extrema on a compact set exist (4.3); compare the interior critical points with the extrema on each boundary piece, including corners. Lecture 24’s rectangle: maximum 9 at (3,0), minimum 0 at both (0,0) and (2,2), the interior saddle irrelevant.
Applications. Least squares has Hessian 2XTX⪰0, so critical points are global minima; for (w1w2−1)2 the origin is a saddle that gradient descent leaves and Newton’s method lands on.
Watch and read
The same ideas explained by someone else. Use these when an explanation here does not land.
MATH 375: Lecture 24 and Apostol 9.9 to 9.13: the second-order Taylor formula with the Hessian, critical points, the eigenvalue test, the boundary check of the rectangle example, and the zero-eigenvalue case from the Final Review. Practice Final problems 2 and 8 and the Final Review's quadratic approximation of z sin(xy) are worked below. No homework was assigned on this section, so every Apostol 9.13 exercise type that is quoted here is new practice.
MATH 521 / 541: 521 proves the same test on a Banach space and gives the necessary second-order condition as an exercise. In 541 and in geometry the statement 'the Hessian at a critical point is a well-defined quadratic form, independent of coordinates' is the first step towards Morse theory, where the number of negative eigenvalues (the index) of the critical points records the topology of the space.
MATH 340 / CS 532: Newton's method solves ∇f = 0 using the Hessian and is attracted to saddle points; gradient descent with a step below 2 over the largest Hessian eigenvalue converges on a convex quadratic at a rate set by the condition number. The least-squares loss ‖Xw − y‖² has Hessian 2XᵀX, positive semidefinite, so every critical point is a global minimum.
Physics and engineering: A mechanical system sits in stable equilibrium at a minimum of its potential energy; the Hessian of the energy is the stiffness matrix whose eigenvalues are the squared natural frequencies (up to the masses).