Type a command or search the notes. Tab cycles completions. Up and down recall history when blank. Escape dismisses, then leaves the prompt.
MATH
[1251]

Taylor's theorem

Express the exact error of a Taylor polynomial and turn it into an error bound.

This page gives an exact formula for the error of a Taylor polynomial PnP_n, called the remainder Rn+1R_{n+1}:

f(x)=Pn(x)+Rn+1(x).f(x)=P_n(x)+R_{n+1}(x).

Bounding the remainder turns an approximation into a guaranteed one and its leading term classifies stationary points.

The remainder measures what the polynomial misses

[DEFINITION]

Taylor polynomial

If ff has derivatives through order nn at aa, its Taylor polynomial of degree at most nn about aa is

Pn(x)=∑k=0nf(k)(a)k!(x−a)k.P_n(x)=\sum_{k=0}^{n}\frac{f^{(k)}(a)}{k!}(x-a)^k.
[THEOREM]

Taylor's theorem with remainder

Suppose ff has n+1n+1 continuous derivatives on an interval containing aa and xx. If

Pn(x)=∑k=0nf(k)(a)k!(x−a)k,P_n(x)=\sum_{k=0}^{n}\frac{f^{(k)}(a)}{k!}(x-a)^k,

then

f(x)=Pn(x)+Rn+1(x),f(x)=P_n(x)+R_{n+1}(x),

where the integral remainder is

Rn+1(x)=1n!∫axf(n+1)(t)(x−t)n dt.R_{n+1}(x) =\frac1{n!}\int_a^x f^{(n+1)}(t)(x-t)^n\,dt.

For x≠ax\ne a, there is also a point cc between aa and xx for which the Lagrange remainder is

Rn+1(x)=f(n+1)(c)(n+1)!(x−a)n+1.R_{n+1}(x) =\frac{f^{(n+1)}(c)}{(n+1)!}(x-a)^{n+1}.

The integral form accumulates the first omitted derivative. The Lagrange form replaces the integral by one unknown derivative value. If

∣f(n+1)(t)∣≤M|f^{(n+1)}(t)|\le M

throughout the interval between aa and xx, then

∣f(x)−Pn(x)∣=∣Rn+1(x)∣≤M∣x−a∣n+1(n+1)!.|f(x)-P_n(x)| =|R_{n+1}(x)| \le \frac{M|x-a|^{n+1}}{(n+1)!}.

The bound depends on the distance ∣x−a∣|x-a| from the centre and the size of the first omitted derivative. The factorial often dominates the numerator for large nn, but this must be checked for the interval and degree in use.

[PROOF]

We prove the integral formula by induction. When n=0n=0, the Fundamental Theorem of Calculus gives

R1(x)=∫axf′(t) dt=f(x)−f(a).R_1(x)=\int_a^x f'(t)\,dt=f(x)-f(a).

Assume that

Rk(x)=1(k−1)!∫axf(k)(t)(x−t)k−1 dt.R_k(x) =\frac1{(k-1)!}\int_a^x f^{(k)}(t)(x-t)^{k-1}\,dt.

For the next remainder, take u=(x−t)ku=(x-t)^k and dv=f(k+1)(t) dtdv=f^{(k+1)}(t)\,dt, so du=−k(x−t)k−1 dtdu=-k(x-t)^{k-1}\,dt and v=f(k)(t)v=f^{(k)}(t). We obtain

Rk+1(x)=1k!∫axf(k+1)(t)(x−t)k dt=[f(k)(t)k!(x−t)k]t=at=x+1(k−1)!∫axf(k)(t)(x−t)k−1 dt=−f(k)(a)k!(x−a)k+Rk(x)=f(x)−Pk−1(x)−f(k)(a)k!(x−a)k=f(x)−Pk(x),\begin{aligned} R_{k+1}(x) &=\frac1{k!}\int_a^x f^{(k+1)}(t)(x-t)^k\,dt\\ &=\left[\frac{f^{(k)}(t)}{k!}(x-t)^k\right]_{t=a}^{t=x} +\frac1{(k-1)!}\int_a^x f^{(k)}(t)(x-t)^{k-1}\,dt\\ &=-\frac{f^{(k)}(a)}{k!}(x-a)^k+R_k(x)\\ &=f(x)-P_{k-1}(x)-\frac{f^{(k)}(a)}{k!}(x-a)^k\\ &=f(x)-P_k(x), \end{aligned}

The t=xt=x endpoint vanishes because (x−x)k=0(x-x)^k=0 and the penultimate line uses the induction hypothesis Rk(x)=f(x)−Pk−1(x)R_k(x)=f(x)-P_{k-1}(x). Each induction step removes one Taylor term, which proves the integral form for every nn.

To obtain the Lagrange form, apply the mean value theorem for integrals to the continuous function f(n+1)f^{(n+1)} with the non-negative weight ∣x−t∣n|x-t|^n between aa and xx. Accounting for the orientation when x<ax<a gives ∫axf(n+1)(t)(x−t)n dt=f(n+1)(c)(x−a)n+1/(n+1)\int_a^x f^{(n+1)}(t)(x-t)^n\,dt =f^{(n+1)}(c)(x-a)^{n+1}/(n+1) for some intermediate cc.

Taylor's theorem extends the Mean Value Theorem

When n=0n=0, Taylor's theorem reads

f(x)=f(a)+f′(c)(x−a).f(x)=f(a)+f'(c)(x-a).
[COROLLARY]

The Mean Value Theorem as the first case

For some cc between aa and xx,

f(x)−f(a)x−a=f′(c)\frac{f(x)-f(a)}{x-a}=f'(c)

whenever x≠ax\ne a and the hypotheses of the Mean Value Theorem hold.

Turn the remainder into an error bound

[METHOD]

Bound a Taylor approximation error

To prove that Pn(x)P_n(x) approximates f(x)f(x) within a tolerance ε\varepsilon:

  1. identify f(n+1)f^{(n+1)};
  2. find a bound MM for ∣f(n+1)(t)∣|f^{(n+1)}(t)| between aa and the relevant values of xx;
  3. use ∣f(x)−Pn(x)∣≤M∣x−a∣n+1(n+1)!;|f(x)-P_n(x)| \le \frac{M|x-a|^{n+1}}{(n+1)!};
  4. choose nn or the interval so that the right-hand side is at most ε\varepsilon.

The estimate is uniform on an interval when one MM and one distance bound work throughout that interval. It bounds the error from above; it is not the actual error.

[EXAMPLE]

Approximating exe^x by a quadratic

Take

P2(x)=1+x+x22P_2(x)=1+x+\frac{x^2}{2}

for f(x)=exf(x)=e^x about zero. The third derivative is exe^x. On [−1/2,1/2][-1/2,1/2], an intermediate point satisfies ec≤e1/2e^c\le e^{1/2}, so

∣R3(x)∣≤e1/2∣x∣33!≤e1/248≈0.03435.|R_3(x)| \le \frac{e^{1/2}|x|^3}{3!} \le \frac{e^{1/2}}{48} \approx0.03435.

The bound holds for every xx in the interval.

[EXAMPLE]

Computing ee to within 10−610^{-6}

At x=1x=1, the Maclaurin polynomial gives

Pn(1)=∑k=0n1k!.P_n(1)=\sum_{k=0}^{n}\frac1{k!}.

For 0<c<10<c<1, the Lagrange remainder satisfies ec<3e^c<3, hence

∣Rn+1(1)∣<3(n+1)!.|R_{n+1}(1)|<\frac3{(n+1)!}.

With n=9n=9,

310!<10−6.\frac3{10!}<10^{-6}.

Therefore

e≈P9(1)=∑k=091k!=2.7182815256e\approx P_9(1) =\sum_{k=0}^{9}\frac1{k!} =2.7182815256

with the requested accuracy. The bound guarantees the accuracy; the actual error is about 3.03×10−73.03\times10^{-7}.

[EXAMPLE]

Error for a sine approximation

Every derivative of sin⁡x\sin x is one of ±sin⁡x\pm\sin x or ±cos⁡x\pm\cos x, so its absolute value is at most 11. For a degree-nn Taylor polynomial about aa,

∣Rn+1(x)∣≤∣x−a∣n+1(n+1)!.|R_{n+1}(x)| \le \frac{|x-a|^{n+1}}{(n+1)!}.

Near the expansion centre, the factorial makes the bound decrease rapidly.

The first nonzero term controls local behaviour

At a stationary point the linear term vanishes, so the first nonzero higher derivative decides whether values rise, fall or change sign on each side. The remainder is of strictly higher order, so close to the centre it is too small to reverse that sign.

[THEOREM]

Classify a stationary point with the first nonzero derivative

Suppose kk is an integer with k≥2k\ge2 and ff has k+1k+1 continuous derivatives on a neighbourhood of aa. If

f(j)(a)=0(1≤j<k),f(k)(a)≠0.f^{(j)}(a)=0\quad(1\le j<k), \qquad f^{(k)}(a)\ne0.

then Taylor's theorem gives

f(x)−f(a)=f(k)(a)k!(x−a)k+Rk+1(x),Rk+1(x)=O(∣x−a∣k+1),Rk+1(x)=o(∣x−a∣k).f(x)-f(a) =\frac{f^{(k)}(a)}{k!}(x-a)^k+R_{k+1}(x), \qquad R_{k+1}(x)=O\bigl(|x-a|^{k+1}\bigr),\qquad R_{k+1}(x)=o\bigl(|x-a|^k\bigr).

Thus, locally:

  • if kk is even and f(k)(a)>0f^{(k)}(a)>0, aa is a local minimum;
  • if kk is even and f(k)(a)<0f^{(k)}(a)<0, aa is a local maximum;
  • if kk is odd, the leading term changes sign across aa, giving a horizontal point of inflection.

Here O(∣x−a∣k+1)O(|x-a|^{k+1}) means an error bounded by a constant times ∣x−a∣k+1|x-a|^{k+1} near aa and o(∣x−a∣k)o(|x-a|^k) means an error whose ratio to ∣x−a∣k|x-a|^k tends to zero.

The test requires k≥2k\ge2, a genuinely first nonzero derivative and enough continuity to ensure that the remainder is o(∣x−a∣k)o(|x-a|^k). If all derivatives examined vanish, those terms give no classification.

[PROOF]

Taylor's theorem gives

f(x)−f(a)=f(k)(a)k!(x−a)k+Rk+1(x),f(x)-f(a) =\frac{f^{(k)}(a)}{k!}(x-a)^k+R_{k+1}(x),

because the lower-order terms vanish. Since f(k+1)f^{(k+1)} is continuous near aa, it is bounded on a smaller neighbourhood, so the remainder estimate gives Rk+1(x)=O(∣x−a∣k+1)R_{k+1}(x)=O(|x-a|^{k+1}) and hence Rk+1(x)=o(∣x−a∣k)R_{k+1}(x)=o(|x-a|^k). Therefore the first nonzero term determines the sign of f(x)−f(a)f(x)-f(a) sufficiently close to aa.

When kk is even, (x−a)k(x-a)^k is positive on both sides of aa, so the sign of f(k)(a)f^{(k)}(a) determines a minimum or maximum. When kk is odd, then k≥3k\ge3 and the same expansion applied to f′′f'' gives

f′′(x)=f(k)(a)(k−2)!(x−a)k−2+o(∣x−a∣k−2).f''(x)=\frac{f^{(k)}(a)}{(k-2)!}(x-a)^{k-2}+o\bigl(|x-a|^{k-2}\bigr).

Since k−2k-2 is odd, f′′f'' changes sign across aa; together with f′(a)=0f'(a)=0, this gives a horizontal point of inflection.

[EXAMPLE]

A fifth-order stationary point

Let

f(x)=x7−10x6+40x5−80x4+80x3−32x2−10.f(x)=x^7-10x^6+40x^5-80x^4+80x^3-32x^2-10.

At x=2x=2,

f′(2)=f′′(2)=f(3)(2)=f(4)(2)=0,f(5)(2)=480>0.f'(2)=f''(2)=f^{(3)}(2)=f^{(4)}(2)=0, \qquad f^{(5)}(2)=480>0.

The first nonzero derivative has odd order, so x=2x=2 is a horizontal point of inflection. Since f(2)=−10f(2)=-10, the point is (2,−10)(2,-10).

[PROPOSITION]

Comparing the first nonzero Taylor terms

Suppose m≥1m\ge1, ff and gg are mm times differentiable near aa, f(j)(a)=g(j)(a)=0f^{(j)}(a)=g^{(j)}(a)=0 for 0≤j<m0\le j<m and f(m)(a),g(m)(a)≠0f^{(m)}(a),g^{(m)}(a)\ne0. Then

lim⁡x→af(x)g(x)=f(m)(a)g(m)(a).\lim_{x\to a}\frac{f(x)}{g(x)} =\frac{f^{(m)}(a)}{g^{(m)}(a)}.

The leading expansions are

f(x)=f(m)(a)m!(x−a)m+o((x−a)m),f(x)=\frac{f^{(m)}(a)}{m!}(x-a)^m+o((x-a)^m),

and

g(x)=g(m)(a)m!(x−a)m+o((x−a)m).g(x)=\frac{g^{(m)}(a)}{m!}(x-a)^m+o((x-a)^m).

The common power (x−a)m(x-a)^m cancels in the quotient. This explains why repeated L'Hôpital differentiation can work, but the hypotheses of that rule must still be checked.

From one polynomial to a sequence

For a fixed xx, the Taylor polynomials of degree 0,1,2,…0,1,2,\ldots form a sequence of approximations. Two questions decide its limit: the convergence tests settle whether the series converges and the remainder decides whether the sum is f(x)f(x). The Taylor series page combines the two and power series adds termwise calculus inside the radius.

On this page