Notes for Calculus

Appendix: Taylor's Theorem

Author: Kenneth, S.K. Cheng

Table of Contents

Introduction

Recall that we made the following approximation

Δf(x0)df(x0)\Delta f(x_0) \approx df(x_0)

replacing the increment

Δf(x0)=f(x0+Δx)f(x0)\Delta f(x_0) = f(x_0 + \Delta x) - f(x_0)

of a function differentiable at x0x_0 by its differential

df(x0)=f(x0)Δxdf(x_0) = f'(x_0) \Delta x

at x_0. We now estimate the error committed in making the approximation, and then develop a series of sharper approximations involving "higher-order terms," i.e., terms proportional to (Δx)2(\Delta x)^2, (Δx)3(\Delta x)^3, etc. In particular, this will allow us to handle the case df(x0)=0df(x_0)=0, where the approximation above breaks down.

We begin by refining the mean value theorem:

Theorem: Let ff be a function with a finite second derivative ff'' in an interval containing the points x0x_0 and x0+Δxx_0+\Delta x. Then the increment of ff at x0x_0 can be written in the form

Δf(x0)=f(x0+Δx)f(x0)=Δxf(x0)+12(Δx)2f(x0+θΔx)\Delta f(x_0) = f(x_0 + \Delta x) - f(x_0) = \Delta x f'(x_0) + \frac{1}{2} (\Delta x)^2 f''(x_0 + \theta \Delta x)

where θ\theta is a number between 0 and 1. Equaivalently, if ff has finite second derivative in a neightborhood of x0x_0, then the value of ff at any point xx of the neighborhood is given by

f(x)=f(x0)+(xx0)f(x0)+12(xx0)2f(ξ),f(x) = f(x_0) + (x - x_0) f'(x_0) + \frac{1}{2} (x - x_0)^2 f''(\xi),

where ξ\xi is a number between x0x_0 and xx.

Proof: Let

φ(x)=f(x0+x)f(x0)f(x0)x,g(x)=x2. \varphi(x) = f(x_0 + x) - f(x_0)-f'(x_0)x, \quad g(x)=x^2.

Then it follows from Cauchy's theorem applied to the functions φ\varphi and gg in the interval [0,Δx][0,\Delta x] or [Δx,0][\Delta x, 0], depending on the sign of Δx\Delta x, that

φ(c)2c=φ(Δx)φ(0)g(Δx)g(0)=φ(Δx)g(Δx),\frac{\varphi'(c)}{2c} = \frac{\varphi(\Delta x) - \varphi(0)}{g(\Delta x) -g(0)} = \frac{\varphi(\Delta x)}{g(\Delta x)},

where cc lies between 00 and Δx\Delta x. But, by the mean value theorem,

φ(c)c=f(x0+c)f(x0)c=f(x0+θ1c),\frac{\varphi'(c)}{c} = \frac{f'(x_0+c)-f'(x_0)}{c} = f''(x_0 + \theta_1 c),

where 0<θ1<10<\theta_1<1. Hence

φ(Δx)=12Δx2f(x0+θ1Δx),\varphi(\Delta x) = \frac{1}{2} \Delta x^2 f''(x_0 + \theta_1 \Delta x),

i.e.,

f(x0+Δx)f(x0)=Δxf(x0)+12(Δx)2f(x0+θ1c).f(x_0+\Delta x)-f(x_0) = \Delta x f'(x_0)+\frac{1}{2} (\Delta x)^2 f''(x_0 + \theta_1 c).

The numbers θ1\theta_1 and cΔx\frac{c}{\Delta x} are both positive and lie in the interval (0,1)(0,1), and thence the same is true of

θ=θ1cΔx.\theta = \frac{\theta_1 c}{\Delta x}.

In other words, θ1c=θΔx\theta_1 c = \theta \Delta x, where θ\theta lies between 0 and 1. The second part of the theorem follows by setting x=x0+Δxx=x_0+\Delta x in the first part.

Taylor's Theorem

Theorem (Taylor's Theorem): Let ff be a function with a finite $(n+1)$st derivative in an interval containing the points x0x_0 and x0+Δxx_0+\Delta x. Then the increment of ff at x0x_0 can be written in the form

Δf(x0)=f(x0+Δx)f(x0)=Δxf(x0)+12(Δx)2f(x0)++1n!(Δx)nf(n)(x0)+1(n+1)!(Δx)n+1f(n+1)(x0+θΔx)\Delta f(x_0) = f(x_0 + \Delta x) - f(x_0) = \Delta x f'(x_0) + \frac{1}{2} (\Delta x)^2 f''(x_0) + \cdots + \frac{1}{n!} (\Delta x)^n f^{(n)}(x_0) + \frac{1}{(n+1)!} (\Delta x)^{n+1} f^{(n+1)}(x_0 + \theta \Delta x)

where θ\theta is a number between 0 and 1. Equivalently, if ff has finite $(n+1)$st derivative in a neighborhood of x0x_0, then the value of ff at any point xx of the neighborhood is given by Taylor's formula

f(x)=f(x0)+(xx0)f(x0)+12(xx0)2f(x0)++1n!(xx0)nf(n)(x0)+1(n+1)!(xx0)n+1f(n+1)(ξ),f(x) = f(x_0) + (x - x_0) f'(x_0) + \frac{1}{2} (x - x_0)^2 f''(x_0) + \cdots + \frac{1}{n!} (x - x_0)^n f^{(n)}(x_0) + \frac{1}{(n+1)!} (x - x_0)^{n+1} f^{(n+1)}(\xi),

where usually the last term is written as

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

and is called the remainder of the approximation. The variable ξ\xi lies between x0x_0 and xx.

Proof: The proof is quite constructive. It is enough to show that the Remainder Rn(x)R_n(x) holds if we set

Rn(x)=f(x)[f(x0)+(xx0)f(x0)+12(xx0)2f(x0)++1n!(xx0)nf(n)(x0)]R_n(x) = f(x) - \left[ f(x_0) + (x - x_0) f'(x_0) + \frac{1}{2} (x - x_0)^2 f''(x_0) + \cdots + \frac{1}{n!} (x - x_0)^n f^{(n)}(x_0) \right]

Differentiating Rn(x)R_n(x) nn times with respect to xx gives

Rn(x)=f(x)f(x0)(xx0)f(x0)1(n1)!(xx0)n1f(n)(x0)Rn(x)=f(x)f(x0)(xx0)f(3)(x0)1(n2)!(xx0)n2f(n)(x0)Rn(n)(x)=f(n)(x)f(n)(x0)\begin{aligned} R_n'(x) &= f'(x) - f'(x_0) - (x - x_0) f''(x_0) - \cdots - \frac{1}{(n-1)!} (x - x_0)^{n-1} f^{(n)}(x_0) \\ R_n''(x) &= f''(x) - f''(x_0) - (x - x_0) f^{(3)}(x_0) - \cdots - \frac{1}{(n-2)!} (x - x_0)^{n-2} f^{(n)}(x_0) \\ &\vdots \\ R_n^{(n)}(x) &= f^{(n)}(x) - f^{(n)}(x_0) \end{aligned}

Therefore, it implies that

Rn(x0)=Rn(x0)==Rn(n)(x0)=0.R_n(x_0) = R_n'(x_0) = \cdots = R_n^{(n)}(x_0) = 0.

Applyin Cauchy's theorem to the function Rn(x)R_n(x) and (xx0)n+1(x-x_0)^{n+1} in the interval [x0,x][x_0, x] or [x,x0][x, x_0] gives

Rn(x)(xx0)n+1=Rn(x)Rn(x0)(xx0)n+10=Rn(ξ1)(n+1)!,\frac{R_n(x)}{(x-x_0)^{n+1}} = \frac{R_n(x) - R_n(x_0)}{(x-x_0)^{n+1} - 0} = \frac{R_n'(\xi_1)}{(n+1)!},

where ξ1\xi_1 lies between x0x_0 and xx. Applying Cauchy's theorem to the function Rn(x)R_n'(x) and (n+1)(ξ1x0)n(n+1)(\xi_1-x_0)^n in the interval [x0,ξ1][x_0, \xi_1] or [ξ1,x0][\xi_1, x_0] gives

Rn(x)(n+1)(ξ1x0)n=Rn(ξ1)Rn(x0)(n+1)(ξ1x0)n0=Rn(ξ2)(n+1)n(ξ2x0)n1,\frac{R_n'(x)}{(n+1)(\xi_1-x_0)^n} = \frac{R_n'(\xi_1) - R_n'(x_0)}{(n+1)(\xi_1-x_0)^n - 0} = \frac{R_n''(\xi_2)}{(n+1)n(\xi_2-x_0)^{n-1}},

where ξ2\xi_2 lies between x0x_0 and ξ1\xi_1. Repeating this process nn times gives

Rn(x)(xx0)n+1=Rn(n)(ξ)(n+1)!(ξnx0)=R(n)(ξn)R(n)(x0)(n+1)!(ξnx0),\frac{R_n(x)}{(x-x_0)^{n+1}} = \frac{R_n^{(n)}(\xi)}{(n+1)!(\xi_n-x_0)} = \frac{R^{(n)}(\xi_n)-R^{(n)}(x_0)}{(n+1)!(\xi_n-x_0)},

where ξn\xi_n lies between x0x_0 and xx. Finally by applying the mean value theorem, obtaining

Rn(x)(xx0)n+1=(ξnx0)R(n+1)(ξ)(n+1)!(ξnx0)=R(n+1)(ξ)(n+1)!,\frac{R_n(x)}{(x-x_0)^{n+1}} =\frac{(\xi_n-x_0)R^{(n+1)}(\xi)}{(n+1)!(\xi_n-x_0)}=\frac{R^{(n+1)}(\xi)}{(n+1)!},

where ξ\xi lies between x0x_0 and ξn\xi_n and hence between x0x_0 and xx. But

R(n+1)(x)=f(n+1)(x),R^{(n+1)}(x) = f^{(n+1)}(x),

and hence

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

which completes the proof.

Example: Find the Taylor series of the function f(x)=exf(x) = e^x at x=0x=0.

Solution: We have

f(x)=ex,f(x)=ex,f(x)=ex,f(n)(x)=ex.\begin{aligned} f'(x) &= e^x, \\ f''(x) &= e^x, \\ f'''(x) &= e^x, \\ &\vdots \\ f^{(n)}(x) &= e^x. \end{aligned}

Therefore, the Taylor series of f(x)f(x) at x=0x=0 is

f(x)=f(0)+xf(0)+12x2f(0)++1n!xnf(n)(0)+1(n+1)!xn+1f(n+1)(ξ)=1+x+12x2++1n!xn+1(n+1)!xn+1eξ=k=0n1k!xk+1(n+1)!xn+1eξ.\begin{aligned} f(x) &= f(0) + x f'(0) + \frac{1}{2} x^2 f''(0) + \cdots + \frac{1}{n!} x^n f^{(n)}(0) + \frac{1}{(n+1)!} x^{n+1} f^{(n+1)}(\xi) \\ &= 1 + x + \frac{1}{2} x^2 + \cdots + \frac{1}{n!} x^n + \frac{1}{(n+1)!} x^{n+1} e^{\xi} \\ &= \sum_{k=0}^n \frac{1}{k!} x^k + \frac{1}{(n+1)!} x^{n+1} e^{\xi}. \end{aligned}

where ξ\xi lies between 0 and xx. The remainder terms vanish as nn\to\infty and the series converges to exe^x for all xx.

To illustrate the idea, one may think of the following figure:

Example2
Figure 1: The Taylor's Series for Exponential Function

It reveals that more terms in the series give a better approximation to the function.

Useful Formulas for Taylor's Series

There some useful formulas for Taylor's series that are worth mentioning:

  1. Taylor's Series for exe^x: The Taylor series for exe^x at x=0x=0 is

ex=k=01k!xk.e^x = \sum_{k=0}^{\infty} \frac{1}{k!} x^k.

  1. Taylor's Series for sinx\sin x: The Taylor series for sinx\sin x at x=0x=0 is

sinx=k=0(1)k(2k+1)!x2k+1.\sin x = \sum_{k=0}^{\infty} \frac{(-1)^k}{(2k+1)!} x^{2k+1}.

  1. Taylor's Series for cosx\cos x: The Taylor series for cosx\cos x at x=0x=0 is

cosx=k=0(1)k(2k)!x2k.\cos x = \sum_{k=0}^{\infty} \frac{(-1)^k}{(2k)!} x^{2k}.

  1. Taylor's Series for ln(1+x)\ln(1+x): The Taylor series for ln(1+x)\ln(1+x) at x=0x=0 is

ln(1+x)=k=1(1)k1kxk.\ln(1+x) = \sum_{k=1}^{\infty} \frac{(-1)^{k-1}}{k} x^k.

  1. Taylor's Series for 11x\frac{1}{1-x}: The Taylor series for 11x\frac{1}{1-x} at x=0x=0 is

11x=k=0xk.\frac{1}{1-x} = \sum_{k=0}^{\infty} x^k.

Further Applications of Taylor's Theorem

Taylor's theorem is a powerful tool in approximating functions. It is used in many areas of mathematics, physics, and engineering. Here are some applications of Taylor's theorem:

  1. Error Analysis: Taylor's theorem is used to estimate the error in numerical methods. For example, in numerical analysis, the error in approximating a function by a polynomial can be estimated using Taylor's theorem.
  2. Physics: Taylor's theorem is used in physics to approximate the behavior of physical systems. For example, in classical mechanics, Taylor's theorem is used to approximate the motion of a particle.

Further Reading

  1. Apostol, T. M. (1967). Calculus, Volume 1: One-Variable Calculus, with an Introduction to Linear Algebra. John Wiley & Sons.
  2. Silverman, Richard A. (2002). Modern Calculus and Analytic Geometry. Courier Corporation.