Taylor's Formula

Suppose now that f ( x ) has n derivatives in some interval about x 0 . Suppose also that we have found a polynomial P ( x ) , of degree ( n 1 ) , such that

f(x_0) = P(x_0),\quad f'(x_0) = P'(x_0),\quad \dots,\quad f^{(n-1)}(x_0) = P^{(n-1)}(x_0).

Then f ( x ) P ( x ) has a zero of multiplicity at least n at x 0 . By the approximation theorem, if we set H ( x ) = ( x x 0 ) n we have

f ( x ) P ( x ) = H ( x ) n ! f ( n ) ( ξ ) ,

or

f(x) - P(x) = \frac{(x - x_0)^n}{n!} f^{(n)}(\xi), \tag{*}

where ξ is between x and x 0 .

It remains to determine P ( x ) . To do so, we write

P ( x ) = a 0 + a 1 ( x x 0 ) + + a n 1 ( x x 0 ) n 1

as a combination of powers of ( x x 0 ) , where the coefficients a i are yet to be determined. Now we wish to have P ( x 0 ) = f ( x 0 ) . But P ( x 0 ) = a 0 . Therefore a 0 = f ( x 0 ) . P'(x_0) = a_1, since the derivative of the constant term is 0 and since a factor of ( x x 0 ) remains in the derivatives of all terms except a 1 ( x x 0 ) , which has derivative a 1 . Therefore a_1 = f'(x_0). Likewise P''(x_0) = 2a_2 = f''(x_0), and in general P ( i ) ( x 0 ) = i ! a 1 = f ( i ) ( x 0 ) , or

a i = f ( i ) ( x 0 ) i !

Therefore

P ( x ) = i = 0 n 1 f ( i ) ( x 0 ) i ! ( x x 0 ) i

Summarizing, we have

f ( x ) = i = 0 n 1 f ( i ) ( x 0 ) i ! ( x x 0 ) i + ( x x 0 ) n n ! f ( n ) ( ξ ) ,

where ξ is between x and x 0 . This result is known as Taylor's Formula.

We can develop the formula by another approach which will supply some new information of interest. In this case we again assume that f ( x ) has n derivatives in an interval containing a and b , a < b . Then we let

F(x) = f(x) + \frac{b-x}{1!} f'(x) + \dots + \frac{(b-x)^{n-1}}{(n-1)!} f^{(n-1)}(x) \cdot

Then

\begin{aligned} F'(x) =& f'(x) - f'(x) + \frac{b-x}{1!} f''(x) - \frac{2(b-x)}{2!} f''(x) \\ &+ \frac{(b-x)^2}{2!} f'''(x)- \dots + \frac{(b-x)^{n-2}}{(n-2)!} f^{(n-1)}(x) \\ &- \frac{(n-1)(b-x)^{n-2}}{(n-1)!} f^{(n-1)}(x) + \frac{(b-x)^{n-1}}{(n-1)!} f^{(n)}(x)\\ &= \frac{(b-x)^{n-1}}{(n-1)!} f^{(n)}(x) , \end{aligned}

since the earlier terms all cancel in pairs. Now let

g ( x ) = f ( b ) F ( x ) C ( b x ) p ,

where 1 p n and C is chosen so that g ( a ) = 0 . Since F ( b ) = f ( b ) , we also have g ( b ) = 0 . By Rolle's Theorem, there is a ξ , a < ξ < b , such that

g'(\xi) = -F'(\xi) + pC(b-\xi)^{p-1} = 0.

Thus

C = \frac{F'(\xi)}{p(b-\xi)^{p-1}} = \frac{(b-\xi)^{n-p}}{p(n-1)!} f^{(n)}(\xi) ,

and

g ( x ) = f ( b ) F ( x ) ( b x ) p ( b ξ ) n p p ( n 1 ) ! f ( n ) ( ξ ) , a < ξ < b

In particular, g ( a ) = 0 , so

f ( b ) F ( a ) = ( b a ) p ( b ξ ) n p p ( n 1 ) ! f ( n ) ( ξ ) ,

or

f(b) = f(a) + \frac{(b-a)}{1!} f'(a) + \dots + \frac{(b-a)^{n-1}}{(n-1)!} f^{(n-1)}(a) + \frac{(b-a)^p(b-\xi)^{n-p}}{p(n-1)!} f^{(n)}(\xi) ,

for some ξ between a and b . If we replace a by x 0 and b by x , we see that the remainder we have here is exactly as before if p = n . This term is called the Lagrange remainder. For p = 1 , the remainder term is called the Cauchy remainder. In some cases it is convenient to use one, in some cases the other.

In general, the expression

f(x_0) + \frac{(x-x_0)}{1!} f'(x_0) + \frac{(x-x_0)^2}{2!} f''(x_0) + \dots

is called the Taylor's series for 𝒇 ( 𝒙 ) about 𝒙 0 . When the remainder after n terms, that is, the difference between the first n terms of the series and f ( x ) , approaches 0 as n becomes large, we say that the series converges to f ( x ) . As an example we shall show a series for arctan x about x 0 = 0 which converges to arctan x when 1 x 1 . This is really its Taylor's series about 0 . We shall use this series to demonstrate a very effective method for computing the decimal expansion of π .

Consider the series

x 1 x 3 3 + x 5 5 + , 1 x 1.

Put

f n ( x ) = arctan x ( x 1 x 3 3 + ± x 2 n 1 2 n 1 ) .

Then

\begin{aligned} f_n'(x) &= \frac{1}{1 + x^2} - \left( 1 - x^2 + x^4 - \dots \pm x^{2n-2} \right)\\ &= \frac{1}{1 + x^2} - \frac{1 - (-x^2)^n}{1 + x^2} , \end{aligned}

by the rule for the sum of a geometric series. This is simply

( x 2 ) n 1 + x 2 .

When n is even, f_n'(x) \geqq 0. In this case f n ( x ) is monotone increasing. Since f n ( 0 ) = 0 , f n ( x ) 0 if x 0 . Then, observing that when n is even there are an even number of terms in our polynomial, we see that for n even and x 0 ,

arctan x x 1 x 3 3 + x 2 n 1 2 n 1 .

For n odd, f_n'(x) \leqq 0 and f n ( x ) 0 for x 0 , so

arctan x x 1 x 3 3 + + x 2 n 1 2 n 1 .

Since arctan x lies between any two successive polynomials, the difference between a polynomial of k terms and arctan x is at most the difference between this polynomial and the next one, of ( k + 1 ) terms, or

x 2 k + 1 2 k + 1 1 2 k + 1 ,

since 0 x 1 . Thus for x in this range, the series converges to arctan x . For x 0 , we observe that f n ( x ) = f n ( x ) ; since f n ( x ) approaches zero, so does f n ( x ) .

For x = 1 , this gives

π 4 = arctan 1 = 1 1 3 + 1 5 1 7 + .

Thus we have a way, but not a very economical one, of computing the decimal expansion of π . However, there is a closely related method which is very effective. Let a = arctan 1 5 . Then

tan 2 a = 2 tan a 1 tan 2 a = 2 5 1 1 25 = 5 12 ,

and once more,

tan 4 a = 10 12 1 25 144 = 120 119 .

Let b = arctan 1 239 . Then

\begin{aligned} \tan (4a - b) &= \frac{\tan 4a - \tan b}{1 + \tan 4a \tan b} = \frac{\frac{120}{119} - \frac{1}{239}}{1 + \frac{120}{119} \cdot \frac{1}{239}}\\ &= \frac{120 \cdot 239 - 119}{119 \cdot 239 + 120} = \frac{119 \cdot 239 + 239 - 119}{119 \cdot 239 + 120} \\ &= 1 . \end{aligned}

Hence 4 a b = π 4 , π = 16 a 4 b . Now

a = 1 5 1 3 ( 1 5 ) 3 + 1 5 ( 1 5 ) 5 ,

and

b = 1 239 1 3 ( 1 239 ) 3 + 1 5 ( 1 239 ) 5 .

Using this device, several hundred decimal places of π have been computed.

Exercises

Exercise 1.

Let M be any number 0 . Then as n becomes large, M n n ! approaches 0 . For if N is an integer, N 2 M , and n > N , then

M n n ! = ( M 1 M 2 M N ) M N + 1 M n .

Let

M 1 M 2 M N = A .

Then

M N + 1 < 1 2 , , M n < 1 2 ,

and

M n n ! < A 2 n N .

As n becomes larger,

A 2 n N 0 , so M n n ! 0 .

Now show that the series below are the Taylor's series about x 0 = 0 for the indicated functions and that they converge to these functions for any x . (Use the Lagrange remainder.)

a) e x = 1 + x 1 ! + x 2 2 ! + x 3 3 ! +

b) sin x = x x 3 3 ! + x 5 5 ! x 7 7 ! +

c) cos x = 1 x 2 2 ! + x 4 4 ! x 6 6 ! + .

Exercise 2.

Find the Taylor's series about x 0 = 1 of log x . For what values of x can you be sure that the series converges to log x ?