Hexa Scholar

Multivariable Taylor expansion: what the Hessian adds

A cream landscape tile and a separate curved gold patch on a wooden table.
A curved patch beside a landscape: a metaphor for building a local model of a surface.

The question

Can you tune 3 Hessian entries to match a surface near one point?

Keep the height and tilt fixed. Adjust the bending.

  1. 1 SeeFit three Hessian entries.
  2. 2 TryPredict, then test the local error.
  3. 3 ProveReduce a surface to a slice.
  4. 4 ApplyEstimate changes and bound the remainder.
Before you start · 3 quick checks on a partial derivative, a Taylor coefficient, and a path

Two ideas before you start

2 ideas

A displacement starts at the center

The slice z = x² and its tangent at the selected center.

Changing the center changes the local model. The step is measured from that center, not from the origin.

Exact definition

Write the center as \(p=(a,b)\) and the displacement as \(h=(u,v)\). The destination is \(p+h=(a+u,b+v)\), and the step length is \(\|h\|=\sqrt{u^2+v^2}\). The gradient \(\nabla f(p)=(f_x(p),f_y(p))\) collects the first partial derivatives. Its dot product with the step is \(f_x(p)u+f_y(p)v\).

The tangent-plane model is \(T_1(p+h)=f(p)+\nabla f(p)\cdot h\). Like the tangent line in Taylor polynomials, it matches the value and first derivatives at the center. It need not match a nearby value exactly.

The Hessian keeps track of bending

Two coordinate slices of z = 3x² + y².

A surface can bend differently in different directions. Coordinate slices show the diagonal entries; changing one slope across the other coordinate gives the mixed entry.

Exact definition

Assume \(f\in C^2\) on an open neighborhood of \(p\): all partial derivatives through order two exist and are continuous there. The Hessian is the matrix

\[H(p)=\begin{pmatrix}f_{xx}(p)&f_{xy}(p)\\f_{yx}(p)&f_{yy}(p)\end{pmatrix}.\]

Continuous second partials imply \(f_{xy}=f_{yx}\), so only three entries are independent in two variables. Matrix multiplication gives

\[h^{\mathsf T}Hh=f_{xx}u^2+2f_{xy}uv+f_{yy}v^2.\]

The entries here are evaluated at the center. The symbol \(\mathsf T\) means transpose: it turns the column vector into a row. This expression is called a quadratic form. No eigenvalue calculation is needed for this lesson.

Fine print: a local polynomial, not a global fit

Coordinates must stay in the domain of the function. Choose a small open disk around the center so each segment to a nearby point stays in that domain. Taylor coefficients come from derivatives at one point. They do not minimize every possible average error over a large region. In the fitting game the target is exactly quadratic, so matching its derivatives also matches its whole surface. General smooth surfaces leave a remainder.

The lesson on critical points uses Hessian signs to classify stationary points. Here the center may have a nonzero gradient. The task is to estimate a value, not to find or classify an extremum.

1 See

Fit the quadratic patch

Solid mesh: target surface. Dashed mesh: your adjustable quadratic. Both use the same projection and height scale. The cross marks the center.
What the score measures

The root mean square error, or RMSE, is the square root of the average squared vertical error. This game samples a square centered at the origin, using coordinates −0.5, −0.25, 0, 0.25, and 0.5 on each axis. It scores all 25 pairs. The control step is one integer, from −6 to 6. A rounded score is a measurement on this grid, not a guarantee between samples.

There is a special reason an exact zero score settles this game: both surfaces are quadratic with the same constant and linear terms. Matching on the coordinate axes fixes the two pure quadratic coefficients; matching a point off those axes then fixes the mixed coefficient. Thus matching these samples forces the entire quadratic difference to vanish. This argument would fail for an arbitrary nonquadratic target.

2 Try

How does the error change?

Now use a nonquadratic surface, \(f(x,y)=e^{x+2y}\), centered at the origin. Its model is \(T_2(x,y)=1+(x+2y)+(x+2y)^2/2\). A step \(h=(r,r)\) changes both coordinates together.

3 Prove

Turn the surface into a one-variable path

Second-order Taylor formula

Let f be C² on an open neighborhood of p. For h sufficiently small that the segment p + th, 0 ≤ t ≤ 1, stays there,

\[\begin{aligned} f(p+h)&=f(p)+\nabla f(p)\cdot h\\&\quad+\tfrac12h^{\mathsf T}H(p)h+R(h),\\\frac{R(h)}{\|h\|^2}&\longrightarrow0\quad(h\to0,\ h\ne0).\end{aligned}\]

The limit holds from all directions. It says the error is small compared with squared distance. It does not say that the error vanishes at every nearby point, or that it always has a cubic bound.

General derivation and the uniform remainder

Define \(g(t)=f(p+th)\) on the segment. The multivariable chain rule, applied twice, gives \(g'(t)=\nabla f(p+th)\cdot h\) and \(g''(t)=h^{\mathsf T}H(p+th)h\). The direction vector is constant, so it has no derivative terms of its own.

Integration by parts gives \(g(1)=g(0)+g'(0)+\int_0^1(1-t)g''(t)\,dt\). Subtract the constant Hessian contribution to obtain

\[\begin{aligned}R(h)=\int_0^1 &(1-t)\,h^{\mathsf T}\\&\cdot[H(p+th)-H(p)]h\,dt.\end{aligned}\]

Define \(\omega(\rho)\) to be the supremum of the operator norm of \(H(z)-H(p)\) for \(\|z-p\|\le\rho\), inside a closed disk contained in the neighborhood. The operator norm is the largest stretch of a unit vector. It gives \(|h^{\mathsf T}Ah|\le\|A\|\|h\|^2\). Continuity makes \(\omega(\rho)\to0\). Therefore

\[|R(h)|\le\tfrac12\omega(\|h\|)\|h\|^2.\]

This one bound works for every direction, which is stronger than checking the limit along a few selected lines. The zero step satisfies the expansion directly with zero remainder.

Build a concrete instance. Take \(f(x,y)=e^{x+2y}\), p at the origin, and \(h=(u,v)\). Put \(s=u+2v\) and assume \(0\lt s\lt1\). Thus \(g(t)=e^{ts}\). These conditions apply to every option below.

When a cubic bound is justified

If f has continuous third derivatives near the segment, the one-variable remainder applied to g gives \(R(h)=D^3f(p+\theta h)[h,h,h]/6\) for some \(0\lt\theta\lt1\). Here D³f is the third derivative applied to three vectors. If its size on unit vectors is at most M throughout the neighborhood, then \(|R(h)|\le M\|h\|^3/6\). Without such extra control, keep the C² statement above.

4 Apply

Compute the step before the estimate

Each problem has hints and a worked solution. Enter one number. Answers within the displayed absolute tolerance are accepted. This checks numerical arithmetic; it does not change an exact symbolic identity into an approximate one.

Key point Find the displacement, evaluate derivatives at the center, and include the mixed product with its sign. Use a remainder estimate before treating a local approximation as accurate enough for a specified purpose.
Level Intro multivariable calculusPrerequisites Taylor polynomials and multivariable chain ruleTime About half an hour

Further reading