maclaurin and taylor series
TRANSCRIPT
Maclaurin and TaylorSeries
�✒
✏✑16.5
IntroductionIn this block we examine how functions may be expressed in terms of power series. This is anextremely useful way of expressing a function since (as we shall see) we can then replace ‘com-plicated’ functions in terms of ‘simple’ polynomials. The only requirement (of any significance)is that the ‘complicated’ function should be smooth; this means that at a point of interest, itmust be possible to differentiate the function as often as we please.
✬
✫
✩
✪
PrerequisitesBefore starting this Block you should . . .
① have knowledge of power series and of theratio test
② be able to differentiate simple functions
③ be familiar with the rules for combiningpower series
Learning OutcomesAfter completing this Block you should be ableto . . .
✓ find the Maclaurin and Taylor seriesexpansions of given functions
✓ find Maclaurin expansions of functions bycombining known power series together
✓ find Maclaurin expansions by usingdifferentiation and integration
Learning StyleTo achieve what is expected of you . . .
☞ allocate sufficient study time
☞ briefly revise the prerequisite material
☞ attempt every guided exercise and mostof the other exercises
1. Maclaurin and Taylor SeriesAs we shall see, many functions can be represented by power series. In fact we have alreadyseen in earlier Blocks examples of such a representation. For example,
1
1 − x= 1 + x + x2 + . . . |x| < 1
ln(1 + x) = x − x2
2+
x3
3− . . . − 1 < x ≤ 1
ex = 1 + x +x2
2!+
x3
3!+ . . . all x
The first two examples show that, as long as we constrain x to lie within the domain |x| < 1(or, equivalently, −1 < x < 1), then in the first case 1
1−xhas the same numerical value as
1+x+x2+ . . . and in the second case ln(1+x) has the same numerical value as x− x2
2+ x3
3− . . . .
In the third example we see that ex has the same numerical value as 1 + x + x2
2!+ . . . but in
this case there is no restriction to be placed on the value of x since this power series convergesfor all values of x. The following diagram shows this situation geometrically. As more andmore terms are used from the series 1 + x + x2
2!+ x3
3!. . . the curve representing ex is better and
better approximated. In (a) we show the linear approximation to ex. In (b) and (c) we show,respectively, the quadratic and cubic approximations.
x
y
ex
1 + x
1 + x +x2
2!1 + x +
x2
2!+
x3
3!
(a) (b) (c)
x
y
x
y
exex
These power series representations are extremely important, from many points of view. Numer-ically, we can simply replace the function 1
1−xby the quadratic expression 1 + x + x2 as long
as x is so small so that powers of x greater than or equal to 3 can be ignored in comparisonto quadratic terms. This approach can be used to approximate more complicated functions interms of simpler polynomials. Our aim now is to see how these power series expansions areobtained.
2. The Maclaurin SeriesConsider a function f(x) which can be differentiated at x = 0 as often as we please. For exampleex, 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) = a0 + a1x + a2x2 + a3x
3 + a4x4 + . . . =
∞∑p=0
apxp
Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
2
where a0, a1, a2, . . . are constants to be determined.
If we substitute x = 0 then, clearly
f(0) = a0
The other constants can be determined by further differentiating and, on each differentiation,substituting x = 0. For example, differentiating once:
f ′(x) = 0 + a1 + 2a2x + 3a3x2 + 4a4x
3 + . . .
so, putting x = 0, we have f ′(0) = a1.
Continuing to differentiate:
f ′′(x) = 0 + 2a2 + 3(2)a3x + 4(3)a4x2 + . . .
so
f ′′(0) = 2a2 or a2 =1
2f ′′(0)
Further:
f ′′′(x) = 3(2)a3 + 4(3)(2)a4x + . . .
so
f ′′′(0) = 3(2)a3 implying a3 =1
3(2)f ′′′(0)
Continuing in this way we easily find that (remembering that 0! = 1)
an =1
n!f (n)(0) n = 0, 1, 2, . . .
where f (n)(0) means the value of the nth derivative at x = 0 and f (0)(0) means f(0).
Bringing all these results together we find
Key Point
If f(x) can be differentiated as often as we please:
f(x) = f(0) + xf ′(0) +x2
2!f ′′(0) +
x3
3!f ′′′(0) + . . . =
∞∑p=0
1
p!f (p)(0)xp
This is called the Maclaurin expansion of f(x)
Example Find the Maclaurin expansion of cosx.
3 Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
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.
Thus, evaluating each of these at x = 0:
f(0) = 1, f ′(0) = 0, f ′′(0) = −1, f ′′′(0) = 0 etc.
Now, substituting into f(x) = f(0) + xf ′(0) + x2
2!f ′′(0) + x3
3!f ′′′(0) + . . . , implies
cos x = 1 − x2
2!+
x4
4!− x6
6!+ . . .
The reader should confirm (by finding the radius of convergence) that this series is convergentfor all values of x. The geometrical approximation to cosx by the first few terms of its Maclaurinseries are shown in the following diagram.
x
y yy
xxcos x
1 − x2
2!
1 − x2
2!+
x4
4!
cos x cos x
Try each part of this exercise
Find the Maclaurin expansion of ln(1 + x). (Note that we cannot find a Maclaurin expansionof the function ln x since this function cannot be differentiated at x = 0).
Part (a) Find the first few derivatives of f(x) = ln(1 + x)
Answer
Part (b) Now obtain f(0), f ′(0), f ′′(0), f ′′′(0), . . .
Answer
Part (c) Hence, obtain the Maclaurin expansion of ln(1 + x).
Answer
Part (d) Now obtain the interval of convergence?
Answer
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, a claim first made in Block 2.
Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
4
Example Find the Maclaurin expansion of ex ln(1 + x).
Solution
Here, instead of finding the derivatives of f(x) = ex ln(1 + x), we can multiply together theMaclaurin expansions we already know:
ex = 1 + x +x2
2!+
x3
3!+ . . . all x
and
ln(1 + x) = x − x2
2+
x3
3+ . . . − 1 < x ≤ 1
The resulting power series will only be convergent if−1 < x ≤ 1. That is
ex ln(1 + x) =
(1 + x +
x2
2!+
x3
3!+ . . .
) (x − x2
2+
x3
3+ . . .
)
= x − x2
2+
x3
3− x4
4+ . . .
+ x2 − x3
2+
x4
4+ . . .
+x3
2+ . . .
= x +x2
2+
x3
3+
3x5
40+ . . . − 1 < x ≤ 1
(You must take care not to miss relevant terms when carrying through the multiplication).
The Maclaurin expansion of a product of two functions: f(x)g(x) is obtained by multiplyingtogether the Maclaurin expansions of f(x) and of g(x) and collecting like terms together. Theproduct series will have a radius of convergence equal to the smaller of the two separate radiiof convergence.
Try each part of this exercise
Find the Maclaurin expansion of cos2 x up to powers of x4. Hence write down the expansion ofsin2 x to powers of x6.
Part (a) First, write down the expansion of cosx
Answer
Part (b) Now, by multiplication, find the expansion of cos2 x. (The reader could try to obtainthe power series expansion for cos2 x by using the trigonometric identity cos2 x = 1
2(1+cos 2x)).
Answer
Part (c) Now obtain the expansion of sin2 x.
Answer
5 Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
3. Differentiation of Maclaurin SeriesWe have already noted that, by the binomial series,
1
1 − x= 1 + x + x2 + x3 + . . . |x| < 1
Thus, with x replaced by −x
1
1 + x= 1 − x + x2 − x3 + . . . |x| < 1
Also, we have obtained the Maclaurin expansion of ln(1 + x):
ln(1 + x) = x − x2
2+
x3
3− x4
4+ . . . − 1 < x ≤ 1
Now, we differentiate both sides with respect to x:
1
1 + x= 1 − x + x2 − x3+
This demonstrates that the Maclaurin expansion of a function f(x) may be differentiated termby term to give a series which will be the Maclaurin expansion of df
dx.
As we noted in block 4 the derived series will have the same radius of convergence as the originalseries.
Try each part of this exercise
Find the Maclaurin expansion of (1 − x)−3.
Part (a) First write down the expansion of (1 − x)−1
Answer
Part (b) Now, by differentiation, obtain the expansion of 1(1−x)2
Answer
Part (c) Differentiate again to obtain the expansion of (1 − x)−3.
Answer
The final series: 1 + 3x + 6x2 + 10x3 + . . . has radius of convergence R = 1 since the originalseries, before differentiation, has this radius of convergence (but this can also be found directly
using the formula R = limn→∞
∣∣∣∣ an
an+1
∣∣∣∣ and using the fact that the coefficient of the nth term is
an = 12n(n + 1)).
Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
6
4. The Taylor SeriesThe Taylor series is a generalisation of the Maclaurin series being a power series developed inpowers of (x − x0) rather than in powers of x. Thus
Key Point
If the function f(x) can be differentiated as often as we please at x = x0 then:
f(x) = f(x0) + (x − x0)f′(x0) +
(x − x0)2
2!f ′′(x0) + . . .
This is called the Taylor series of f(x) about the point x0.
The reader will see that the Maclaurin expansion is obtained if x0 is chosen to be zero.
Try each part of this exercise
Obtain the Taylor series expansion of 11−x
about x = 2. (That is, find a power series in powersof (x − 2)).
Part (a) First, obtain the derivatives of f(x) = 11−x
Answer
Part (b) Now evaluate these derivatives at x0 = 2.
Answer
Part (c) Hence, write down the Taylor expansion of f(x) = 11−x
about x = 2
Answer
The reader should confirm that this series is convergent if |x− 2| < 1. In the diagram followingsome of the terms from the Taylor series are plotted to compare with 1
(1−x).
y
x
y
x
y
x
1
1 − x
−1 + (x − 2) −1 + (x − 2) − (x − 2)2
−1 + (x − 2) − (x − 2)2 + (x − 2)3
1 2
1
1 − x
1
1 − x
1 2 1 2
7 Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
5. Computer Exercise or Activity
For this exercise it will be necessary for you toaccess the computer package DERIVE.
DERIVE can be used to obtain the Maclaurin series expansion of most functions. For example toobtain the Maclaurin expansion of 1
(1−x)we would key Author: Expression 1/(1−x). DERIVE
responds with
1
1 − x.
Now key Calculus:Taylor series. In the box presented choose x as Variable, then 0 as theExpansion Point and (say) 5 as Order. Then on hitting the Simplify button DERIVE responds
x5 + x4 + x3 + x2 + x + 1
as expected.To obtain a Taylor series (i.e. expansion about some point other than 0) is a straightforwardexercise; just choose the appropriate value for the Expansion Point. However, note that DERIVEalways presents the Taylor series in powers of x (which is not the way we have presented theexpansion in the text). You need to be a little careful here. If you want the Taylor expansion of(say) 1
1−xabout the point x = 2 to order (say) 5 then DERIVE will obtain the expression (as
we have in the text)
1
1 − x= −1 + (x − 2) − (x − 2)2 + (x − 2)3 − (x − 2)4 + (x − 2)5
and then expand this to present it as:
x5 − 11 · x4 + 49 · x3 − 111 · x2 + 129 · x − 63
The coefficients of the powers of x will necessarily change as the order changes. For exampleto expand the same function about the same point (x = 2) to order 6 will produce the responsefrom DERIVE:
−x6 + 13 · x5 − 71 · x4 + 209 · x3 − 351 · x2 + 321 · x − 127
which is the expanded form of
−1 + (x − 2) − (x − 2)2 + (x − 2)3 − (x − 2)4 + (x − 2)5 − (x − 2)6
Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
8
End of Block 16.5
9 Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
f ′(x) =1
1 + x, f ′′(x) =
−1
(1 + x)2, f ′′′(x) =
2
(1 + x)3, f (n)(x) =
(−1)n+1(n − 1)!
(1 + x)n
Back to the theory
Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
10
f(0) = 0 f ′(0) = 1, f ′′(0) = −1, f ′′′(0) = 2, f (n)(0) = (−1)n+1(n − 1)!
Back to the theory
11 Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
ln(1 + x) = x − x2
2+
x3
3, . . . +
(−1)n+1
nxn + . . . This has already been obtained in Block 16.4.
Back to the theory
Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
12
R = 1. Also at x = 1 the series is convergent (alternating harmonic series) and at x = −1 theseries is divergent. Hence this Maclaurin exapnsion is only valid if −1 < x ≤ 1. Thegeometrical closeness of the polynomial terms with the function ln(1 + x) for −1 < x ≤ 1 aredisplayed in the following diagram.
y
x
y
x
y
x
x
x − x2
2
x − x2
2+
x3
3
ln(1 + x) ln(1 + x) ln(1 + x)
Back to the theory
13 Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
cos x = 1 − x2
2!+ x4
4!+ . . .
Back to the theory
Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
14
cos2 x =(1 − x2
2!+ x4
4!. . .
) (1 − x2
2!+ x4
4!. . .
)
= (1 − x2
2!+ x4
4!. . . ) + (−x2
2!+ x4
4. . . ) + (x4
4!. . . ) + · · · = 1 − x2 + x4
3− 2x6
45. . .
Back to the theory
15 Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
sin2 x = 1 − cos2 x = 1 −(1 − x2 + x4
3− 2x6
45+ . . .
)= x2 − x4
3+ 2x6
45+ . . .
Back to the theory
Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
16
11−x
= 1 + x + x2 + . . . |x| < 1
Back to the theory
17 Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
1(1−x)2
= ddx
(1 + x + x2 + . . . ) = 1 + 2x + 3x2 + 4x3
Back to the theory
Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
18
1(1−x)3
= 12
ddx
(1
(1−x)2
)= 1
2[2 + 6x + 12x2 + . . . ] = 1 + 3x + 6x2 + 10x3 + . . .
Back to the theory
19 Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
f ′(x) = 1(1−x)2
, f ′′(x) = 2(1−x)3
, . . . f (n)(x) = n!(1−x)n+1
Back to the theory
Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
20
f ′(2) = 1, f ′′(2) = −2, . . . f (n)(2) = (−1)n+1n!
Back to the theory
21 Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
11−x
= −1 + (x − 2) − (x − 2)2 + (x − 2)3 + . . .
Back to the theory
Engineering Mathematics: Open Learning Unit Level 116.5: Power Series and Taylor Series
22