2 The Maclaurin series

Consider a function f ( x ) which can be differentiated at x = 0 as often as we please. For example e x , cos x , sin x would fit into this category but x would not.

Let us assume that f ( x ) can be represented by a power series in x :

f ( x ) = b 0 + b 1 x + b 2 x 2 + b 3 x 3 + b 4 x 4 + = p = 0 b p x p

where b 0 , b 1 , b 2 , are constants to be determined.

If we substitute x = 0 then, clearly f ( 0 ) = b 0

The other constants can be determined by further differentiating and, on each differentiation, substituting x = 0 . For example, differentiating once:

f ( x ) = 0 + b 1 + 2 b 2 x + 3 b 3 x 2 + 4 b 4 x 3 +

so, putting x = 0 , we have f ( 0 ) = b 1 .

Continuing to differentiate:

f ( x ) = 0 + 2 b 2 + 3 ( 2 ) b 3 x + 4 ( 3 ) b 4 x 2 +

so

f ( 0 ) = 2 b 2 or b 2 = 1 2 f ( 0 )

Further:

f ( x ) = 3 ( 2 ) b 3 + 4 ( 3 ) ( 2 ) b 4 x + so f ( 0 ) = 3 ( 2 ) b 3 implying b 3 = 1 3 ( 2 ) f ( 0 )

Continuing in this way we easily find that (remembering that 0 ! = 1 )

b n = 1 n ! f ( n ) ( 0 ) n = 0 , 1 , 2 ,

where f ( n ) ( 0 ) means the value of the n t h derivative at x = 0 and f ( 0 ) ( 0 ) means f ( 0 ) .

Bringing all these results together we have:

Key Point 14

Maclaurin Series

If f ( x ) can be differentiated as often as required:

f ( x ) = f ( 0 ) + x f ( 0 ) + x 2 2 ! f ( 0 ) + x 3 3 ! f ( 0 ) + = p = 0 x p p ! f ( p ) ( 0 )
This is called the Maclaurin expansion of f ( x ) .
Example 4

Find the Maclaurin expansion of   cos x .

Solution

Here f ( x ) = cos x and, differentiating a number of times:

f ( x ) = cos x , f ( x ) = sin x , f ( x ) = cos x , f ( x ) = sin x etc.

Evaluating each of these at x = 0 :

f ( 0 ) = 1 , f ( 0 ) = 0 , f ( 0 ) = 1 , f ( 0 ) = 0 etc.

Substituting into f ( x ) = f ( 0 ) + x f ( 0 ) + x 2 2 ! f ( 0 ) + x 3 3 ! f ( 0 ) + , gives:

cos x = 1 x 2 2 ! + x 4 4 ! x 6 6 ! +

The reader should confirm (by finding the radius of convergence) that this series is convergent for all values of x . The geometrical approximation to cos x by the first few terms of its Maclaurin series are shown in Figure 6.

Figure 6 :

{ Linear, quadratic and cubic approximations to cos x}

Task!

Find the Maclaurin expansion of ln ( 1 + x ) .

(Note that we cannot find a Maclaurin expansion of the function ln x since ln x does not exist at x = 0 and so cannot be differentiated at x = 0 .)

Find the first four derivatives of f ( x ) = ln ( 1 + x ) :

f ( x ) = 1 1 + x , f ( x ) = 1 ( 1 + x ) 2 , f ( x ) = 2 ( 1 + x ) 3 ,

generally: f ( n ) ( x ) = ( 1 ) n + 1 ( n 1 ) ! ( 1 + x ) n

Now obtain f ( 0 ) , f ( 0 ) , f ( 0 ) , f ( 0 ) :

f ( 0 ) = 0 f ( 0 ) = 1 , f ( 0 ) = 1 , f ( 0 ) = 2 ,

generally: f ( n ) ( 0 ) = ( 1 ) n + 1 ( n 1 ) !

Hence, obtain the Maclaurin expansion of ln ( 1 + x ) :

ln ( 1 + x ) = x x 2 2 + x 3 3 + ( 1 ) n + 1 n x n + (This was obtained in Section 16.4, page 37.)

Now obtain the radius of convergence and consider the situation at the boundary values:

R = 1 . Also at x = 1 the series is convergent (alternating harmonic series) and at x = 1 the series is divergent. Hence this Maclaurin expansion is only valid if 1 < x 1 . The geometrical closeness of the polynomial terms with the function ln ( 1 + x ) for 1 < x 1 is displayed in Figure 7:

Figure 7 :

{ Linear, quadratic and cubic approximations to ln (1+x)}

Note that when x = 1 ln 2 = 1 1 2 + 1 3 1 4 so the alternating harmonic series converges to ln 2 0.693 , as stated in Section 16.2, page 17.

The Maclaurin expansion of a product of two functions: f ( x ) g ( x ) is obtained by multiplying together the Maclaurin expansions of f ( x ) and of g ( x ) and collecting like terms together. The product series will have a radius of convergence equal to the smaller of the two separate radii of convergence.

Example 5

Find the Maclaurin expansion of  e x ln ( 1 + x ) .

Solution

Here, instead of finding the derivatives of f ( x ) = e x ln ( 1 + x ) , we can more simply multiply together the Maclaurin expansions for e x and ln ( 1 + x ) which we already know:

e x = 1 + x + x 2 2 ! + x 3 3 ! + all x

and

ln ( 1 + x ) = x x 2 2 + x 3 3 + 1 < x 1

The resulting power series will only be convergent if 1 < x 1 . Multiplying:

e x ln ( 1 + x ) = 1 + x + x 2 2 ! + x 3 3 ! + x x 2 2 + x 3 3 + = x x 2 2 + x 3 3 x 4 4 + + x 2 x 3 2 + x 4 3 + + x 3 2 x 4 4 + x 4 6 = x + x 2 2 + x 3 3 + 3 x 5 40 + 1 < x 1

(You must take care not to miss relevant terms when carrying through the multiplication.)

Task!

Find the Maclaurin expansion of cos 2 x up to powers of x 4 . Hence write down the expansion of sin 2 x to powers of x 6 .

First, write down the expansion of cos x :

cos x = 1 x 2 2 ! + x 4 4 ! +

Now, by multiplication, find the expansion of cos 2 x :

cos 2 x = 1 x 2 2 ! + x 4 4 ! 1 x 2 2 ! + x 4 4 !

= ( 1 x 2 2 ! + x 4 4 ! ) + ( x 2 2 ! + x 4 4 ) + ( x 4 4 ! ) + = 1 x 2 + x 4 3 2 x 6 45

Now obtain the expansion of sin 2 x using a suitable trigonometric identity:

sin 2 x = 1 cos 2 x = 1 1 x 2 + x 4 3 2 x 6 45 + = x 2 x 4 3 + 2 x 6 45 + As an alternative approach the reader could obtain the power series expansion for cos 2 x by using the trigonometric identity cos 2 x 1 2 ( 1 + cos 2 x ) .

Example 6

Find the Maclaurin expansion of tanh x up to powers of x 5 .

Solution

The first two derivatives of f ( x ) = tanh x are

f ( x ) = sech 2 x f ( x ) = 2 sech 2 x tanh x f ( x ) = 4 sech 2 x tanh 2 x 2 sech 4 x

giving f ( 0 ) = 0 , f ( 0 ) 1 , f ( 0 ) = 0 f ( 0 ) = 2

This leads directly to the Maclaurin expansion as tanh x = 1 1 3 x 3 + 2 15 x 5

Example 7

The relationship between the wavelength, L , the wave period, T , and the water depth, d , for a surface wave in water is given by: L = g T 2 2 π tanh 2 π d L

In a particular case the wave period was 10 s and the water depth was 6.1 m. Taking the acceleration due to gravity, g , as 9.81 m s 2 determine the wave length.

[Hint: Use the series expansion for tanh x developed in Example 6.]

Solution

Substituting for the wave period, water depth and g we get

L = 9.81 × 1 0 2 2 π tanh 2 π × 6.1 L = 490.5 π tanh 12.2 π L

The series expansion of tanh x is given by tanh x = x x 3 3 + 2 x 5 15 +

Using the series expansion of tanh x we can approximate the equation as

L = 490.5 π 12.2 π L 1 3 12.2 π L 3 +

Multiplying through by π L 3 the equation becomes

π L 4 = 490.5 × 12.2 π L 2 490.5 3 × ( 12.2 π ) 3

This equation can be rewritten as L 4 5984.1 L 2 + 2930198 = 0

Solving this as a quadratic in L 2 we get L = 74 m.

Using Newton-Raphson iteration this can be further refined to give a wave length of 73.9 m.