Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Statement of Taylor’s Theorem

Suppose we have a function f(x)f(x) with k+1k + 1 continuous derivatives, and let x=x0+hx = x_0 + h then we can write:

f(x)=Pk(x)k-th Taylor polynomial+Rk(x)Remainder or error termf(x)=i=0kf(i)(x0)i!(xx0)i+f(k+1)(ξ)(k+1)!(xx0)k+1,\begin{split} f(x) &= \underbrace{P_k(x)}_{\text{$k$-th Taylor polynomial}} + \underbrace{R_k(x)}_{\text{Remainder or error term}} \\ f(x) &= \sum_{i=0}^{k} \frac{f^{(i)}(x_0)}{i!} (x - x_0)^i + \frac{f^{(k+1)}(\xi)}{(k+1)!}(x - x_0)^{k+1}, \end{split}

where ξ(x0,x0+h)\xi \in (x_0, x_0 + h). This means that the approximation error is:

f(x)Pk(x)=Rk(x)    supx[a,b]f(x)Pk(x)=supx[a,b]Rk(x).|f(x) - P_k(x)| = |R_k(x)| \quad\implies\quad \sup_{x \in [a, b]} |f(x) - P_k(x)| = \sup_{x \in [a, b]} |R_k(x)|.
Example 1 (Computing ee to a Given Accuracy)

Suppose we want to compute the number ee to an accuracy of 10-3.

We can do this by computing a Taylor series for the function exe^x. Since we know the value at x=0x = 0, namely f(0)=e0=1f(0) = e^0 = 1, we use that as the point about which we create the Taylor series.

Since f(n)(x)=exf^{(n)}(x) = e^x, we have f(n)(0)=1f^{(n)}(0) = 1 for all nn.

The nn-degree Taylor polynomial is:

Tn(x)=1+x+x22++xnn!T_n(x) = 1 + x + \frac{x^2}{2} + \cdots + \frac{x^n}{n!}

To estimate the error, we compute the remainder:

Rn(x)=f(n+1)(ξ)(n+1)!xn+1R_n(x) = \frac{f^{(n+1)}(\xi)}{(n+1)!}x^{n+1}

where ξ[0,1]\xi \in [0, 1]. Since exe^x is positive and increasing:

supx[0,1]Rn(x)ex(n+1)!3(n+1)!.\sup_{x \in [0, 1]}|R_n(x)| \leq \frac{e^x}{(n+1)!} \leq \frac{3}{(n+1)!}.

To achieve the required accuracy:

supx[0,1]Rn(x)103    3(n+1)!103.\sup_{x \in [0, 1]}|R_n(x)| \leq 10^{-3} \quad\implies\quad \frac{3}{(n+1)!} \leq 10^{-3}.

With some experimentation, we find that the first nn for which this inequality holds is n=6n = 6.

The first four Taylor polynomials P_1, P_2, P_3, P_4 of f(x) = e^x centered at x_0 = 0. The approximations converge to the true function (dashed black) as the degree increases.

The first four Taylor polynomials P1,P2,P3,P4P_1, P_2, P_3, P_4 of f(x)=exf(x) = e^x centered at x0=0x_0 = 0. The approximations converge to the true function (dashed black) as the degree increases.

Why Taylor’s Theorem Matters

Taylor’s theorem is a workhorse of numerical analysis because:

  1. It allows us to replace complicated functions with polynomials

  2. The remainder term gives us explicit error bounds

  3. It reveals how accuracy depends on the step size hh

In the next section, we’ll use Taylor’s theorem to derive finite difference approximations for derivatives.