Taylor's Formula

Basis
Last updated: Tags: Calculus, Differentiation

The Mean Value Theorem says f(x)=f(x0)+f(c)(xx0)f(x) = f(x_0) + f'(c)(x - x_0) for some unknown cc between xx and x0x_0. This is a linear approximation with an imprecise remainder. Taylor’s Formula pushes the idea to all orders: approximate ff by a degree-nn polynomial and express the leftover error explicitly.

The Taylor polynomial

Definition. The Taylor polynomial of degree nn of ff at x0x_0 is

Pn(x)    k=0nf(k)(x0)k!(xx0)k=f(x0)+f(x0)(xx0)+f(x0)2!(xx0)2++f(n)(x0)n!(xx0)n.P_n(x) \;\coloneqq\; \sum_{k=0}^{n} \frac{f^{(k)}(x_0)}{k!}\,(x - x_0)^k = f(x_0) + f'(x_0)(x-x_0) + \frac{f''(x_0)}{2!}(x-x_0)^2 + \cdots + \frac{f^{(n)}(x_0)}{n!}(x-x_0)^n.

The coefficients f(k)(x0)k!\dfrac{f^{(k)}(x_0)}{k!} are the unique values that make Pn(k)(x0)=f(k)(x0)P_n^{(k)}(x_0) = f^{(k)}(x_0) for k=0,1,,nk = 0, 1, \ldots, n: the polynomial matches ff and all its derivatives up to order nn at x0x_0.

Taylor’s formula with the Lagrange remainder

Theorem (Taylor’s Formula). Let ff be (n+1)(n+1)-times differentiable on an open interval containing x0x_0 and xx. Then

f(x)  =  Pn(x)  +  Rn(x),(1)f(x) \;=\; P_n(x) \;+\; R_n(x), \tag{1}

where the Lagrange remainder is

Rn(x)  =  f(n+1)(ξ)(n+1)!(xx0)n+1(2)R_n(x) \;=\; \frac{f^{(n+1)}(\xi)}{(n+1)!}\,(x - x_0)^{n+1} \tag{2}

for some ξ\xi strictly between x0x_0 and xx.

Proof

Fix xx0x \neq x_0 and let JJ be the closed interval with endpoints x0x_0 and xx. Define

F(t)    f(x)k=0nf(k)(t)k!(xt)k,G(t)    (xt)n+1.F(t) \;\coloneqq\; f(x) - \sum_{k=0}^{n} \frac{f^{(k)}(t)}{k!}(x - t)^k, \qquad G(t) \;\coloneqq\; (x - t)^{n+1}.

Both are continuous on JJ and differentiable on the interior of JJ. Observe:

  • F(x)=0F(x) = 0 and G(x)=0G(x) = 0.
  • F(x0)=f(x)Pn(x)F(x_0) = f(x) - P_n(x) and G(x0)=(xx0)n+10G(x_0) = (x - x_0)^{n+1} \neq 0.

Telescoping derivative of FF. Differentiating using the product rule on each term f(k)(t)k!(xt)k\tfrac{f^{(k)}(t)}{k!}(x-t)^k:

ddt[f(k)(t)k!(xt)k]=f(k+1)(t)k!(xt)k    f(k)(t)(k1)!(xt)k1.\frac{d}{dt}\left[\frac{f^{(k)}(t)}{k!}(x-t)^k\right] = \frac{f^{(k+1)}(t)}{k!}(x-t)^k \;-\; \frac{f^{(k)}(t)}{(k-1)!}(x-t)^{k-1}.

Summing from k=0k = 0 to nn, the sum telescopes — each term f(k)(t)(k1)!(xt)k1\tfrac{f^{(k)}(t)}{(k-1)!}(x-t)^{k-1} cancels with the kk1k \mapsto k-1 instance of the first part — leaving only the k=nk = n term of the first summand:

F(t)  =  f(n+1)(t)n!(xt)n,G(t)  =  (n+1)(xt)n.F'(t) \;=\; -\frac{f^{(n+1)}(t)}{n!}(x - t)^n, \qquad G'(t) \;=\; -(n+1)(x-t)^n.

Applying Rolle’s theorem. Form the auxiliary function

ϕ(t)    F(t)F(x0)G(x0)G(t).\phi(t) \;\coloneqq\; F(t) - \frac{F(x_0)}{G(x_0)}\,G(t).

Then ϕ(x0)=0\phi(x_0) = 0 and ϕ(x)=F(x)F(x0)G(x0)0=0\phi(x) = F(x) - \tfrac{F(x_0)}{G(x_0)} \cdot 0 = 0. By Rolle’s Theorem, there exists ξ\xi strictly between x0x_0 and xx with ϕ(ξ)=0\phi'(\xi) = 0:

F(ξ)F(x0)G(x0)G(ξ)=0.F'(\xi) - \frac{F(x_0)}{G(x_0)}\,G'(\xi) = 0.

Since ξx\xi \neq x we have (xξ)n0(x - \xi)^n \neq 0, so substituting FF' and GG':

f(n+1)(ξ)n!(xξ)n+F(x0)G(x0)(n+1)(xξ)n=0        F(x0)G(x0)=f(n+1)(ξ)(n+1)!.-\frac{f^{(n+1)}(\xi)}{n!}(x-\xi)^n + \frac{F(x_0)}{G(x_0)}(n+1)(x-\xi)^n = 0 \;\;\Longrightarrow\;\; \frac{F(x_0)}{G(x_0)} = \frac{f^{(n+1)}(\xi)}{(n+1)!}.

Multiplying through by G(x0)=(xx0)n+1G(x_0) = (x-x_0)^{n+1} gives F(x0)=Rn(x)F(x_0) = R_n(x) with the form in (2)(2). \square

Standard Maclaurin expansions

When x0=0x_0 = 0 the formula is called a Maclaurin expansion. The following hold for all xRx \in \mathbb{R} (sending nn \to \infty and verifying Rn0R_n \to 0):

ex  =  k=0xkk!  =  1+x+x22!+x33!+e^x \;=\; \sum_{k=0}^{\infty} \frac{x^k}{k!} \;=\; 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \cdots sinx  =  k=0(1)k(2k+1)!x2k+1  =  xx36+x5120\sin x \;=\; \sum_{k=0}^{\infty} \frac{(-1)^k}{(2k+1)!} x^{2k+1} \;=\; x - \frac{x^3}{6} + \frac{x^5}{120} - \cdots cosx  =  k=0(1)k(2k)!x2k  =  1x22+x424\cos x \;=\; \sum_{k=0}^{\infty} \frac{(-1)^k}{(2k)!} x^{2k} \;=\; 1 - \frac{x^2}{2} + \frac{x^4}{24} - \cdots ln(1+x)  =  k=1(1)k1kxk  =  xx22+x33(1<x1)\ln(1+x) \;=\; \sum_{k=1}^{\infty} \frac{(-1)^{k-1}}{k} x^k \;=\; x - \frac{x^2}{2} + \frac{x^3}{3} - \cdots \quad (-1 < x \leq 1) (1+x)α  =  k=0(αk)xk  =  1+αx+α(α1)2!x2+(x<1)(1+x)^\alpha \;=\; \sum_{k=0}^{\infty} \binom{\alpha}{k} x^k \;=\; 1 + \alpha x + \frac{\alpha(\alpha-1)}{2!}x^2 + \cdots \quad (|x| < 1)

where the generalised binomial coefficient is (αk)α(α1)(αk+1)k!\binom{\alpha}{k} \coloneqq \dfrac{\alpha(\alpha-1)\cdots(\alpha-k+1)}{k!}.

Using the remainder to estimate error

The Lagrange form (2)(2) gives a concrete error bound. If f(n+1)(t)M|f^{(n+1)}(t)| \leq M for all tt between x0x_0 and xx, then

Rn(x)    M(n+1)!xx0n+1.|R_n(x)| \;\leq\; \frac{M}{(n+1)!}\,|x - x_0|^{n+1}.

Example. Approximate e0.1e^{0.1} using P3P_3 at x0=0x_0 = 0.

P3(0.1)  =  1+0.1+0.012+0.0016    1.105166.P_3(0.1) \;=\; 1 + 0.1 + \frac{0.01}{2} + \frac{0.001}{6} \;\approx\; 1.10516\overline{6}.

The remainder satisfies R3(0.1)e0.14!(0.1)4<3241041.25×105|R_3(0.1)| \leq \dfrac{e^{0.1}}{4!}(0.1)^4 < \dfrac{3}{24} \cdot 10^{-4} \approx 1.25 \times 10^{-5}. The approximation is accurate to five decimal places.

Limit computations

Taylor’s Formula makes indeterminate limits mechanical. To compute limx0sinxxx3\lim_{x \to 0} \dfrac{\sin x - x}{x^3}, expand sinx=xx36+O(x5)\sin x = x - \dfrac{x^3}{6} + O(x^5):

sinxxx3  =  x3/6+O(x5)x3    16.\frac{\sin x - x}{x^3} \;=\; \frac{-x^3/6 + O(x^5)}{x^3} \;\to\; -\frac{1}{6}.

Summary

  • The Taylor polynomial PnP_n of degree nn at x0x_0 matches ff and all its derivatives up to order nn at x0x_0.
  • Taylor’s Formula: f(x)=Pn(x)+Rn(x)f(x) = P_n(x) + R_n(x) with the Lagrange remainder Rn(x)=f(n+1)(ξ)(n+1)!(xx0)n+1R_n(x) = \dfrac{f^{(n+1)}(\xi)}{(n+1)!}(x-x_0)^{n+1} for some ξ\xi between x0x_0 and xx.
  • Proof idea: define an auxiliary function whose value at x0x_0 is the remainder; apply the Cauchy MVT to cancel all but the top-order derivative term.
  • The Lagrange remainder gives a bound Rn(x)M(n+1)!xx0n+1|R_n(x)| \leq \dfrac{M}{(n+1)!}|x-x_0|^{n+1} when f(n+1)M|f^{(n+1)}| \leq M.
  • Standard power series for exe^x, sinx\sin x, cosx\cos x, ln(1+x)\ln(1+x), and (1+x)α(1+x)^\alpha follow by letting nn \to \infty.