← Module 05 / Calculus & optimization

Lesson 05.4 · §4.4

How does curvature change a step?

Use the Hessian to measure directional curvature and compare gradient and Newton steps.

In this lesson 5 ideas
  1. Equal slopes can hide different curvature
  2. Slice in a direction
  3. Why Newton’s method uses a Hessian
  4. Transfer
  5. Explore the relationship

Source scope: §4.4, PDF pages 28. Numerical examples, experiments, added derivations, and practice are teaching supplements unless identified as source results.

Equal slopes can hide different curvature

For f(x,y)=x2+2y2f(x,y)=x^2+2y^2, the coordinate slopes are (2x,4y)(2x,4y). Those slopes change twice as fast in the yy direction. The gradient records slope at a point; its derivative records how that slope changes.

For f:Rd→Rf:\mathbb R^d\to\mathbb R, the Hessian is the d×dd\times d matrix

∇2f(x)=[∂2f/∂x12⋯∂2f/(∂x1∂xd)⋮⋱⋮∂2f/(∂xd∂x1)⋯∂2f/∂xd2],[∇2f]ij=∂2f∂xi∂xj.\nabla^2 f(x)=\begin{bmatrix} \partial^2 f/\partial x_1^2&\cdots&\partial^2 f/(\partial x_1\partial x_d)\\ \vdots&\ddots&\vdots\\ \partial^2 f/(\partial x_d\partial x_1)&\cdots&\partial^2 f/\partial x_d^2 \end{bmatrix},\qquad [\nabla^2f]_{ij}=\frac{\partial^2 f}{\partial x_i\partial x_j}.

When the second partial derivatives are continuous in a neighborhood, mixed partial derivatives commute (Clairaut’s theorem), so the Hessian is symmetric. Differentiability alone does not guarantee this condition. The source expects this regularity in its working examples.

Slice in a direction

Teaching supplement. The restriction ϕ(t)=f(x+tv)\phi(t)=f(x+tv) has ϕ′′(0)=vT∇2f(x)v\phi''(0)=v^T\nabla^2 f(x)v. For our bowl, H=diag⁡(2,4)H=\operatorname{diag}(2,4). A unit direction v=(cos⁡θ,sin⁡θ)v=(\cos\theta,\sin\theta) has curvature 2cos⁡2θ+4sin⁡2θ2\cos^2\theta+4\sin^2\theta. The value lies between two and four, matching the Rayleigh bounds from Module 3. For the saddle x2−y2x^2-y^2, changing the slice direction can change the sign of curvature.

Why Newton’s method uses a Hessian

The source notes that forming the Hessian can be expensive but may reduce the iterations needed to find a local minimum. Teaching derivation: a local quadratic model is

f(x)+∇f(x)Th+12hTHh.f(x)+\nabla f(x)^Th+\tfrac12 h^THh.

Its stationary step solves Hh=−∇f(x)Hh=-\nabla f(x), the Newton step when HH is invertible. For our quadratic bowl this gives h=(−x,−y)h=(-x,-y) and reaches zero in one step. Gradient descent instead uses h=−α(2x,4y)h=-\alpha(2x,4y), one shared step size for unequal curvatures.

A dense Hessian has d2d^2 entries and solving its linear system costs additional work. If HH is singular, this inverse-based step is undefined. If HH is indefinite, a Newton stationary step need not descend. The one-step result above is specific to an exact positive definite quadratic, not a guarantee for arbitrary functions.

Transfer

For f(x,y)=xyf(x,y)=xy, H=[0110]H=\begin{bmatrix}0&1\\1&0\end{bmatrix}. The coordinate slices have zero second derivative, but directions (1,1)/2(1,1)/\sqrt2 and (1,−1)/2(1,-1)/\sqrt2 have curvature 11 and −1-1. Diagonal entries alone cannot characterize all curvature.

Explore the relationship

Explore it yourself

Cut the surface in a direction

Can the second derivative become negative when the slicing direction changes?

Preparing interactive controls…

selected slicexyf / 40

Wireframes sample −1.5 ≤ x,y ≤ 1.5; the vertical axis is f / 4. Rotating the camera changes only the view.

tf(tv)0-3-2-11234

v = (0.866, 0.5); vᵀHv = 2.5; f(tv) = 1.25t².

At (1, 1): gradient step (α = 0.15) = (-0.3, -0.6); Newton step = (-1, -1). Newton endpoint = (0, 0).

The bowl has positive curvature in every direction. Its exact Newton step reaches its minimum. The slice graph uses true objective values and is clipped at the frame.