Reading and display settings

Appearance

System follows your operating system and keeps following it, even if you change it later. The header's sun, moon and monitor cycle the same three options.

Text size (%) 100%

Default. Scales every text size on the site, equations and tables included.

Reading width 70ch

How much text runs across one line of prose. Narrower is easier to track; wider fits more on screen.

Line spacing 1.6

The leading on body text. Taller leading helps a tired eye stay on the line.

Density

Padding and gaps around controls, cards, and tables — how much breathing room the layout leaves itself.

Motion

System follows your operating system. Reduced removes every transition on this site. Full keeps them on unless your system asks for less.

1

The local quadratic model

Taylor to second order, on a surface

Single-variable Taylor said a curve looks like a line up close, then a parabola. The same expansion holds for a surface once we replace the derivative by the gradient and the second derivative by the Hessian matrix $H$. Near a point $\mathbf a = (a,b)$ and a displacement $\Delta = (\Delta x, \Delta y)$:

$$ f(\mathbf a + \Delta) \;=\; f(\mathbf a) \;+\; \nabla f(\mathbf a)^{\mathsf T}\Delta \;+\; \tfrac{1}{2}\,\Delta^{\mathsf T} H(\mathbf a)\,\Delta \;+\; O(\|\Delta\|^3). $$

The first two terms are the tangent plane — the same linear model as the gradient. Add the third and the flat plane bows into a paraboloid whose bending is fixed by the four numbers $f_{xx}, f_{xy}, f_{yx}, f_{yy}$. Cut the series after the plane and the error is $O(\|\Delta\|^2)$; keep the quadratic term and it drops to $O(\|\Delta\|^3)$. Below, the surface is plotted with the tangent plane (blue), the quadratic model (red) and the point they agree at. Slide the point and the neighbourhood size $h$.

Drag to orbit. The marker is the expansion point; the blue patch is the tangent plane, the red patch the second-order model. Both are drawn only over the neighbourhood of radius $r \approx 2.6h$.

2

The second-derivative test

Curvature signs decide bowl, dome or saddle

At a critical point the gradient vanishes, so the quadratic model collapses to $\tfrac{1}{2}\Delta^{\mathsf T}H\Delta$. Choose axes along the Hessian's eigenvectors and this is just two independent parabolas:

$$ f(\mathbf a + \Delta) \;\approx\; f(\mathbf a) \;+\; \tfrac{1}{2}\!\left(\lambda_1 u_1^2 + \lambda_2 u_2^2\right), \qquad H = \lambda_1 \mathbf v_1\mathbf v_1^{\mathsf T} + \lambda_2 \mathbf v_2\mathbf v_2^{\mathsf T}. $$

Curving up in both eigen-directions ($\lambda_1, \lambda_2 > 0$) is a minimum; curving down in both ($\lambda_1, \lambda_2 < 0$) is a maximum; opposite signs give a saddle. Since the determinant of a matrix is the product of its eigenvalues,

$$ D \;=\; f_{xx}f_{yy} - f_{xy}^2 \;=\; \lambda_1\lambda_2, $$

so $D>0$ with $f_{xx}>0$ is a minimum, $D>0$ with $f_{xx}<0$ a maximum, $D<0$ a saddle, and $D=0$ (or a zero eigenvalue) is degenerate — the linear terms decide. Drag the point over the contour map: the readout computes $\nabla f$, $H$, its eigenvalues, and the verdict. Faint rings mark the four critical points; find them all. The 3D panel is the same surface the contour is slicing.

Contour map of $f$. Drag the point; the arrow is $\nabla f$ (the uphill direction). When it shrinks to nothing you are at a critical point.

3

Newton's method, in matrix form

The optimizer's quadratic model in action

If a surface is well approximated by its quadratic model, the fastest way down is to jump straight to that model's minimum. Minimising $f + \mathbf g^{\mathsf T}\Delta + \tfrac{1}{2}\Delta^{\mathsf T}H\Delta$ in $\Delta$ gives $\mathbf g + H\Delta = 0$, hence the Newton step

$$ \mathbf p = -\,H(\mathbf x)^{-1}\,\mathbf g, \qquad \mathbf g = \nabla f(\mathbf x), $$

which is $-\mathbf g / f''$ in one dimension. On a quadratic the model is exact and one step lands on the minimum. On our cubic landscape it converges quadratically — each step roughly squares the remaining error — but only if the Hessian is invertible; where it is singular, $H\mathbf x = -\mathbf g$ has no unique solution and the step is undefined. Step or play, and watch $\lvert\nabla f\rvert$ collapse.

The Newton iterates on the contour map. Each step solves $H\mathbf p = -\mathbf g$ exactly and moves.

A quadratic costs one step; a smooth surface costs a handful. That is the whole promise of second-order optimisation.
4

Why eigenvalues govern convergence

Curvature, not slope, sets the pace

Take the barest curved landscape, $f(x,y) = \tfrac{1}{2}(\kappa x^2 + y^2)$ with $\kappa \ge 1$. Its Hessian is diagonal with eigenvalues $\kappa$ and $1$, so the level sets are ellipses with condition number $\kappa = \lambda_{\max}/\lambda_{\min}$. Gradient descent with step $\alpha$ multiplies each eigen-coordinate by $(1-\alpha\lambda)$, so with the best fixed step $\alpha = 2/(\lambda_{\max}+\lambda_{\min})$ the slow direction decays like

$$ \left(\frac{\kappa-1}{\kappa+1}\right)^{k}, $$

which crawls when $\kappa$ is large and the iteration bounces side to side across the valley. Newton's step divides each direction by its own curvature, so it is unmoved by conditioning: on this quadratic it reaches the bottom in exactly one step, and the two paths below show the difference. The full race between gradient descent, momentum and Adam lives in Volume II, Part 10, and the practical systems that exploit it are in Nonlinear Optimization.

Level ellipses of the quadratic. Blue: steepest descent zig-zagging across the valley. Magenta: Newton's single jump.

5

Where this shows up

From a theorem to a solver

Every solver in Nonlinear Optimization is a negotiation with this quadratic model. Gauss–Newton, Levenberg–Marquardt and pose-graph optimisation all build an approximate Hessian, ask the second-derivative test what shape they are sitting in, and then take a step the model predicts will help — raising damping when the saddle-shaped directions make that step untrustworthy. The curvature-and-convergence story continues in Volume II, Part 10, where the same ellipses from Step 4 become the reason momentum and adaptive methods exist. And back at the arm: the squared reach error as a function of the joint angles is a surface exactly like the one above, with a bowl at the target and saddles where extra reach buys nothing.

6

Notation to carry forward

ObjectReads asWhat it decides
∇f(a), gThe gradient, a vector of first partialsWhere the tangent plane tilts; zero at a critical point
H(a)The Hessian, the matrix of second partialsHow the surface bends in every direction
f(a) + gᵀΔTangent plane / linear modelError O(‖Δ‖²); Newton's tangent step
f(a) + gᵀΔ + ½ΔᵀHΔLocal quadratic modelError O(‖Δ‖³); the basis of the test
D = f_xx f_yy − f_xy²Determinant of H = λ₁λ₂Sign sorts min, max and saddle at a critical point
λ₁, λ₂Eigenvalues of HCurvature along the principal directions
p = −H⁻¹gThe Newton stepReaches the model's minimum; undefined if H singular
κ = λ_max / λ_minCondition number of HSets the gradient-descent contraction ((κ−1)/(κ+1))ᵏ
7

Further reading

8

Check your understanding

0/4 answered