next up previous contents
Next: The Binomial Series Up: Taylor Series Previous: Geometric Series   Contents

Taylor Series

I have shown you a sequence of approximations to the value of a function. It is usually the case that the higher the approximation you use the more accurate a result you get (not always true). Some of the numerical evidence given above demonstrates this.

This opens up the possibility that if we imagine the sequence of successive approximations going on for ever then the error will eventually dwindle away to nothing and, in the limiting case, we will not have an approximation but will get the exact result.

For elementary functions this is usually true, at least for some values of a and h.

The resulting infinite series is called the Taylor Series of the function f (x) expanded about the point a. If it converges to the value of the function we get

$\displaystyle \boxed{ f(a+h) = f(a) + hf'(a) + \frac{h^2}{2!}f''(a) + \cdots
+ \frac{h^n}{n!}f^{(n)}(a) + \cdots}$

If a = 0 then the series is known as the Maclaurin Series of the function f, which we might write as:

$\displaystyle \boxed{ f(x) = f(0) + xf'(0) + \frac{x^2}{2!}f''(0) + \cdots
+ \frac{x^n}{n!}f^{(n)}(0) + \cdots}$

Taylor (and Maclaurin) series are tremendously important in many areas of mathematics. They are often used to define functions.

Example 4.11   What is the Maclaurin series of f (x) = ex?

To write down the Maclaurin series we need to know the value at x = 0 of every derivative of the function. This is usually the practical problem that we face in working out Taylor series. In this case it is easy since every derivative of ex is ex and this has value 1 at x = 0. So the Maclaurin series becomes

1 + x.1 + $\displaystyle {\frac{x^2}{2!}}$.1 + ... + $\displaystyle {\frac{x^n}{n!}}$.1 + ...

It turns out that this is actually equal to the value of ex for any value of x (I cannot prove that here). So we have the famous result that

$\displaystyle \boxed{ e^x = 1 + x + \frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!}
+ \cdots + \frac{x^n}{n!} + \cdots}$

You will often find this given as the definition of ex.

Example 4.12   What are the Maclaurin series of sin x and cos x?

This is another case where it is reasonably easy to work out the values of all the derivatives at x = 0. The first few derivatives of sin x are

cos x,     - sin x,     - cos x,    sin x,    cos x

and so on. You can see that they go round and round in a cycle of four. The values of sin x and its derivatives at x = 0 are therefore

0,    1,    0,     - 1,    0,    1,     0

and so on.

It turns out that the Maclaurin series of sin x is valid for all values of x. So we have

$\displaystyle \boxed{ \sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!}
+ \frac{x^9}{9!} - \cdots}$

Using the same results you can show that the Maclaurin series of cos x, which is also valid for all values of x is

$\displaystyle \boxed{\cos x = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!}
+ \frac{x^8}{8!} - \cdots}$

Example 4.13   Find the value of sin 1.23 to 6 decimal places.

Put x = 1.23 into the Maclaurin series for sin x and start adding up terms. Carry on doing this until the terms being added on `obviously' don't affect the answer to 6 decimal places. Stop there.

Termvaluesum so far
x +1.23 1.23
- x3/3! -0.31014450 0.9198555
x5/5! +0.02346088 0.9433164
- x7/7! -0.00084509 0.9424713
x9/9! +0.00001776 0.9424890
- x11/11! -0.00000024 0.9424888
x13/13! +0.00000000 0.9424888

Which gives us sin 1.23 = 0.942489 to 6 decimal places (and is correct).

Note that this is a slightly dangerous game and is not quite like what was happening with the Newton method. By stopping the calculation early I have missed out an infinite number of terms (because the series goes on for ever). The individual terms are certainly getting very small, but an awful lot of very small terms can add up to something enormous. You do need to be a bit careful--especially if the terms are getting small quite slowly.

As a warning, consider the infinite series

1 + $\displaystyle {\textstyle\frac{1}{2}}$ + $\displaystyle {\textstyle\frac{1}{3}}$ + $\displaystyle {\textstyle\frac{1}{4}}$ + ... + $\displaystyle {\frac{1}{n}}$ + ...

The individual terms in this series are tending to zero, yet it can be shown that this series is divergent. If you add up enough of the terms you can get a sum as big as you like!

Example 4.14   A Maclaurin series for the logarithm.

Here we have to be a bit careful. ln x is not defined at x = 0, so there is no hope of a Maclaurin series for ln x.

Instead, it is usual to look at the Maclaurin series of f (x) = ln(1 + x) (or the Taylor series of ln x expanded about x = 1 if you prefer).

The first few derivatives are:

f'(x) = $\displaystyle {\frac{1}{1+x}}$,        f''(x) = - $\displaystyle {\frac{1}{(1+x)^2}}$,        f'''(x) = $\displaystyle {\frac{2}{(1+x)^3}}$

You can probably see the pattern beginning to develop. The nth derivative is

f(n)(x) = $\displaystyle {\frac{(-1)^{n-1}(n-1)!}{(1+x)^n}}$,        f(n)(0) = (- 1)n - 1(n - 1)!

The Maclaurin series now becomes

$\displaystyle \boxed{ \ln(1+x)
= x - \frac{x^2}{2} + \frac{x^3}{3} - \frac{x^4}{4} +\frac{x^5}{5} - \cdots}$

This is not valid for all values of x. Obviously it does not make sense for x$ \le$ - 1 because the logarithm is not defined for negative values. Less obviously, it does not work for x > 1 either. The Maclaurin series for ln(1 + x) is only valid for -1 < x$ \le$1.


next up previous contents
Next: The Binomial Series Up: Taylor Series Previous: Geometric Series   Contents
Ian Craw 2000-01-20