Unit 6 showed you how to build a polynomial impostor of any smooth function, one derivative at a time. This unit asks the two questions that make the impostor trustworthy: where does the formula come from — proved, from a single flat spot on a hiking trail — and exactly how big is the lie when you cut the series short. Then the story turns to two variables, where the second-order term becomes a matrix, the Hessian, and that matrix becomes the judge that decides whether a flat point is a bowl, a dome, or a saddle — the question every learning algorithm asks at the bottom of its valley.
≈ 90 min read + play9 interactive widgets · 3 in 3D · a judge you can dial17 inline checks🧾 17 proofs, step by step — Rolle, the mean value theorem, Taylor's remainder, the matrix form, the Hessian test✍ 12 solved practice problems
drag the landscape to orbit
1
Every smooth curve is secretly a polynomial — up close
Imagine this
A master forger wants to copy a signature. She cannot see all of it at once, but she can study it closely at one point. First she puts a dot in the right place. Then she draws a short straight stroke at the right angle. Then she bends the stroke to match the curve. Each extra piece of information — position, slope, bend, the change in the bend — makes the copy hug the original for longer. The Taylor polynomial is that forger: it copies a function's value and its first few derivatives at one point, and out comes a polynomial that is almost indistinguishable from the function nearby.
You built that impostor in Unit 6. Anchor at a point a, copy the derivatives, and divide each by k! so the copies do not disturb each other:
Two questions were left open, and they are the whole of this unit. First: why does this work at all? Matching derivatives at one point is a plausible idea, but plausible is not the same as proved — what guarantees that the copy is close to the original one step away from the anchor? Second: how big is the lie? If you cut the series after a few terms, you have made an error. A formula for that error — not an estimate, an exact expression — is the difference between an approximation you hope is good and one you know is good.
Both answers come from the same humble place: a flat spot on a hiking trail. From that flat spot we will climb a ladder of derivatives and arrive at Taylor's theorem with its remainder. Then we take the theorem into two variables, where the second-derivative term turns into a small matrix — and that matrix turns out to be the judge of hills and valleys.
Pause & predict
You approximate 4.2 with the tangent line of x at x=4 and get 2.05. The true value is 2.0494. What should the next term of the polynomial do?
In one sentence: A Taylor polynomial copies a function's derivatives at one point; this unit proves why that works and measures exactly how far the copy can be trusted.
2
The flat spot — Rolle's theorem
The mountain trail
You hike a smooth trail. You start at 1000 m and, hours later, you finish at 1000 m again. Somewhere in between — at the top of a climb, or the bottom of a dip, or on a level stretch — the ground under your feet was perfectly flat. Not approximately. Exactly. You may not know where, but you know it happened, because you cannot go up and come back down without, at some instant, going neither up nor down.
That is Rolle's theorem, and it is the seed from which everything in this unit grows:
Rolle's theorem
If f is continuous on [a,b] (no gaps), differentiable on (a,b) (no sharp corners), and f(a)=f(b) (same height at both ends), then there is at least one c strictly between a and b with
f′(c)=0.
Each hypothesis is a real part of the promise. Drop continuous and the trail can jump over the flat spot. Drop differentiable and the trail can turn around at a sharp corner — a kink like ∣x∣ has a lowest point but no tangent there, so no c with f′(c)=0 exists. The lecture's warning is exactly this: Rolle's theorem is not valid for functions with a kink. Hunt for the flat spot yourself, and then try the trail that breaks the rule:
The flat-spot hunterRolle, the mean value theorem, and the one curve that breaks them — drag the endpoints, then hunt for c
Try: press ▶ hunt for c and watch the tangent slide until it is parallel to the chord. Then open the broken tab: same heights at both ends, and no flat spot anywhere.
—
The chord's slope is the average rate of change over [a,b]; the tangent's slope is the instantaneous rate at one point. The theorem says the two must agree somewhere strictly inside. In the Rolle tab the right end is pinned to the same height as the left, so the chord is level and the promised tangent is flat.
Pause & predict
f(x)=∣x∣ on [−1,1]: continuous, f(−1)=f(1)=1, and it clearly has a lowest point at 0. Why does Rolle's theorem not hand you a c with f′(c)=0?
In one sentence: Same height at both ends plus a smooth trail guarantees a flat spot somewhere strictly in between — and a kink voids the guarantee.
3
Average equals instantaneous — the mean value theorem
The highway trip
You drive 200 km in 2 hours. Your average speed was 100 km/h. At some moment your speedometer must have read exactly 100 km/h — you cannot average 100 by always being faster, nor by always being slower. The mean value theorem is this sentence, written for any smooth function: somewhere in the interval, the instantaneous slope equals the average slope.
Mean value theorem
If f is continuous on [a,b] and differentiable on (a,b), there is a c in (a,b) with
f′(c)=b−af(b)−f(a).
Rolle is the special case where the average slope is zero. The surprise is that the general case is also Rolle — tilted. Subtract the chord from the function and the two ends line up:
Prove it · the mean value theorem, from Rolle
Claim. If f is continuous on [a,b] and differentiable on (a,b), some c∈(a,b) has f′(c)=b−af(b)−f(a).
1
Name the average slope and build the chord — the straight line through the two endpoints:
m=b−af(b)−f(a),ℓ(x)=f(a)+m(x−a)ℓ is a straight line with slope m that passes through (a,f(a)); by the choice of m it also passes through (b,f(b)).
2
Subtract the chord from the function:
g(x)=f(x)−ℓ(x)=f(x)−f(a)−m(x−a)g is "how far f sits above its own chord". It inherits continuity and differentiability from f, because ℓ is as smooth as anything can be.
3
Check the two ends:
g(a)=f(a)−f(a)−0=0,g(b)=f(b)−f(a)−m(b−a)=f(b)−f(a)−(f(b)−f(a))=0The chord meets the curve at both ends, so the gap is zero at both ends. That is exactly Rolle's "same height" hypothesis — for g.
4
Apply Rolle to g: some c∈(a,b) has g′(c)=0. But g′(x)=f′(x)−m, so
0=g′(c)=f′(c)−m⟹f′(c)=m=b−af(b)−f(a).
That is the claim. ∎Tilting the picture by a straight line does not change where tangents are parallel to it. So the general theorem is the flat one in disguise.
Now rearrange the mean value theorem and read it again, slowly:
f(b)=f(a)+f′(c)(b−a)
This says: the value at b equals the value at a, plus a correction — the distance travelled times a slope taken somewhere in between. That is a first-order Taylor expansion with the error built in. The tangent-line estimate would use f′(a); the theorem says that if you are willing to use the slope at a secret point c instead, the estimate becomes exact. Taylor's theorem is what you get when you ask the same question with more derivatives: copy f's slope, bend, and higher derivatives at a, and let one secret c absorb everything you left out.
Pause & predict
f(x)=x3 on [0,2]. The mean value theorem promises a c with f′(c)=2−0f(2)−f(0)=4. Where is it?
In one sentence: Subtract the chord and the mean value theorem is Rolle; rearranged, it is already a first-order Taylor formula with an exact error term.
4
The Rolle ladder — one flat spot per rung
Here is the idea that turns one flat spot into a whole theorem. Suppose a function F is very flat at a — its value and its first n−1 derivatives all vanish there — and suppose it also vanishes at some b>a:
F(a)=F′(a)=F′′(a)=⋯=F(n−1)(a)=0,F(b)=0.
Then F and F′ and F′′… each get a Rolle argument in turn, and the flat spots nest inward like Russian dolls. The lecture calls the conclusion Proposition P: there is a c in (a,b) with F(n)(c)=0. Climb the ladder and watch it happen:
The Rolle ladderF, F′, F″, … each rung inherits two zeros from the rung above and hands one down — climb it
Try: press ▶ climb and watch the zeros nest: a<c3<c2<c1<b. Then move b closer to a and see every ck get squeezed toward a.
—
Here F(x)=f(x)−P(x), where P copies f's value and first n−1 derivatives at a=0, and its last coefficient is chosen so that F(b)=0. Every rung starts with two zeros and Rolle plants one more, one level down — until the bottom rung reports F(n)(cn)=0. That single zero is where the remainder formula comes from.
Prove it · Proposition P — n flat spots, nested
Claim. If F(a)=F′(a)=⋯=F(n−1)(a)=0 and F(b)=0, with Fn-times differentiable on (a,b) and the lower derivatives continuous on [a,b], then some c∈(a,b) has F(n)(c)=0.
1
Rung 1.F(a)=0=F(b): Rolle gives c1∈(a,b) with F′(c1)=0.
Two zeros of F at the ends, one flat spot of F in between. Standard Rolle.
2
Rung 2. Now look at F′. It vanishes at a (given) and at c1 (rung 1). Rolle on [a,c1] gives c2∈(a,c1) with F′′(c2)=0.
The zero handed down from rung 1 plus the zero we were given at a are the two ends Rolle needs. The interval has shrunk: c2<c1.
3
Rung k, in general. Suppose F(k−1)(ck−1)=0 with ck−1∈(a,b), and k−1≤n−1 so that F(k−1)(a)=0 too. Rolle on [a,ck−1] gives
ck∈(a,ck−1)withF(k)(ck)=0.Same move each time: the zero at a is free (it was assumed), the other zero is inherited from the rung above. That is why we needed n−1 vanishing derivatives at a — one for each rung after the first.
4
After n rungs:
a<cn<cn−1<⋯<c1<b,F(n)(cn)=0.
Set c=cn. Done. ∎Each rung uses one Rolle and shrinks the interval toward a. The last rung needs no zero at a for F(n) — it only needs the inherited cn−1 and the free zero of F(n−1) at a.
Pause & predict
In the ladder, why must the derivatives of F vanish at a up to order n−1 — why not just F(a)=0?
In one sentence: A function that is n-fold flat at a and zero at b has its n-th derivative vanishing somewhere in between — one Rolle per rung, nesting inward.
5
Taylor's theorem, built by hand
Proposition P wants a function that is n-fold flat at a and zero at b. We have a function f and a polynomial we would like to be its impostor,
P(x)=k=0∑nak(x−a)k,
with the coefficients a0,…,an still to be chosen. So the plan is: build the gapF(x)=f(x)−P(x), choose the coefficients so that F satisfies Proposition P, and read off what the last flat spot tells us. Three moves. Each one is short.
The first n coefficients make F flat at a. The last coefficient makes F zero at b. Proposition P then delivers a c — and that c is the remainder.
Prove it · move 1 — flattening the gap at a fixes the first n coefficients
Claim.F(k)(a)=f(k)(a)−k!ak for k=0,1,…,n. So F(k)(a)=0 exactly when ak=k!f(k)(a).
1
Differentiate one power j times and evaluate at a:
dxjdj(x−a)kx=a=⎩⎨⎧0k!0j<kj=kj>kFewer differentiations than the power (j<k): a positive power of (x−a) survives, and it is 0 at a. Exactly k differentiations: the power is used up and leaves k(k−1)⋯1=k!. More than k: a constant differentiated again is 0. Only the term whose power matches the number of differentiations survives at a.
2
So the k-th derivative of P at a picks out one term:
P(k)(a)=j=0∑najdxkdk(x−a)ja=ak⋅k!Every other term in the sum is killed by step 1 — either it still has a factor (x−a), or it has already been differentiated to zero.
3
Therefore F(k)(a)=f(k)(a)−P(k)(a)=f(k)(a)−k!ak, and demanding F(k)(a)=0 for k=0,…,n−1 forces
ak=k!f(k)(a),k=0,1,…,n−1.
That is the claim. ∎This is where the Taylor coefficients come from — not from a formula handed down, but from the demand that the gap be flat. The k! is the factorial left behind by differentiating (x−a)kk times.
Move 1 has spent n of the n+1 coefficients. One is left, an, and Proposition P still wants F(b)=0. That is one equation in one unknown:
Prove it · move 2 — the last coefficient makes the gap vanish at b
Claim. With a0,…,an−1 fixed by move 1, F(b)=0 holds exactly when
an=(b−a)n1(f(b)−k=0∑n−1k!f(k)(a)(b−a)k).
1
Write out F(b), separating the last term:
F(b)=f(b)−k=0∑n−1k!f(k)(a)(b−a)k−an(b−a)nThe first n coefficients are already known from move 1; only an is free.
2
Set F(b)=0 and solve for an:
an(b−a)nan=f(b)−k=0∑n−1k!f(k)(a)(b−a)k=(b−a)n1(f(b)−k=0∑n−1k!f(k)(a)(b−a)k).
That is the claim. ∎Divide by (b−a)n, which is not zero because b=a. Read it in words: an is "the gap left by the first n terms, per unit of (b−a)n". We do not yet know what an has to do with f's derivatives — that is move 3.
The gap function, pinned. For f=ex, a=0, n=3, b=2: the gap F=f−P leaves 0 perfectly flat (value, slope and bend all zero), dips, and returns to zero at b. The three nested flat spots are exactly where the ladder puts them.
Now the payoff. F satisfies everything Proposition P asks for: flat to order n−1 at a (move 1) and zero at b (move 2). So there is a c∈(a,b) with F(n)(c)=0. Unpack that one equation and the remainder falls out:
Prove it · move 3 — Taylor's theorem with the remainder
Claim. There is a c strictly between a and b such that
f(b)=k=0∑n−1k!f(k)(a)(b−a)k+n!f(n)(c)(b−a)n.
1
Differentiate F=f−P exactly n times. By step 1 of move 1, the n-th derivative of P is the constant n!an (every lower power has been differentiated away, and there are no higher ones):
F(n)(x)=f(n)(x)−n!anfor every x.A degree-n polynomial differentiated n times is a constant: its leading coefficient times n!.
2
Proposition P gives c∈(a,b) with F(n)(c)=0. At that c:
f(n)(c)−n!an=0⟹an=n!f(n)(c).The last coefficient — which move 2 defined as "the gap per unit (b−a)n" — is revealed to be the n-th derivative at a secret point, divided by n!. It has the same shape as every other coefficient; only the point where the derivative is taken has moved from a to c.
3
Substitute this an into move 2's equation F(b)=0, i.e. f(b)=∑k<nk!f(k)(a)(b−a)k+an(b−a)n:
f(b)=Taylor polynomial Pn−1(b)k=0∑n−1k!f(k)(a)(b−a)k+remainder Rnn!f(n)(c)(b−a)n.
That is the claim. ∎The polynomial part uses derivatives at a — things you can compute. The remainder uses one derivative at an unknown c — which you cannot compute, but can bound. For n=1 this is the mean value theorem, f(b)=f(a)+f′(c)(b−a); the whole construction is that theorem, repeated up a ladder.
Read it as a promise
Replace b by any x in the interval and the theorem reads: f(x)=Pn−1(x)+Rn(x), exactly, for every x — the impostor plus a lie whose size is n!f(n)(c)(x−a)n for some c between a and x. The lie has two parts you can see: (x−a)n, which is tiny close to the anchor and grows fast away from it; and 1/n!, which shrinks ferociously as you keep more terms. The one part you cannot see, f(n)(c), is trapped between the smallest and largest values of f(n) on the interval. That is enough to put a number on it, and the next section does.
Pause & predict
In the construction, an was first defined (move 2) as a quotient involving f(b), then revealed (move 3) to equal f(n)(c)/n!. What did the theorem actually prove?
Pause & predict
Take f(x)=x3, a=0, n=2 (keep only P1), and b=2. Since f(0)=f′(0)=0, P1≡0 and the whole value f(2)=8 is remainder: 8=2!f′′(c)⋅22. What is c?
In one sentence: Choose the polynomial so the gap is flat at a and zero at b; Proposition P then forces the last coefficient to be f(n)(c)/n!, which is Taylor's remainder.
6
How big is the lie? — the remainder in your hands
You will never know c. But you do not need to. If ∣f(n)∣ never exceeds some number M on the stretch between a and x, then whatever c is,
∣Rn(x)∣=n!∣f(n)(c)∣∣x−a∣n≤n!M∣x−a∣n.
That is a guarantee you can compute before you trust an approximation — and it is usually pessimistic by only a little, because the true f(n)(c) tends to sit close to the values at the ends. The detective below does both jobs: it computes the guaranteed band, and then it hunts down the actual c that makes the formula exact.
The remainder detectiveCut the series, measure the lie, and find the secret point c that explains it exactly
Try: load √4.2 (Problem A3), then slide the order from 2 to 3 (the tangent line becomes the parabola) and watch the gap collapse from 0.0006 to 0.000015. Then push x far from the anchor and watch the bound balloon.
—
Keep the terms up to degree n−1; the lie is exactly n!f(n)(c)(x−a)n for one secret c between a and x. The detective solves for that c numerically and marks it. The translucent band is the guarantee you can compute without knowing c: the worst ∣f(n)∣ on the interval, times ∣x−a∣n/n!.
Prove it · the remainder bound
Claim. If ∣f(n)(t)∣≤M for every t between a and x, then ∣f(x)−Pn−1(x)∣≤n!M∣x−a∣n.
1
Taylor's theorem (with b=x) gives a c between a and x with
f(x)−Pn−1(x)=n!f(n)(c)(x−a)n.This is an equality, not an estimate. Everything uncertain is inside f(n)(c).
2
Take absolute values; c is between a and x, so the hypothesis applies to it:
∣f(x)−Pn−1(x)∣=n!∣f(n)(c)∣∣x−a∣n≤n!M∣x−a∣n.
That is the claim. ∎The only information used about c is where it lives. Whatever it is, the derivative there is at most M in size.
Two examples worth memorising
Small angles.cosx=1−2x2+R4, with ∣R4∣≤24x4 because every derivative of cos is bounded by 1. At x=0.5 the bound is 0.0026; the actual error is 0.00258. (Why n=4 and not 3? The x3 term of cos is zero, so 1−x2/2 is really P3, and the first thing left out is order 4.) The number e.e=∑k<nk!1+Rn with ∣Rn∣≤n!e<n!3. Ten terms (n=10) give 3/10!≈8×10−7: six correct decimals from a sum you could do by hand. Practice Problem 4 works both in full.
Pause & predict
You approximate sinx by x (that is P2: the x2 term is zero). For x=0.3, what is the tightest guarantee the remainder bound gives?
In one sentence: You cannot see c, but ∣f(n)∣≤M on the interval turns the exact remainder into a computable guarantee, ∣Rn∣≤M∣x−a∣n/n!.
7
MacLaurin's series — and why the factorial always wins
Anchor the polynomial at a=0 and it is called a MacLaurin series. Two functions make the pattern unforgettable. For ex every derivative is ex again, so every derivative at 0 is 1:
ex=1+x+2!x2+3!x3+⋯=k=0∑∞k!xk
For cosx the derivatives at 0 cycle through 1,0,−1,0,1,…, so only even powers survive and the signs alternate:
cosx=1−2!x2+4!x4−6!x6+⋯
The word "series" hides a question: does the infinite sum actually reach the function, or only get close and then wander off? The remainder answers it. For ex on any interval ∣t∣≤∣x∣, ∣f(n)(t)∣=et≤e∣x∣, so ∣Rn∣≤e∣x∣n!∣x∣n. Whether that goes to zero is a race between a power∣x∣n and a factorialn! — and the factorial always wins:
The factorial winsWhy the series for eˣ, sin x and cos x can be trusted at every x — the hump, then the crash
Try: push x to 5. The terms grow for a while (the hump), then n! overtakes 5n and they crash to nothing. Compare with ln(1+x): past x=1 the bars never come down.
—
Term n has size ∣x∣n/n! (times a bounded derivative). A power ∣x∣n multiplies by the same ∣x∣ every step; a factorial multiplies by n, which eventually dwarfs any fixed ∣x∣. That race is the whole reason the exponential and trigonometric series converge everywhere — and ln(1+x), whose terms shrink only like ∣x∣n/n, loses the race the moment ∣x∣>1.
Prove it · the factorial beats every power
Claim. For any fixed x, n!∣x∣n→0 as n→∞. Hence the MacLaurin series of ex, sinx and cosx converge to the function at everyx.
1
Look at how each term grows into the next:
∣x∣n/n!∣x∣n+1/(n+1)!=n+1∣x∣.Going from term n to term n+1 multiplies the power by ∣x∣ (the same number every time) and the factorial by n+1 (a number that keeps growing).
2
Once n+1≥2∣x∣, each step multiplies the term by at most 21. So beyond that point the terms shrink at least as fast as 21,41,81,… times a fixed number — and that goes to zero.
Before the crossover the terms may grow (the "hump" in the widget: for x=5 the largest term is at n=4 or 5); after it they are halved, at least, every step.
3
For ex: ∣Rn∣≤e∣x∣∣x∣n/n!→0. For sinx and cosx: every derivative is bounded by 1, so ∣Rn∣≤∣x∣n/n!→0. In each case Pn−1(x)→f(x): the series converges to the function everywhere. ∎Contrast ln(1+x)=x−2x2+3x3−⋯: its terms shrink only like ∣x∣n/n — no factorial in the denominator — and for ∣x∣>1 they grow. Taylor's remainder is what tells you the difference between "trust it everywhere" and "trust it only near the anchor". Unit 6 saw the cliff at x=1; now you know why it is there.
Pause & predict
For ex at x=5, the terms 5n/n! first grow, then shrink. At which n is the largest term?
In one sentence: MacLaurin is Taylor at 0; the terms of ex, sinx, cosx may hump but always crash, because n! eventually multiplies faster than any fixed ∣x∣ can.
8
Two variables — walk along a line and it is one variable again
The hilly landscape
Now the function is a landscape, z=f(x,y). You stand at P=(a,b) and want to know the height at a nearby point S=(a+h,b+k). Everything you have built so far is about one variable. So do the simplest possible thing: walk from P to S in a straight line, and record your height as you go. Height-versus-time on that walk is an ordinary one-variable function — and one-variable Taylor applies to it, ladder, remainder and all.
Parameterise the segment by a clock t running from 0 at P to 1 at S: x=a+th,y=b+tk. The height along the walk is
F(t)=f(a+th,b+tk),F(0)=f(a,b),F(1)=f(a+h,b+k).
Two derivatives of F are all we need, and the chain rule delivers both:
The line trickWalk from P to S along a straight line and the surface becomes a one-variable curve — drag to orbit
Try: load Problem A2 and read the gap between the true height and the quadratic clone at S=(0.1,0.2): it is 0.00044. Then double h and k — the gap grows about tenfold: eightfold from the third-order leftover, the rest from fourth-order crumbs.
drag the picture to orbit
—
The surface is f(x,y)=exsiny. Along the segment, F(t)=f(a+th,b+tk) is an ordinary one-variable function of t, so one-variable Taylor applies to it — and its second derivative is exactly h2fxx+2hkfxy+k2fyy. The glass surface is the quadratic clone Q built from those three numbers.
Prove it · the first derivative along the walk
Claim.F′(t)=hfx+kfy, the partials evaluated at the current point (a+th,b+tk).
1
F is f composed with the straight-line map t↦(x(t),y(t)). Unit 6's chain rule for a path says
F′(t)=fxdtdx+fydtdy.Two routes from t to F — through x and through y — multiply along each route and add across them (Unit 7's two rules).
2
On a straight line the velocities are constants: dx/dt=h, dy/dt=k. So
F′(t)=hfx(a+th,b+tk)+kfy(a+th,b+tk).
That is the claim. ∎This is the directional derivative of Unit 6 in the direction (h,k): steepness of the landscape as felt by a walker moving with velocity (h,k).
Prove it · the second derivative along the walk
Claim.F′′(t)=h2fxx+2hkfxy+k2fyy, again at the current point.
1
F′=hfx+kfy is itself a function of the position on the walk, so apply the same chain rule to it:
F′′(t)=∂x∂F′dtdx+∂y∂F′dtdy=∂x∂(hfx+kfy)h+∂y∂(hfx+kfy)k.Same two routes, same two constant velocities h and k.
2
Differentiate inside the brackets, h and k being constants:
∂x∂(hfx+kfy)=hfxx+kfyx,∂y∂(hfx+kfy)=hfxy+kfyy.fyx means "first y, then x". For a twice continuously differentiable f, Clairaut's theorem says the order does not matter: fyx=fxy.
3
Multiply out and collect, using fyx=fxy:
F′′(t)=h(hfxx+kfxy)+k(hfxy+kfyy)=h2fxx+2hkfxy+k2fyy.
That is the claim. ∎A quadratic form in (h,k): the three second partials are its coefficients. This single line is the birthplace of the Hessian.
F is an ordinary function on [0,1], continuous with a continuous derivative and twice differentiable inside, so Taylor's theorem with n=2, a=0, b=1 applies to it word for word. Translate back to x and y and the two-variable expansion appears:
Prove it · Taylor in two variables, with its remainder
Claim. For some c∈(0,1),
f(a+h,b+k)=f(a,b)+hfx(a,b)+kfy(a,b)+21(h2fxx+2hkfxy+k2fyy)(a+ch,b+ck).
1
One-variable Taylor for F on [0,1] with n=2:
F(1)=F(0)+F′(0)(1−0)+2!F′′(c)(1−0)2,c∈(0,1).The theorem of the previous sections, applied to the walk. The remainder is evaluated at a secret clock-time c — i.e. at a secret point on the segment.
2
Substitute the three ingredients: F(1)=f(a+h,b+k), F(0)=f(a,b), F′(0)=hfx(a,b)+kfy(a,b), and F′′(c)=(h2fxx+2hkfxy+k2fyy) evaluated at (a+ch,b+ck).
That is the claim. ∎The first-order part is Unit 6's tangent plane. The second-order part is new: the landscape's curvature, packed into three numbers and one quadratic form. Replace the secret point by (a,b) and you get the quadratic cloneQ — the glass surface in the widget — with a third-order leftover, exactly as in one variable.
Pause & predict
On the widget's surface f=exsiny, start at P=(0,0) and take the step (h,k)=(0.1,0.2). The quadratic clone gives Q=0.22; the truth is 0.21956, a gap of 4.4×10−4. Double the step to (0.2,0.4). Roughly what happens to the gap?
Pause & predict
Why does the cross term appear as 2hkfxy — with a 2 — while the pure terms are h2fxx and k2fyy?
In one sentence: Along a straight line the landscape is a one-variable function F(t); its second derivative h2fxx+2hkfxy+k2fyy is where the Hessian is born.
9
At a flat point, the second-order term decides
Optimisation lives at flat points. A critical point(a,b) is one where the gradient vanishes, fx(a,b)=fy(a,b)=0 — the tangent plane is level, and the first-order term of the expansion is zero. Every step you take from there changes the height only through the second-order term:
Read the left side: it is how much higher or lower you are after the step. If it is positive for every small step, you were at the bottom of a bowl — a local minimum. Negative for every small step: the top of a dome — a local maximum. Positive for some steps and negative for others: a saddle. So the whole question is the sign of Q.
The step, seen from above. From a flat point P, a step (h,k) to S changes the height by 21Q, where the quadratic form is evaluated at a secret point on the segment. Whether that is up or down is the question the Hessian will answer.
One subtlety before the judge takes the stand. Q is evaluated at the secret point, not at (a,b) itself. The lecture's resolution is exactly right: if Q(0) — the form evaluated at (a,b) — is not zero, then for small enough steps Q(c) has the same sign as Q(0). So the sign of the change is decided by the three numbers fxx,fxy,fyyat the critical point. Here is why the "small enough" is not a loophole:
Prove it · the secret point cannot flip the sign
Claim. Suppose the second partials are continuous and Q0(h,k)=h2fxx(a,b)+2hkfxy(a,b)+k2fyy(a,b) is positive for every direction (h,k)=(0,0). Then for all sufficiently small steps, f(a+h,b+k)−f(a,b)>0. (The negative case is identical with signs flipped.)
1
Scale out the step size. Write (h,k)=r(u,v) with u2+v2=1 and r>0. Then Q0(h,k)=r2Q0(u,v), and Q0(u,v) is a continuous function on the unit circle, which is closed and bounded, so it attains a minimum m. Because Q0>0 at every point of the circle, m>0.
A quadratic form's sign does not depend on the length of the step, only on its direction. The minimum over directions exists and is positive — that is the number the argument hangs on.
2
Compare the secret point with the anchor. The coefficients fxx,fxy,fyy are continuous, so there is a radius ρ such that within distance ρ of (a,b) each coefficient differs from its value at (a,b) by less than m/4. For the form at the secret point this gives, for any unit direction,
Qc(u,v)−Q0(u,v)≤∣u2∣4m+∣2uv∣4m+∣v2∣4m≤4m(1+1+1)<m.Using u2≤1, v2≤1, ∣2uv∣≤u2+v2=1. The secret point lies on the segment, hence within r<ρ of the anchor, so the estimate applies to it.
3
Hence Qc(u,v)>Q0(u,v)−m≥m−m=0 for every direction, and so
f(a+h,b+k)−f(a,b)=21r2Qc(u,v)>0whenever 0<r<ρ.
That is the claim. ∎"Sufficiently small" means r<ρ, a definite radius that depends only on how fast the second partials change. Inside that radius, the anchor's three numbers rule.
Pause & predict
At a critical point, why can the first-order term never help you decide between a minimum and a maximum?
In one sentence: At a flat point the height change after a small step is 21Q, and continuity lets the three second partials at the point decide its sign.
10
Taylor in matrix form — and how to remember it
Three numbers decided everything in the last section, so give them a home. Pack the second partials into a matrix and the walk's second derivative becomes a sandwich:
(Multiply it out: the two diagonal entries give h2fxx and k2fyy; the two off-diagonal entries each give hkfxy, and together they are the 2hkfxy from the walk.) The matrix H is the Hessian — every second partial derivative in one place, symmetric because fxy=fyx. With it, the whole two-variable expansion of the previous sections — first-order term included — collapses into one line that looks exactly like the one-variable formula:
Taylor's theorem in matrix form
For f:Rn→R, a base point x0 and a step h, with ∇f the gradient (a column of the n first partials) and H the Hessian (the n×n matrix Hij=∂2f/∂xi∂xj):
f(x0+h)=f(x0)+∇f(x0)⊤h+21h⊤H(x0+ch)hfor some c∈(0,1),
and, evaluating H at x0 instead, the quadratic cloneQ(h)=f(x0)+∇f⊤h+21h⊤Hh with a third-order leftover.
How to remember it — the rank ladder
Write the one-variable formula and promote each derivative by one rank:
one variable:many variables:f(a)f(x0)++f′(a)h∇f⊤h++21f′′(a)h221h⊤Hh
The value is a number in both worlds — nothing to promote. The first derivative becomes a list of n slopes, the gradient; a list needs exactly one step to turn into a number, so it is dotted with h: one h, one index. The second derivative becomes an n×n table of curvatures, the Hessian; a table needs two steps to become a number, one for each index, so h is fed in from both sides: the sandwich. The 21 is 1/2! and stays exactly where it was — the first-order term's 1/1! is invisible for the same reason it was invisible in one variable. Two habits make it stick: each derivative index eats one copy of h (∑ifihi, then ∑i∑jfijhihj), and every term must be a plain number — check the shapes: (1×n)(n×1) is a number, (1×n)(n×n)(n×1) is a number. If you ever write Hh2 or ∇fh without a transpose, the shapes refuse to multiply, and that refusal is the formula correcting you.
The rank ladder. Promote each derivative by one rank — number, list, table — and feed it as many copies of the step h as it has indices. The shapes do the remembering for you.
The sandwich, unwrappedhᵀHh looks compact — hover an entry of H to see exactly which term of the sum it feeds
Try: hover the two off-diagonal entries: they feed the same product h1h2, which is where the 2 in 2hkfxy comes from. Switch to three variables and count — 9 entries, 6 distinct numbers, and every term still a plain number.
—
Row × matrix × column is a double sum: h⊤Hh=∑i∑jhiHijhj. Each entry of H feeds one term, and each term uses the step component of its row and of its column. Because H is symmetric, the mirror-image entries Hij and Hji feed the same product and merge — for two variables that merge is the familiar h2fxx+2hkfxy+k2fyy.
Prove it · the matrix form, from the line trick, for any number of variables
Claim. For F(t)=f(x0+th): F′(t)=∇f⊤h and F′′(t)=h⊤Hh, both evaluated at x0+th. Hence f(x0+h)=f(x0)+∇f(x0)⊤h+21h⊤H(x0+ch)h for some c∈(0,1).
1
Along the walk the i-th coordinate is xi(t)=x0,i+thi, so dxi/dt=hi. The chain rule with n routes (Unit 7's add-across-paths, one path per coordinate):
F′(t)=i=1∑n∂xi∂fdtdxi=i=1∑nfihi=∇f⊤h.A sum of (partial) × (step component) over one index is exactly a dot product — a row times a column.
2
Differentiate again. Each fi is itself a function of position on the walk, so it gets its own chain rule with the same constant velocities:
F′′(t)=i=1∑nhidtdfi=i=1∑nhij=1∑n∂xj∂fihj=i=1∑nj=1∑nhiHijhj=h⊤Hh.A double sum of (entry) × (left step component) × (right step component) is exactly a row × matrix × column. Here Hij=∂2f/∂xj∂xi=∂2f/∂xi∂xj by Clairaut, which is why H is symmetric and why the two cross terms h1h2H12 and h2h1H21 merge into 2h1h2H12 in two variables.
3
Apply one-variable Taylor with n=2 to F on [0,1]: F(1)=F(0)+F′(0)+21F′′(c) for some c∈(0,1). Substitute steps 1 and 2:
f(x0+h)=f(x0)+∇f(x0)⊤h+21h⊤H(x0+ch)h.
That is the claim. ∎Nothing about the argument used n=2. The matrix form is not a new theorem — it is the one-variable theorem read along a line, with the chain rule turning derivatives into a gradient and a Hessian. Keep going and the third derivative would be an n×n×n cube of numbers eating three copies of h; linear algebra stops being comfortable there, which is exactly why "second-order" is where most of optimisation stops too.
Pause & predict
You remember f(a)+f′(a)h+21f′′(a)h2 and want its many-variable form. Which promotion is right — and why do the others fail before you even think about calculus?
In one sentence:f(x0+h)≈f(x0)+∇f⊤h+21h⊤Hh is the one-variable formula with each derivative promoted one rank and fed one copy of h per index — and it falls straight out of the line trick.
11
The judge of extrema — the Hessian
Put the two previous sections together. At a critical point the gradient term of the matrix form vanishes, so the height change after a step is
f(x0+h)−f(x0)=21h⊤Hh(at the secret point),Q(h,k)=h⊤Hh=h2fxx+2hkfxy+k2fyy.
The question "bowl, dome or saddle?" is now the question "is h⊤Hh positive for all h, negative for all h, or both?" — in Unit 4's words, is Hpositive-definite, negative-definite, or indefinite. A matrix has become a judge. Put it on the stand:
The judgeThree numbers — fxx, fxy, fyy — decide bowl, dome, or saddle. Turn the dials and watch the landscape rule.
Try: start from the bowl, then raise fxy slowly. The bowl tilts and stretches; the moment fxy2 passes fxxfyy, one direction gives way and the bowl tears open into a saddle.
drag the picture to orbit
—
The surface is z=21(h,k)H(h,k)⊤=21(fxxh2+2fxyhk+fyyk2) — the second-order term of Taylor at a flat point, with nothing else in the way. The three tabs are three ways of reading the same matrix: they always agree, and the widget shows why.
The judge's ruling rests on one algebraic identity, and it is worth seeing exactly how three coefficients get squeezed into two signs. The trick is completing the square — multiply Q by fxx so that the h-terms fold into a perfect square, and watch what is left over:
Prove it · the judge's identity
Claim.fxxQ=(hfxx+kfxy)2+(fxxfyy−fxy2)k2. Writing D=fxxfyy−fxy2 (the discriminant, which is detH): fxxQ=(hfxx+kfxy)2+Dk2.
1
Multiply the form by fxx:
fxxQ=h2fxx2+2hkfxxfxy+k2fxxfyy.Every term picks up one factor fxx. The first two now look like the start of (hfxx+kfxy)2.
2
Expand the square that those two terms suggest:
(hfxx+kfxy)2=h2fxx2+2hkfxxfxy+k2fxy2.It matches step 1 in the first two terms; the third term is k2fxy2 instead of k2fxxfyy.
3
Subtract step 2 from step 1; only the k2 terms survive:
fxxQ−(hfxx+kfxy)2=k2fxxfyy−k2fxy2=(fxxfyy−fxy2)k2=Dk2.
That is the claim. ∎The right side is a square plus D times another square. Squares are never negative — so the sign of fxxQ is controlled by the sign of D.
Prove it · the three verdicts
Claim. At a critical point: D>0,fxx>0⇒ local minimum; D>0,fxx<0⇒ local maximum; D<0⇒ saddle. D=0: no verdict.
1
D>0. Then fxx=0 (otherwise D=−fxy2≤0). By the identity, fxxQ=(square)+Dk2≥0, with equality only if both k=0 and hfxx=0, i.e. h=k=0. So for every non-zero step, fxxQ>0: Q has the sign of fxx.
fxx>0: Q>0 for all steps — every small step goes up — a bowl, a local minimum. fxx<0: Q<0 for all steps — a dome, a local maximum.
2
D<0, with fxx=0. Step along the x-axis, (h,k)=(1,0): Q=fxx. Step along (h,k)=(−fxy,fxx): the square in the identity vanishes (−fxyfxx+fxxfxy=0), leaving fxxQ=Dfxx2<0, so Q has the sign opposite to fxx.
Two directions, two opposite signs: up one way, down another. That is a saddle. (If fxx=0 but fyy=0, run the same argument with the roles of h and k swapped; if both vanish, D=−fxy2<0 means fxy=0 and Q=2hkfxy already changes sign between (1,1) and (1,−1).)
3
D=0. The identity reads fxxQ=(hfxx+kfxy)2≥0: Q never changes sign, but it is zero along a whole direction, and there the second-order term says nothing — the decision passes to third- and fourth-order terms, which this test does not see. Practice Problem 8 shows x4+y4 (a minimum) and x4−y4 (a saddle) with the same zero Hessian. ∎Inconclusive is an honest verdict, not a failure: the judge only hears second-order evidence.
Pause & predict
At a critical point you find fxx=−2,fyy=−2,fxy=1. What kind of point is it?
The discriminant is one reading of H. Unit 4 taught two more, and the lecture connects all three. Sylvester's criterion: a symmetric matrix is positive-definite exactly when every leading principal minor — the determinants of the top-left 1×1, 2×2, … blocks — is positive. For our 2×2 Hessian the minors are fxx and detH=D, so Sylvester's condition is the minimum verdict, word for word. Eigenvalues: a symmetric matrix is positive-definite exactly when all its eigenvalues are positive. The compass below shows why that is the same statement again, and why the eigenvectors are the directions of greatest and least curvature:
The curvature compassPoint in a direction θ and read the curvature there — the compass rose that tells bowls from saddles
Try: press ▶ sweep. On a saddle the needle crosses zero four times per turn; on a bowl it never does. Then drag fxy and watch the eigen-directions (the longest and shortest spokes) rotate.
—
Walk away from the flat point in direction θ with unit speed; the surface's height grows like 21Q(θ)r2 where Q(θ)=u⊤Hu for u=(cosθ,sinθ). The largest and smallest values of Q over all directions are the eigenvalues λ1,λ2 of H, reached along its eigenvectors — Unit 4's spectral theorem, standing on a hilltop.
Prove it · eigenvalues are the extreme curvatures, and their signs are the verdict
Claim. Let H be symmetric with eigenvalues λ1≥λ2 and orthonormal eigenvectors e1,e2. Then for every unit direction u, λ2≤u⊤Hu≤λ1, with equality along e2 and e1. Consequently H is positive-definite ⟺λ1,λ2>0, negative-definite ⟺ both negative, indefinite ⟺ opposite signs; and D=detH=λ1λ2, fxx+fyy=λ1+λ2.
1
Unit 4's spectral theorem: H=QΛQ⊤ with Q=[e1e2] orthogonal and Λ=diag(λ1,λ2). Write any direction in the eigenbasis, u=αe1+βe2, i.e. Q⊤u=(α,β)⊤. Then
u⊤Hu=(Q⊤u)⊤Λ(Q⊤u)=λ1α2+λ2β2.In the eigenbasis the cross term disappears: the quadratic form is just two squares, each weighted by an eigenvalue.
2
For a unit direction α2+β2=1, so λ1α2+λ2β2 is a weighted average of λ1 and λ2 with non-negative weights summing to 1. It therefore lies between them:
λ2≤u⊤Hu≤λ1,
with λ1 reached at α=1 (direction e1) and λ2 at β=1 (direction e2).
The compass rose is exactly this: the needle's reading swings between the two eigenvalues, touching them along the eigenvectors.
3
Signs. Q>0 for every direction ⟺ the minimum reading λ2>0⟺ both eigenvalues positive. Q<0 for every direction ⟺λ1<0. Opposite signs ⟺ the needle crosses zero ⟺ saddle.
Definiteness is a statement about the smallest (or largest) curvature, and those are eigenvalues.
4
Bridge to the discriminant: detH=det(QΛQ⊤)=detΛ=λ1λ2=D, and trH=fxx+fyy=λ1+λ2. So D<0⟺ opposite signs ⟺ saddle; and D>0 with fxx>0 forces fyy>fxy2/fxx≥0, hence λ1+λ2>0 with λ1λ2>0: both positive. The three readings of H — discriminant, Sylvester, eigenvalues — are one verdict. ∎Which reading to use is a matter of convenience: D is fastest by hand; eigenvalues also tell you how bowl-shaped (their ratio is the condition number that will govern gradient descent in Unit 9); Sylvester scales to n×n Hessians where "D" no longer exists.
Prove it · negative-definite means the minors alternate
Claim.H is negative-definite ⟺fxx<0 and D>0 — the leading minors alternate in sign, starting negative.
1
H is negative-definite exactly when −H is positive-definite (multiply h⊤Hh<0 by −1).
A dome flipped upside down is a bowl.
2
Apply Sylvester to −H=[−fxx−fxy−fxy−fyy]: its minors are −fxx and det(−H)=(−1)2detH=D. Both must be positive: fxx<0 and D>0.
That is the claim. ∎Flipping the sign of a k×k block multiplies its determinant by (−1)k — that is why, for a larger Hessian, the minors of a negative-definite matrix alternate: negative for odd k, positive for even k. The eigenvalues are all negative, as the lecture says.
Pause & predict
A Hessian has eigenvalues λ1=7.24 and λ2=2.76 at a critical point (Practice Problem 7). Without computing anything else, what do you know?
Pause & predict
For f=exsiny at (0,0) the Hessian is [0110]: both pure curvatures are zero. Is the origin flat, or a saddle?
In one sentence: The Hessian is the matrix of the walk's second derivative; D=detH with the sign of fxx, Sylvester's minors, and the eigenvalue signs are three readings of the same verdict — bowl, dome, or saddle.
12
The judge at work — six landscapes
The procedure is always the same three moves, and it is worth saying them plainly before the widget does them for you. One: solve ∇f=0 — two equations, two unknowns — to find every flat point. Two: compute fxx,fxy,fyy and evaluate them at each flat point separately (for anything beyond a quadratic they change from point to point). Three: read D and fxx and pronounce the verdict. The companion's two worked examples and the practice set's landscapes are all here; so are the two where the judge must stay silent.
The critical-point hunterSix landscapes from the companion and the practice set: find every flat point, then let the Hessian judge it — drag to orbit
Try: load x³ + y³ − 3xy + 1. Two flat points: one is a saddle, one a minimum — click each dot and compare their Hessians. Then load the two x4 landscapes, where the Hessian is all zeros and has nothing to say.
drag the picture to orbit · tap a dot to select it
—
For each landscape the widget solves ∇f=0, evaluates the Hessian at every solution and applies the second-derivative test. The glass surface at the selected point is the quadratic clone f(P)+21h⊤Hh — the local bowl, dome or saddle that the Hessian is.
Reading the two cubic landscapes
f=x3+y3−3xy+1: ∇f=(3x2−3y,3y2−3x)=0 gives y=x2 and x=y2, so x=x4, i.e. x∈{0,1}. Two flat points. At (0,0): fxx=fyy=0, fxy=−3, D=−9 — a saddle. At (1,1): fxx=fyy=6, D=36−9=27, fxx>0 — a local minimum, value 0. Same function, same formula for H, two different verdicts, because fxx=6x and fyy=6y are different numbers at the two points. Local minimum, too: walk to (−2,0) and f=−7, lower than 0. The judge only rules on the immediate neighbourhood.
And the two landscapes where it cannot rule. g=x4+y4 and h=x4−y4 both have the origin as their only flat point, and both have fxx=12x2, fyy=±12y2, fxy=0 — all zero there, D=0. The second-derivative test sees two identical (empty) Hessians. Yet g≥0 everywhere with equality only at the origin (a minimum), while h=t4 along the x-axis and −t4 along the y-axis (a saddle). The difference is fourth order — invisible to a test that only hears second-order evidence. The lecture's instruction is the right one: when D=0, another test is needed: look at the higher-order terms of the expansion, or argue about the function's shape directly.
Pause & predict
For f=x3−3xy+3y2 (Practice Problem 6) the flat points are (0,0) and (21,41), with fxx=6x, fxy=−3, fyy=6. Which verdict goes where?
In one sentence: Solve ∇f=0, evaluate H at each flat point, read D and fxx — and when D=0, the second-order evidence has run out and you must look further.
13
Why a learning machine cares — curvature, conditioning, and the saddle problem
The lecture opened by saying the Hessian "plays a huge role in neural network cost function minimisation". Here is that role, in three sentences that the coming units will turn into whole stories.
Training is descending a landscape. The loss L(w) is a function of a million weights, and every step of gradient descent (Unit 9) is a step on that landscape. At the bottom of a valley the gradient vanishes — and the Hessian, now a million-by-million matrix of second partials, is exactly the judge of this unit: positive-definite means a true minimum, opposite-sign eigenvalues mean a saddle you can still slide off.
Curvature sets the speed limit. Near a minimum the loss is its own quadratic clone, L≈L0+21h⊤Hh. The compass showed the curvature ranging from λmin to λmax. Gradient descent must take steps small enough for the steepest direction (λmax) yet then crawls along the flattest (λmin); the ratio λmax/λmin, the condition number, is how elongated the valley is and how badly plain descent zig-zags. Momentum, RMSProp and Adam (Unit 11) are all ways of coping with a bad Hessian without ever computing it.
The clone suggests a jump. If you trusted the quadratic clone completely, you would not step downhill — you would jump straight to the clone's own bottom. That is Newton's method, and it falls out of this unit in two lines:
Prove it · Newton's step is the bottom of the quadratic clone
Claim. The quadratic clone of f at x0, Q(h)=f(x0)+∇f⊤h+21h⊤Hh, is minimised (when H is positive-definite) at h⋆=−H−1∇f.
1
Differentiate Q with respect to h, using Unit 7's cookbook (∇h(a⊤h)=a, ∇h(21h⊤Hh)=Hh for symmetric H):
∇hQ=∇f+Hh.The clone is a quadratic, so its gradient is linear in h.
2
Set it to zero and solve: Hh⋆=−∇f, so h⋆=−H−1∇f. The clone's Hessian is H itself, positive-definite, so this flat point of Q is its minimum — by this unit's own verdict. ∎Gradient descent moves along −∇f, scaled by a step size you must guess. Newton moves along −H−1∇f: the curvature rescales every direction — big steps where the valley is flat, small where it is steep. For a true quadratic it lands on the minimum in one jump. The price is H: for a million weights it is unaffordable, which is why the whole optimiser zoo exists.
Two ways down an elongated bowl. Contours of 21(9u2+v2), condition number λ1/λ2=9. Gradient descent (orange, step size 0.2) must keep its steps short for the steep axis, so it bounces between the walls and crawls along the valley; Newton's step (green) uses H−1 to rescale every direction and lands on the minimum at once. Unit 9 begins where the orange path does.
Pause & predict
Gradient descent takes the step −η∇f; Newton takes −H−1∇f. For a quadratic bowl with eigenvalues λ1≫λ2, why does Newton not zig-zag?
In one sentence: A loss surface near its bottom is its own quadratic clone; the Hessian's eigenvalues say how hard descent will be, and its inverse turns the clone's bottom into Newton's one-step jump.
14
What to carry forward
One flat spot on a trail generated this unit. Everything else was the same move — Rolle — applied again, then tilted, then stacked, then walked along a line.
Idea
The one-line version
Where it returns
Rolle
Same height at both ends + smooth ⇒ a flat spot between
every existence argument in calculus
Mean value theorem
f(b)=f(a)+f′(c)(b−a) — Rolle, tilted
Unit 9 · why a descent step works
Taylor with remainder
f(x)=Pn−1(x)+n!f(n)(c)(x−a)n, c between a and x
every "local approximation" from here on
The bound
∣Rn∣≤M∣x−a∣n/n! — you never need c
numerical methods, error budgets
MacLaurin
Taylor at 0; ex,sin,cos converge everywhere because n! wins
Units 10–11 · second-order methods and why we avoid them
The one thing to remember
Every smooth function is, up close, a polynomial — and Taylor's theorem tells you exactly how far "up close" reaches. The remainder f(n)(c)(x−a)n/n! is not a hand-wave; it came from a ladder of flat spots. And in two variables, the second-order term of that polynomial is a matrix whose signs decide whether a flat point is the bottom of a bowl. When a training loop reports that it has found a minimum, this unit is how anyone could ever check.
15
Practice arena — the unit's problem set, solved in full
Twelve problems: three from Part A (Taylor) and three from Part B (the Hessian) of Prof. Saurabh's practice set, three from his companion guide, and three written for this arena — a remainder-bound workout (Problem 4), an explicit hunt for the secret c (Problem 5), and a proof workout that derives the judge's identity and connects it to eigenvalues (Problem 12). Every number below is machine-verified.
Two habits do most of the work: for a Taylor polynomial, write the derivatives at the anchor in a column before touching the formula, and keep the k!; for a critical point, evaluate the Hessian at each point separately, then read D first and fxx second.
Problem 1easy
Let f(x)=lnx. (a) Compute f and its first four derivatives at x=1. (b) Write the fourth-order Taylor polynomial P4(x) of f about the point a=1. (c) Use P4 to estimate ln1.1 and compare with the true value.
What this tests. The recipe itself — differentiate, evaluate at the centre, divide by k!, attach (x−a)k. Plan. Make a small table of derivatives first and evaluate every one at the centre before assembling anything; then look for the pattern in the coefficients, and finish by plugging in a nearby x to see the polynomial earn its keep.
Show the full solution
(a) Step 1 — differentiate four times. Each derivative of lnx is a power of x, so the pattern is easy to carry:
ff′′′=lnx,=2x−3,f′f(4)=x−1,=−6x−4.f′′=−x−2,
At the centre x=1 every power of x is 1:
f(1)=0,f′(1)=1,f′′(1)=−1,f′′′(1)=2,f(4)(1)=−6.
(b) Step 2 — divide by k! and attach the powers of (x−1). The coefficient of (x−1)k is f(k)(1)/k!:
1!f′(1)=1,2!f′′(1)=−21,3!f′′′(1)=62=31,4!f(4)(1)=−246=−41,
so
P4(x)=(x−1)−21(x−1)2+31(x−1)3−41(x−1)4.
The coefficients are (−1)k+1/k — the k! in the denominator has eaten the (k−1)! that the derivatives produced.
Step 3 — the quicker route. Put u=x−1. Then lnx=ln(1+u), whose MacLaurin series is a standard one:
ln(1+u)=u−2u2+3u3−4u4+⋯
Truncate at degree 4 and write u=x−1 back: the same P4, in one line, with no differentiation at all. Expanding about a is always the same as expanding about 0 in the shifted variable x−a.
(c) Step 4 — check at x=1.1, where u=0.1:
P4(1.1)=0.1−20.01+30.001−40.0001=0.1−0.005+0.000333−0.000025=0.095308.
The true value is ln1.1=0.095310; the error is 1.8×10−6, about the size of the first term we dropped, u5/5=2.0×10−6. Four terms, six correct decimals.
(a) f(1)=0,f′(1)=1,f′′(1)=−1,f′′′(1)=2,f(4)(1)=−6. (b) P4(x)=(x−1)−21(x−1)2+31(x−1)3−41(x−1)4. (c) P4(1.1)=0.095308 against ln1.1=0.095310, error 1.8×10−6.
Remember
The coefficient is f(k)(a)/k!, never f(k)(a) alone, and the variable is (x−a), never x. Those two slips lose most of the marks on this type. When the function is a shifted standard one — ln(1+u), eu, 1+u — substitute first and copy the known series.
Problem 2easy
Let f(x)=x, expanded about the point a=4. (a) Find the first-order (linear) polynomial P1(x) and the second-order (quadratic) polynomial P2(x). (b) Use each to estimate 4.2. (c) Explain why the quadratic estimate is the better one.
What this tests. That P1 is the tangent line, that P2 adds the curvature, and that the sign of f′′ tells you on which side of the curve the tangent sits. Plan. Compute f,f′,f′′ at the centre; halve f′′ when it becomes a coefficient; plug in the increment x−4=0.2 rather than x itself; compare both estimates with the true value at the end.
Show the full solution
(a) Step 1 — derivatives at the centre. With f=x1/2:
f(4)=2,f′(x)f′′(x)=21x−1/2=−41x−3/2⇒f′(4)=41,⇒f′′(4)=−41⋅81=−321.
Step 2 — assemble. The quadratic coefficient is f′′(4)/2!=−641, so
P1(x)=2+41(x−4),P2(x)=2+41(x−4)−641(x−4)2.
(b) Step 3 — plug in the increment h=x−4=0.2.P1(4.2)P2(4.2)=2+41(0.2)=2.05,=2.05−641(0.2)2=2.05−0.000625=2.049375.
The true value is 4.2=2.0493902. So P1 is off by +6.1×10−4 and P2 by −1.5×10−5 — about forty times closer.
(c) Step 4 — why the quadratic wins.P1 is the tangent line at x=4: it matches the height and the slope there but knows nothing about bending. Since f′′(4)=−321<0, the curve bends downward, so the tangent rides above it and drifts away — that is why P1's error is positive. The remainder formula says how far: with n=2 the error is 21f′′(c)h2 for some c between 4 and 4.2, and 21⋅321⋅0.04=6.25×10−4 — almost exactly the 6.1×10−4 we found. P2 puts that missing bend back in with the term −641h2, so what remains is the third-order piece
3!f′′′(4)h3=63/256(0.008)=5120.008=1.56×10−5,
which matches P2's leftover error to two figures (and its sign explains why P2 now sits just below the curve).
Step 5 — the binomial shortcut. Factor out the centre and use (1+t)1/2=1+21t−81t2+⋯ with t=h/4:
4+h=21+4h=2(1+21⋅4h−81⋅16h2+⋯)=2+4h−64h2+⋯
Both polynomials fall out at once.
(a) P1(x)=2+41(x−4), P2(x)=2+41(x−4)−641(x−4)2. (b) P1(4.2)=2.05, P2(4.2)=2.049375, true 2.0493902; errors 6.1×10−4 and 1.5×10−5. (c) f′′<0: the tangent sits above a curve that bends down; the quadratic term restores the bend.
Remember
f′′(a) is not the coefficient — f′′(a)/2 is. Writing −321(x−4)2 instead of −641(x−4)2 is the classic lost mark here. And always substitute the incrementx−a, not x: P1(4.2) uses 0.2, not 4.2.
Problem 3medium
Let f(x,y)=exsiny. (a) Compute ∇f and the Hessian H at (0,0). (b) Write the second-order Taylor polynomial Q(x,y) of f about (0,0). (c) Use Q to approximate f(0.1,0.2), compare with the exact value, and say where the error comes from.
What this tests. The two-variable quadratic clone — five partial derivatives, the 21 in front and the 2 on the cross term — and reading the Hessian as a shape. Plan. List all five partials before evaluating any; substitute the centre; assemble Q in the form value + gradient term + half the quadratic form; then evaluate and compare, and name the order of the first neglected term.
Show the full solution
(a) Step 1 — the five partials. The exponential survives every x-derivative; the sine cycles under y-derivatives:
fxfxx=exsiny,=exsiny,fyfxy=excosy,=excosy,fyy=−exsiny.
At (0,0), e0=1,sin0=0,cos0=1, so f=0,fx=0,fy=1,fxx=0,fxy=1,fyy=0:
∇f(0,0)=[01],H(0,0)=[0110].
(b) Step 2 — assemble the clone. With centre (0,0) the increments are h=x,k=y:
Q(x,y)=f+(fxx+fyy)+21(fxxx2+2fxyxy+fyyy2)=0+(0⋅x+1⋅y)+21(0+2⋅1⋅xy+0)=y+xy.
(c) Step 3 — the numbers.Q(0.1,0.2)=0.2+(0.1)(0.2)=0.22. Exactly,
f(0.1,0.2)=e0.1sin0.2=1.105171×0.198669=0.2195636,
so Q overshoots by 4.4×10−4.
Step 4 — where the error comes from. Multiply the one-variable series and keep track of total degree:
exsiny=(1+x+2x2+6x3+⋯)(y−6y3+⋯)=y+xy+degree 321x2y−61y3+⋯
This is the product-of-series shortcut: Q=y+xy appears with no Hessian at all. The first neglected terms are cubic, and at (0.1,0.2) they give 0.001−0.001333=−3.3×10−4; the quartic terms 61x3y−61xy3 add −1.0×10−4, and together they account for almost the whole gap of −4.4×10−4. Doubling the step to (0.2,0.4) gives f=0.475637 against Q=0.48, a gap of −4.4×10−3 — ten times larger for a step twice as long, exactly what a cubic-led error (23=8, plus the quartic share) predicts.
Step 5 — read the Hessian as a shape.H=[0110] has trace 0 and determinant −1, so its eigenvalues solve λ2−1=0: λ=±1. The pure curvatures fxx,fyy vanish and all the bending lives in the cross term — the quadratic part xy is a saddle, rising along y=x and falling along y=−x. (The origin is not a critical point, since fy=1, so this is a statement about the clone's shape, not a classification of an extremum.)
(a) ∇f(0,0)=(0,1)⊤, H(0,0)=[0110]. (b) Q(x,y)=y+xy. (c) Q(0.1,0.2)=0.22 against f=0.2195636; error 4.4×10−4, third order, mostly 21x2y−61y3.
Remember
The quadratic term is 21(fxxh2+2fxyhk+fyyk2) — a 21 outside and a 2 on the cross term. Dropping either is where this problem sheds marks. When both functions have known series, multiply them and truncate by total degree: it is faster and it also shows you the size of the next term.
Problem 4mediumadded — covers the remainder bound
Bound the lie. (a) The small-angle rule cosx≈1−2x2 is used at x=0.5. Using the remainder formula, bound the error before computing anything; then compute the actual error and compare. (b) How many terms of the MacLaurin series of ex are needed at x=1 to guarantee an error below 10−6? Confirm by summing.
What this tests. Using Rn=f(n)(c)(x−a)n/n! as a guarantee: choosing n, bounding ∣f(n)(c)∣ over the whole interval, and reading "how many terms" off a factorial. Plan. First decide which n the remainder formula should carry (count a zero coefficient as a kept term); replace the unknown c by the worst case on the interval; only then compute the true value and check that it sits inside the bound.
Show the full solution
(a) Step 1 — pick n honestly. The MacLaurin coefficients of cos are 1,0,−21,0,241,… because f′′′(0)=sin0=0. So 1−2x2 is not only P2 but also P3: the degree-3 term is present and equals zero. The remainder formula therefore applies with n=4:
R4(x)=4!f(4)(c)x4=24coscx4,cbetween0andx.
Step 2 — bound the unknown c away. Whatever c is, ∣cosc∣≤1, so
∣R4(0.5)∣≤240.54=240.0625=0.0026042.
That is a promise made before any cosine was evaluated: the rule cannot lie by more than 0.0026.
Step 3 — the actual error.cos0.5=0.8775826 and 1−20.25=0.875, so the error is 0.0025826 — inside the bound, and almost equal to it (ratio 0.99). The bound is nearly tight because cosc≈1 for every c in (0,0.5): the next term of the series, x4/24, is essentially the error. Had we lazily used n=3, the bound ∣sinc∣0.53/6≤0.0208 would still be true, but eight times looser.
(b) Step 4 — write the bound. Keeping the terms k=0,…,n−1 of ex=∑xk/k! leaves the remainder Rn=ecxn/n! with c∈(0,1). At x=1, ec≤e<3, so
∣Rn∣≤n!e<n!3.
Step 5 — find the first n that works.9!3=3628803=8.27×10−6(too big),10!3=8.27×10−7<10−6.
So n=10: keep the terms k=0,1,…,9 — ten terms, up to x9/9!.
Step 6 — confirm by summing.k=0∑9k!1=2.7182815againste=2.7182818,
an error of 3.0×10−7, below 10−6 as promised. And nine terms genuinely fail: ∑k≤81/k!=2.7182788, error 3.1×10−6. The bound was honest, not lazy.
(a) n=4: ∣R4∣≤0.54/24=0.0026042; actual error cos0.5−0.875=0.0025826, inside the bound. (b) 3/n!<10−6 first at n=10: ten terms (k=0,…,9); the sum is 2.7182815, error 3.0×10−7.
Remember
In the remainder formula n is one more than the highest degree you kept — and a zero coefficient still counts as kept, which is why 1−x2/2 earns the x4 bound. Two habits lose marks: bounding f(n)(c) by its value ata instead of its maximum over the interval, and confusing "number of terms" with "degree".
Problem 5easyadded — covers the secret c
Find the secret c. Take f(x)=x3 on [0,2], anchored at a=0. Taylor's theorem promises a c∈(0,2) with f(2)=Pn−1(2)+n!f(n)(c)2n. (a) For n=1 (the mean value theorem), find c. (b) For n=2, find c. (c) For n=3, what happens?
What this tests. That the c in the remainder is a definite number fixed by f, a, x and n — not a free parameter — and that it moves when n moves. Plan. Write the theorem with the given n, fill in every known value (f and its derivatives at the anchor, the power of x−a), and solve the one equation left for c; check it lands strictly inside the interval.
Show the full solution
(a) Step 1 — n=1 is the mean value theorem.f(2)−f(0)=f′(c)(2−0) with f′(x)=3x2:
8−0=3c2⋅2=6c2⇒c2=34⇒c=32=1.1547.
The negative root −1.1547 lies outside [0,2]; the positive one is inside, as promised. Check: the chord has slope 8/2=4, and f′(1.1547)=3⋅34=4. ✓
(b) Step 2 — n=2. Now P1(x)=f(0)+f′(0)x=0+0⋅x=0: at the anchor the cubic is flat, so its tangent line is the x-axis and the whole of f(2) is remainder. With f′′(x)=6x:
8=2!f′′(c)22=26c⋅4=12c⇒c=32.
Again c∈(0,2). The curvature that explains the climb to height 8 is the curvature measured at x=32.
(c) Step 3 — n=3.f′′′(x)≡6, so
R3(x)=3!f′′′(c)x3=66x3=x3=f(x)
for everyc. The remainder is the entire function: a cubic is its own degree-3 Taylor polynomial, so P3=f, R4≡0 and f(4)≡0. The theorem is true for all c at once and stops telling you anything.
Step 4 — c depends on n and on x. Redo (a) and (b) with a general endpoint x instead of 2: x3=3c2x gives c=x/3, and x3=3cx2 gives c=x/3. At x=2 these are 1.1547 and 0.6667; at x=1 they would be 0.5774 and 0.3333. The secret point slides with the endpoint and jumps when the order changes.
(a) c=2/3=1.1547. (b) c=2/3. (c) f′′′≡6 makes R3=x3=f(x): every c works, because a cubic equals its own P3. In general c=x/3 for n=1 and c=x/3 for n=2.
Remember
The theorem promises that some c strictly between a and x makes the formula exact; it does not tell you which one, and it changes with n and x. Marks go when a student sets c=a or c=x "for simplicity", or forgets the (x−a)n factor next to f(n)(c)/n!.
Problem 6medium
Let f(x,y)=x3−3xy+3y2. (a) Find all critical points. (b) Form the Hessian and classify each point with the second-derivative test. (c) State the local-minimum value, and confirm the classification by the eigenvalue route.
What this tests. The full routine — solve ∇f=0, build H, read D=fxxfyy−fxy2 and then fxx — at two points where the Hessian is not constant. Plan. Use the simpler gradient equation to eliminate a variable; keep H symbolic and only then substitute each point; write D's sign before fxx's; finish with trace and determinant for the eigenvalues as an independent check.
Show the full solution
(a) Step 1 — solve ∇f=0.∇f=(3x2−3y,−3x+6y). The second component gives x=2y; substitute into the first:
3(2y)2−3y=12y2−3y=3y(4y−1)=0⇒y=0ory=41.
Then x=2y gives the critical points (0,0) and (21,41).
(b) Step 2 — the Hessian, kept symbolic.fxx=6x,fxy=−3,fyy=6:
H=[6x−3−36],D=fxxfyy−fxy2=36x−9.
Step 3 — the verdicts. At (0,0): D=−9<0 ⇒ saddle (no need to look at fxx). At (21,41): D=36⋅21−9=9>0 and fxx=3>0 ⇒ local minimum.
(c) Step 4 — the value.f(21,41)=81−3⋅21⋅41+3⋅161=162−166+163=−161.
Step 5 — the eigenvalue route. At the minimum H=[3−3−36] has trace 9 and determinant 18−9=9, so its eigenvalues solve λ2−9λ+9=0:
λ=29±81−36=29±45=29±6.708=7.854,1.146,
both positive ⇒ positive-definite ⇒ a bowl. At the origin H=[0−3−36] has determinant −9, so λ=3±18=7.243,−1.243: opposite signs ⇒ indefinite ⇒ saddle. For a symmetric 2×2 matrix detH=λ1λ2, which is exactly why D<0 forces a saddle.
(a) (0,0) and (21,41). (b) (0,0): D=−9, saddle; (21,41): D=9,fxx=3, local minimum. (c) fmin=−161; eigenvalues there (9±45)/2≈7.854,1.146.
Remember
Ask D's sign first, then fxx's — a saddle needs no second question. The mark most often lost here: evaluating H once and reusing it, when fxx=6x changes from point to point. And fxx=0 at the origin does not make it "neither"; D=−9 already says saddle.
Problem 7medium
A model is trained by minimising the quadratic loss f(x,y)=2x2+2xy+3y2−4x−2y. (a) Find the unique critical point. (b) Show in two ways — Sylvester's criterion and the eigenvalues — that the Hessian is positive-definite, and conclude the point is the global minimum. (c) State the minimum value.
What this tests. That "positive-definite Hessian" can be certified by leading minors or by eigenvalue signs, and that for a quadratic a constant positive-definite Hessian makes the local minimum global. Plan. Solve the linear gradient system; write the constant H; check Δ1=fxx and Δ2=detH; get the eigenvalues from trace and determinant; evaluate f at the point, and if time allows complete the square to prove the minimum is global.
Show the full solution
(a) Step 1 — the critical point.∇f=(4x+2y−4,2x+6y−2)=0, i.e. 2x+y=2 and x+3y=1. From the first, y=2−2x; substitute:
x+3(2−2x)=1⇒−5x=−5⇒x=1,y=0.
The critical point is (1,0).
(b) Step 2 — Sylvester. Because f is quadratic the Hessian is the same everywhere:
H=[4226],Δ1=4>0,Δ2=detH=24−4=20>0.
Both leading principal minors are positive ⇒ H is positive-definite.
Step 3 — eigenvalues. Trace 10, determinant 20:
λ=210±100−80=5±5=7.236,2.764,
both positive ⇒ positive-definite again. Since H≻0 at every point, f is strictly convex: it has exactly one stationary point and that point is the global minimum.
(c) Step 4 — the value.f(1,0)=2−4=−2.
Step 5 — completing the square proves "global" by hand. Shift to the critical point with x=1+u,y=v:
f=2(1+u)2+2(1+u)v+3v2−4(1+u)−2v=−2+(2u2+2uv+3v2)=−2+2(u+2v)2+25v2≥−2,
with equality only at u=v=0. One manoeuvre certifies definiteness and pins the value.
Step 6 — how elongated is the bowl? The condition number λmax/λmin=7.236/2.764=2.618 (exactly (3+5)/2). The contours are ellipses whose axes are in the ratio 2.618≈1.62: steepest along the λ≈7.24 eigenvector, gentlest along the λ≈2.76 one. The larger this ratio, the more gradient descent zig-zags before it settles.
(a) (1,0). (b) H=[4226]: minors 4>0,20>0; eigenvalues 5±5≈7.236,2.764; H≻0 everywhere ⇒ global minimum. (c) fmin=−2; condition number ≈2.618.
Remember
Sylvester uses the leading minors: the top-left 1×1 entry and then the full determinant. Checking fyy>0 instead of fxx>0 is not the criterion (it happens to agree here). For a quadratic, H is constant, so positive-definite once means convex everywhere — and "local" upgrades to "global" for free.
Problem 8medium
Consider g(x,y)=x4+y4 and h(x,y)=x4−y4. (a) Show that for both, the origin is a critical point and the Hessian there is the zero matrix, so the second-derivative test is inconclusive. (b) Determine the true nature of the origin for each by a direct argument. (c) In one line, say why the Hessian could not tell them apart.
What this tests. What D=0 actually means — "no verdict", not "flat" — and how to classify a point when the quadratic clone is silent. Plan. Compute gradient and Hessian at the origin for both; when the test is silent, argue directly from the sign of the function (a global inequality, or two directions with opposite signs); the ray slice (tcosθ,tsinθ) is the systematic version of that.
Show the full solution
(a) Step 1 — gradients and Hessians.∇g∇h=(4x3,4y3),=(4x3,−4y3),HgHh=[12x20012y2],=[12x200−12y2].
At the origin both gradients vanish (critical point) and both Hessians are the zero matrix, so D=detH=0 for each: the test says nothing.
(b) Step 2 — g by a global inequality.g(x,y)=x4+y4≥0 for every (x,y), with equality only at the origin ⇒ a strict local (indeed global) minimum.
Step 3 — h by two directions. Along the x-axis, h(t,0)=t4>0; along the y-axis, h(0,t)=−t4<0. A point that is a minimum in one direction and a maximum in another is a saddle.
Step 4 — the ray slice does both at once. Put (x,y)=t(cosθ,sinθ):
gh=t4(cos4θ+sin4θ)=t4(1−21sin22θ)≥21t4>0,=t4(cos4θ−sin4θ)=t4cos2θ,
using cos4+sin4=(cos2+sin2)2−2sin2cos2 and cos4−sin4=(cos2−sin2)(cos2+sin2). Every ray of g climbs; the rays of h climb for ∣θ∣<45∘ and fall for 45∘<θ<135∘. A sign that changes with direction is the signature of a saddle.
(c) Step 5 — why the Hessian was blind. The Hessian records second-order behaviour only; here the first non-zero behaviour is fourth order, and the quadratic clone of both functions is the same flat plane z=0.
(a) Both have ∇=0 and H=0 at the origin, so D=0. (b) g≥0 ⇒ minimum; h=t4 along x and −t4 along y ⇒ saddle (ray slice: g=t4(1−21sin22θ), h=t4cos2θ). (c) The difference is quartic; a second-order test cannot see it.
Remember
D=0 is a refusal to judge, not a verdict of "flat" or "neither". Writing "inconclusive" and stopping loses the marks: the question asks for the true nature, which needs a direct argument — an inequality, two opposite directions, or a ray slice.
Problem 9easy
Find the local extreme values of f(x,y)=xy−x2−y2−2x−2y+4.
What this tests. The three-step routine on a function whose Hessian is constant: critical point, D, verdict, value. Plan. Solve the two linear gradient equations by substitution; write the three second partials (they are numbers here); compute D and then look at fxx; substitute back to get the value, and cross-check with the eigenvalues.
Show the full solution
Step 1 — critical points.fx=y−2x−2=0 and fy=x−2y−2=0. From the first, y=2x+2; into the second:
x−2(2x+2)−2=0y⇒−3x−6=0⇒x=−2,=2(−2)+2=−2.
The only critical point is (−2,−2).
Step 2 — second partials and D.fxx=−2,fyy=−2,fxy=1, constants:
D=fxxfyy−fxy2=(−2)(−2)−12=4−1=3>0.
Step 3 — verdict and value.D>0 and fxx=−2<0 ⇒ local maximum. Its value:
f(−2,−2)=4−4−4+4+4+4=8.
Step 4 — cross-check by eigenvalues.H=[−211−2] has trace −4 and determinant 3, so λ2+4λ+3=0 gives λ=−1,−3: both negative ⇒ negative-definite ⇒ a dome. Because H is constant, f is concave everywhere and 8 is in fact the global maximum.
One critical point (−2,−2); D=3>0, fxx=−2<0: a local (indeed global) maximum with f(−2,−2)=8.
Remember
A maximum needs bothD>0 and fxx<0; a negative fxx with D<0 is a saddle, not a maximum. The marks that go missing here are almost always a sign slip in the two-line linear system — substitute your point back into both gradient equations before moving on.
Problem 10medium
Find the local extreme values of f(x,y)=x3+y3−3xy+1.
What this tests. A nonlinear gradient system with a real-root argument, and a Hessian that must be re-evaluated at each point. Plan. Turn each gradient equation into a substitution, reduce to one polynomial equation, keep only the real roots; evaluate fxx,fyy,fxy separately at each point; give both the verdict and the value, and say whether the minimum is global.
Show the full solution
Step 1 — critical points.fx=3x2−3y=0⇒y=x2,fy=3y2−3x=0⇒x=y2.
Substituting y=x2 into the second: x=x4, so x(x3−1)=0. The real roots are x=0 and x=1 (the other two roots of x3=1 are complex). Hence the critical points are (0,0) and (1,1).
Step 2 — the Hessian entries.fxx=6x,fyy=6y,fxy=−3 — the diagonal changes from point to point, the off-diagonal does not.
Step 3 — at (0,0).fxx=0,fyy=0,fxy=−3:
D=0⋅0−(−3)2=−9<0⇒saddle,f(0,0)=1.
Step 4 — at (1,1).fxx=6,fyy=6,fxy=−3:
D=6⋅6−(−3)2=36−9=27>0,fxx=6>0⇒local minimum,f(1,1)=1+1−3+1=0.
Step 5 — eigenvalue check, and local versus global. At (1,1), H=[6−3−36] has eigenvalues 6±3=9,3 (both positive: bowl); at (0,0), H=[0−3−30] has eigenvalues ±3 (saddle). The minimum value 0 is local only: f(−2,0)=−8+1=−7, and a cubic runs to −∞ — the test describes a neighbourhood, nothing more.
fxx=fyy=0 at the origin does not make D=0: the cross term fxy=−3 gives D=−9 and a clear saddle. And for cubics, local is not global — say so when you report a minimum.
Problem 11hard
Find the absolute maximum and minimum of f(x,y)=x2+y2−x−y on the region D={(x,y):x2≤y≤1}.
What this tests. Absolute extrema on a closed, bounded region: interior critical points and every piece of the boundary and the corners, then a comparison. Plan. Draw the region first; collect the interior critical points that lie inside it; reduce each boundary curve to a one-variable function and find its critical points; add the corners; make one list of values and pick the largest and smallest — the second-derivative test is not needed for any of this.
Show the full solution
Step 1 — draw the region in words.D is the set of points above the parabola y=x2 and below the line y=1: a parabolic bowl with a flat lid, meeting at the corners (−1,1) and (1,1). It is closed and bounded, so an absolute maximum and minimum exist, and each lives either at an interior critical point or somewhere on the boundary. The second-derivative test can only classify flat points in the open interior; on the boundary the gradient need not vanish at all, so the boundary must be searched separately.
Step 2 — interior critical points.fx=2x−1=0 and fy=2y−1=0 give (21,21). Is it inside D? (21)2=41≤21≤1, yes. Its value:
f(21,21)=41+41−21−21=−21.
(Here H=2I, a bowl, so this is a local minimum — but that says nothing about the boundary.)
Step 3 — the parabola arc y=x2, −1≤x≤1. Substitute:
g(x)g′(x)=f(x,x2)=x2+x4−x−x2=x4−x,=4x3−1=0⇒x=(41)1/3=0.62996.
Then y=x2=0.39685, and since 4x3=1 we have x4=x/4, so g=4x−x=−43x=−0.47247. The arc's endpoints are the corners:
f(−1,1)=1+1+1−1=2,f(1,1)=1+1−1−1=0.
Step 4 — the lid y=1, −1≤x≤1.h(x)=f(x,1)=x2+1−x−1=x2−x, with h′(x)=2x−1=0 at x=21:
f(21,1)=41+1−21−1=−41.
Its endpoints are the same two corners, already counted.
Step 5 — compare. The candidate values are {−21,−0.47247,2,0,−41}. The absolute maximum is 2 at the corner (−1,1); the absolute minimum is −21 at the interior point (21,21).
Step 6 — a geometric cross-check. Completing squares, f=(x−21)2+(y−21)2−21: f is the squared distance from (21,21), minus 21. The minimum is at that centre, which lies in D; the maximum is at the point of D farthest from it — the corner (−1,1), at squared distance 1.52+0.52=2.5, giving 2.5−0.5=2. ✓ The arc point (0.63,0.40) is merely the foot of the perpendicular from the centre to the parabola — the closest point of the arc, never a contender for either extreme. Note ∇f(−1,1)=(−3,1)=0: the maximum sits where the gradient does not vanish, which is exactly why the boundary must be checked by hand.
Interior: f(21,21)=−21. Parabola: f(0.62996,0.39685)=−0.47247, corners f(−1,1)=2, f(1,1)=0. Lid: f(21,1)=−41. Absolute maximum 2 at (−1,1); absolute minimum −21 at (21,21).
Remember
On a closed, bounded region keep three lists — interior critical points, each boundary piece reduced to one variable, and the corners — and only then compare. The marks vanish when the corners are skipped (that is where the maximum lives here) or when the arc's −0.47 is reported as the minimum without checking it against −21.
Problem 12hardadded — covers the judge's identity
The judge's identity, proved and used. Let Q(h,k)=h2fxx+2hkfxy+k2fyy with the partials taken at a critical point, and D=fxxfyy−fxy2. (a) Prove that fxxQ=(hfxx+kfxy)2+Dk2 by expanding the right-hand side. (b) Deduce the three verdicts: D>0,fxx>0 ⇒ Q>0 for all (h,k)=0; D>0,fxx<0 ⇒ Q<0; D<0 ⇒ Q takes both signs. (c) For a symmetric H=[abbc], show λ1λ2=ac−b2=D and λ1+λ2=a+c; hence D<0 exactly when the eigenvalues have opposite signs, and D>0 with a>0 forces c>0 and both eigenvalues positive. (d) Apply (c) to H=[3−3−36].
What this tests. The one identity behind the whole second-derivative test, and why the discriminant D and the eigenvalue signs are the same criterion in two languages. Plan. Expand, cancel, factor; for each verdict start from the sign of the right-hand side and divide by fxx with the correct flip; for the saddle, exhibit two explicit directions; for (c) write the characteristic polynomial and read off sum and product of roots; finish with the numbers.
Show the full solution
(a) Step 1 — expand the right-hand side.(hfxx+kfxy)2Dk2=h2fxx2+2hkfxxfxy+k2fxy2,=fxxfyyk2−fxy2k2.
Adding, the two k2fxy2 terms cancel and what is left has a common factor fxx:
h2fxx2+2hkfxxfxy+k2fxxfyy=fxx(h2fxx+2hkfxy+k2fyy)=fxxQ.■
The identity is nothing more than completing the square in h, with everything multiplied by fxx so that no fractions appear.
(b) Step 2 — verdict 1: D>0 and fxx>0. The right-hand side is a square plus Dk2, so it is ≥0. It can be 0 only if k=0andhfxx+kfxy=0, i.e. hfxx=0, i.e. h=0. So for (h,k)=0 we have fxxQ>0, and dividing by fxx>0 gives Q>0: uphill in every direction — a bowl, a local minimum.
Step 3 — verdict 2: D>0 and fxx<0. The same right-hand side is still strictly positive for (h,k)=0 — its sign never depended on the sign of fxx. Dividing by fxx<0 flips the inequality: Q<0 in every direction — a dome, a local maximum. (Note that D>0 forces fxx=0, since fxxfyy>fxy2≥0, so the division is always legal in verdicts 1 and 2.)
Step 4 — verdict 3: D<0. Test two explicit directions. Along (h,k)=(1,0):
Q(1,0)=fxx.
Along (h,k)=(−fxy,fxx):
Q(−fxy,fxx)=fxy2fxx−2fxyfxxfxy+fxx2fyy=fxx(fxxfyy−fxy2)=fxxD,
so fxx⋅Q(−fxy,fxx)=fxx2D<0 whenever fxx=0: the two values Q(1,0)=fxx and Q(−fxy,fxx)=fxxD have opposite signs — up one way, down another, a saddle. If fxx=0, then D=−fxy2<0 means fxy=0, and along (h,k)=(1,t):
Q(1,t)=2tfxy+t2fyy=t(2fxy+tfyy),
which for small t has the sign of tfxy — opposite signs at t=±ε. (When fyy=0 one can instead swap the roles of x and y and run the identity with fyy.) Either way Q changes sign: saddle.
(c) Step 5 — eigenvalues of a symmetric 2×2.det(H−λI)=(a−λ)(c−λ)−b2=λ2−(a+c)λ+(ac−b2).
For a monic quadratic with roots λ1,λ2, the sum of the roots is the negated middle coefficient and the product is the constant term:
λ1+λ2=a+c=trH,λ1λ2=ac−b2=detH=D.
(The roots are real because the discriminant (a+c)2−4(ac−b2)=(a−c)2+4b2≥0.) Hence D<0⟺λ1λ2<0⟺ the eigenvalues have opposite signs. And if D>0 with a>0: ac>b2≥0 with a>0 forces c>0, so the sum a+c>0 and the product D>0 — two real numbers with positive sum and positive product are both positive. (By the same token a<0 forces c<0 and both eigenvalues negative.) This is why "D and fxx" and "eigenvalue signs" are one criterion in two languages.
(d) Step 6 — the numbers.H=[3−3−36]: trace 9, determinant 18−9=9=D. So λ2−9λ+9=0:
λ=29±81−36=29±45=7.854,1.146.
Check: sum 9, product 9. ✓ Both positive ⇒ positive-definite ⇒ a bowl — this is the Hessian of Problem 6 at its minimum (21,41). Sylvester says the same in one line (3>0,9>0), and the identity of part (a) shows it explicitly: 3Q=(3h−3k)2+9k2>0 for (h,k)=0.
(a) Expanding gives fxx(h2fxx+2hkfxy+k2fyy)=fxxQ. (b) D>0: the right side is positive for (h,k)=0, so Q has the sign of fxx; D<0: Q(1,0)=fxx and Q(−fxy,fxx)=fxxD have opposite signs (or Q(1,±ε) when fxx=0). (c) λ1λ2=D, λ1+λ2=a+c. (d) λ=(9±45)/2≈7.854,1.146, both positive: bowl.
Remember
The whole test is one line of completed square: fxxQ=(hfxx+kfxy)2+Dk2. Read it as "a square plus D times a square" and the three verdicts follow, and D=detH=λ1λ2 is why the discriminant's sign is the eigenvalue story in disguise. Marks are lost by forgetting the fxx=0 case in the saddle argument, or by claiming D>0 alone gives a minimum.
Next up
Unit 9 · Gradient Descent— coming soon
You now know what a landscape looks like near a flat point and how to tell a bowl from a saddle. Unit 9 starts walking: step sizes, why the mean value theorem guarantees a descent step, how the Hessian's eigenvalues set the speed limit, and what happens in the fog of a million dimensions.