Taylor's Formula

Basis
Last updated: Tags: Calculus, Differentiation

The Mean Value Theorem says f(x)=f(x0)+f′(c)(x−x0)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! (x−x0)k=f(x0)+f′(x0)(x−x0)+f′′(x0)2!(x−x0)2+⋯+f(n)(x0)n!(x−x0)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)! (x−x0)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 x≠x0x \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!(x−t)k,G(t)  ≔  (x−t)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)=(x−x0)n+1≠0G(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!(x−t)k\tfrac{f^{(k)}(t)}{k!}(x-t)^k:

ddt[f(k)(t)k!(x−t)k]=f(k+1)(t)k!(x−t)k  −  f(k)(t)(k−1)!(x−t)k−1.\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)(k−1)!(x−t)k−1\tfrac{f^{(k)}(t)}{(k-1)!}(x-t)^{k-1} cancels with the k↦k−1k \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!(x−t)n,G′(t)  =  −(n+1)(x−t)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−ξ)n≠0(x - \xi)^n \neq 0, so substituting F′F' and G′G':

−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)=(x−x0)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 x∈Rx \in \mathbb{R} (sending n→∞n \to \infty and verifying Rn→0R_n \to 0):

ex  =  ∑k=0∞xkk!  =  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 sin⁡x  =  ∑k=0∞(−1)k(2k+1)!x2k+1  =  x−x36+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 cos⁡x  =  ∑k=0∞(−1)k(2k)!x2k  =  1−x22+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)k−1kxk  =  x−x22+x33−⋯(−1<x≤1)\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)! ∣x−x0∣n+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<324⋅10−4≈1.25×10−5|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 lim⁡x→0sin⁡x−xx3\lim_{x \to 0} \dfrac{\sin x - x}{x^3}, expand sin⁡x=x−x36+O(x5)\sin x = x - \dfrac{x^3}{6} + O(x^5):

sin⁡x−xx3  =  −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)!(x−x0)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)!∣x−x0∣n+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, sin⁡x\sin x, cos⁡x\cos x, ln⁡(1+x)\ln(1+x), and (1+x)α(1+x)^\alpha follow by letting n→∞n \to \infty.