Use displacements, not the original coordinates
The purpose of a second-order model is to keep the first change and the leading curvature while separating the approximation from its error. Let a=(a1,a2)∈R2, write h=(u,v), and approximate f(a+h). Every derivative in the polynomial is evaluated at the fixed base point a; the variables are the displacements u=x−a1, v=y−a2. Total degree is what matters: uv has degree two, whereas u2v has degree three.
For sufficiently small h, the whole segment a+th, 0≤t≤1, must stay in the function's domain. A C2 hypothesis in an open neighborhood of a gives a local second-order expansion. A numerical cubic error bound uses additional third-derivative information along the actual segment. These are different conclusions, so the assumptions must be checked separately.
The second-order statement and its assumptions
Definition
Hessian and second-order Taylor polynomial
For a C2 function near a, its Hessian is Hf(a)=(∂i∂jf(a))i,j. Writing the displacement as h, the second-order Taylor polynomial at a is
T2(a+h)=f(a)+∇f(a)⋅h+21hTHf(a)h.In two variables h=(u,v), the quadratic term is 21(fxxu2+2fxyuv+fyyv2) with derivatives evaluated at a.
Theorem
Second-order Taylor expansion
If f is C2 near a, then, as h→0,
f(a+h)=T2(a+h)+o(∥h∥2).If f is C3 on a neighbourhood of the segment, then for some θ∈(0,1) the remainder equals 61ϕ′′′(θ), where ϕ(t)=f(a+th). In particular, if ∣ϕ′′′(t)∣≤K∥h∥3 along the segment, its absolute value is at most K∥h∥3/6.
Why C2 is enough for the local remainder
For a real scalar C2 function on an open neighborhood of a, take a small ball centered at a inside that neighborhood and let h be small enough that its segment stays there. Set ϕ(t)=f(a+th). Twice applying the fundamental theorem of calculus gives
f(a+h)=f(a)+∇f(a)⋅h+∫01(1−t)hTHf(a+th)hdt.
To verify this identity directly, one-variable integration by parts gives
∫01(1−t)ϕ′′(t)dt=[(1−t)ϕ′(t)]01+∫01ϕ′(t)dt=−ϕ′(0)+ϕ(1)−ϕ(0).
The chain rule supplies ϕ′(0)=∇f(a)⋅h and ϕ′′(t)=hTHf(a+th)h. This proves the identity without an interchange of multiple integrals. Subtracting the constant-Hessian part and using ∫01(1−t)dt=1/2 yields
R2(h)=∫01(1−t)hT[Hf(a+th)−Hf(a)]hdt,
∣R2(h)∣≤21∥h∥20≤t≤1sup∥Hf(a+th)−Hf(a)∥op=o(∥h∥2).
The supremum tends to zero by continuity of the Hessian at a: every point of the segment is within ∥h∥ of a. This proof needs no third derivatives. It does not give a fixed cubic constant or an infinite-series representation.
In two variables, symmetry fxy(a)=fyx(a) makes
21hTHf(a)h=21fxx(a)u2+fxy(a)uv+21fyy(a)v2.
There are two equal off-diagonal contributions before multiplying by 1/2. Forgetting either contribution halves the mixed coefficient incorrectly.
Check the derivatives before using the model
For the worked function f(x,y)=exln(1+y), the open domain is y>−1. Differentiation before substitution gives
fx=exln(1+y),fy=1+yex,fxx=exln(1+y),fxy=1+yex,fyy=−(1+y)2ex.
At the origin these give the values used in the worked example below. In particular, the mixed coefficient is one, not one half. Since the function is smooth throughout its open domain, both the C2 local conclusion and a C3 segment estimate are available when their respective domain checks hold.
Worked example and selected practice
Worked example 1: a quadratic model with mixed curvature. For f(x,y)=exln(1+y) around (0,0), require y>−1. At the origin, the values and derivatives are
f(0,0)=0,fx(0,0)=0,fy(0,0)=1,fxx(0,0)=0,fxy(0,0)=1,fyy(0,0)=−1.
Thus the quadratic model is
T2(x,y)=y+xy−21y2.
The constant, pure x, and pure x2 coefficients are zero because f(x,0)=0. At (0.02,0.03), the approximation is 0.03+0.0006−0.00045=0.03015. A guaranteed error needs bounds on the third derivatives over the connecting segment, not merely the fact that both coordinates look small.
Exercises
P01. Find the quadratic Taylor polynomial of f(x,y)=ln(1+x+y) at (0,0), stating a valid neighbourhood domain.
P04. Expand f(x,y)=x2y about (1,2) through second order and identify its exact remaining cubic term.
P07. Suppose f is C3 on an open neighbourhood containing the segment and all its third partial derivatives have absolute value at most two on that segment. Bound the second-order Taylor error for ∣h1∣≤0.01, ∣h2∣≤0.02.
Full solutions
P01. Let u=x+y. The expansion is u−u2/2, so T2=x+y−(x2+2xy+y2)/2. A neighbourhood with ∣x+y∣<1/2 lies in the logarithm's domain 1+x+y>0.
P04. Put x=1+u,y=2+v. Expansion is 2+4u+v+2u2+2uv+u2v. The Taylor polynomial through degree two omits only u2v.
P07. The coefficients come from the third derivative along the segment. Thus
∣R2∣≤3!2(∣h1∣3+3∣h1∣2∣h2∣+3∣h1∣∣h2∣2+∣h2∣3)=31(∣h1∣+∣h2∣)3.
Substituting the given bounds gives (2/6)(0.01+0.02)3=0.000009.
A certified error needs the whole segment
For a real C3 function on an open neighborhood containing [a,a+h], let h=(u,v) and ϕ(t)=f(a+th). Repeated chain differentiation gives
ϕ′′′(t)=fxxxu3+3fxxyu2v+3fxyyuv2+fyyyv3,
with all derivatives evaluated at a+th. The factors three count the positions of the repeated coordinate in the three differentiations; equality of mixed partials uses C3. The required remainder formula can be proved by three applications of Rolle's theorem. Define
R=ϕ(1)−ϕ(0)−ϕ′(0)−21ϕ′′(0),ψ(t)=ϕ(t)−ϕ(0)−ϕ′(0)t−21ϕ′′(0)t2−Rt3.
Then ψ(0)=ψ(1)=ψ′(0)=ψ′′(0)=0. Rolle on [0,1] gives c1∈(0,1) with ψ′(c1)=0. Rolle applied to ψ′ on [0,c1] gives c2∈(0,c1) with ψ′′(c2)=0. Finally Rolle applied to ψ′′ on [0,c2] gives θ∈(0,c2) with ψ′′′(θ)=0. The C3 neighborhood hypothesis supplies all required continuity and differentiability. Since ψ′′′(θ)=ϕ′′′(θ)−6R, this proves R2=R=ϕ′′′(θ)/6. If every third partial has absolute value at most M on the segment, then
∣R2∣≤6M(∣u∣+∣v∣)3.
This is why P07 uses both coordinate bounds and every mixed derivative, rather than bounding just u3+v3.
For the earlier numerical example, h=(0.02,0.03) makes the entire segment satisfy 0≤x≤0.02, 0≤y≤0.03. Its four third partials are
fxxx=exln(1+y),fxxy=1+yex,fxyy=−(1+y)2ex,fyyy=(1+y)32ex.
Because ln(1+y)≤y≤0.03 and 1+y≥1, the common bound M=2e0.02 is valid. Thus the displayed approximation is certified by
∣e0.02ln(1.03)−0.03015∣≤62e0.02(0.05)3=24000e0.02<0.000043.
This bound is conservative. It certifies an interval around the approximation; it does not claim every displayed decimal digit is correct.
How to verify the selected solutions
For P01, differentiation at the origin gives ∇f=(1,1) and Hf=−(1111). Substitution in the Hessian formula produces the coefficient −1 of xy. The open strip ∣x+y∣<1/2 contains the origin and lies in the logarithm domain; a sufficiently small displacement segment is inside it.
For P04, at a=(1,2) the data are f(a)=2, ∇f(a)=(4,1) and Hf(a)=(4220). Hence the quadratic term is 2u2+2uv, agreeing with the exact product (1+u)2(2+v). The omitted u2v obeys ∣u2v∣≤∥h∥3, so it is also o(∥h∥2) without needing an infinite series.
For P07, the binomial sum includes both mixed terms with multiplicity three. Substituting the upper bounds gives 31(0.03)3=9×10−6. The assumption is a bound along the whole segment, not only at its endpoints.