Lecture 13

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Lecture 13: Taylor and Maclaurin Series

Today: Taylor’s Theorem, Taylor Series, Maclaurin Series

Let’s start our discussion with a function that can be represented by a power series. Suppose
that ∞
X
f (x) = cn (x − a)n = c0 + c1 (x − a) + c2 (x − a)2 + c3 (x − a)3 + · · ·
n=0

We first notice that


f (a) = c0 .
Now by Theorem 38, we can find the derivative of f (x) by differentiating the individual
terms of the power series.

X
f 0 (x) = ncn (x − a)n−1
n=1

Notice that the derivative is also a power series, so we can proceed to compute all of its
higher derivatives.

X
00
f (x) = n(n − 1)cn (x − a)n−2
n=2

X
f 000 (x) = n(n − 1)(n − 2)cn (x − a)n−3
n=3

······

X
(k)
f (x) = n(n − 1) · · · (n − k + 1)cn (x − a)n−k
n=k

When we evaluate the derivatives at a, we get the constant term in each power series

f 0 (a) = 1 · c1 , f 00 (a) = 2 · 1 · c2 , f 000 (a) = 3 · 2 · 1 · c3 , ... f (k) (a) = k! · ck

Solving the equation for the k-th coefficient ck , we get

f (k) (a)
ck =
k!
We have proved the following theorem.

Theorem 39. If f has a power series expansion at a with radius of convergence R > 0, that
is,

X
f (x) = cn (x − a)n for all |x − a| < R,
n=0

92
then its coefficients are given by the formula

f (n) (a)
cn = .
n!
Remark. Substituting thiss formula back into the series, we see that if f has a power series
expansion at a, then it must be of the form

X f (n) (a)
f (x) = (x − a)n
n=0
n!
f 0 (a) f 00 (a) f 000 (a)
= f (a) + (x − a) + (x − a)2 + (x − a)3 + · · ·
1! 2! 3!
Definition. The series ∞
X f (n) (a)
(x − a)n
n=0
n!
is called the Taylor series of the function f at a. When a = 0, the series becomes

X f (n) (0)
xn ,
n=0
n!

and is given the special name Maclaurin series.

Example. We have seen in the previous lecture that



X
x xn
e = .
n=0
n!

is a power series expansion of the exponential function f (x) = ex . The power series is
centered at 0. The derivatives f (k) (x) = ex , so f (k) (0) = e0 = 1. So the Taylor series of the
function f at 0, or the Maclaurin series of f , is

X xn
,
n=0
n!

which agrees with the power series definition of the exponential function.

Definition. If f (x) is the sum of its Taylor series expansion, it is the limit of the sequence
of partial sums
Xn
f (k) (a)
Tn (x) = (x − a)k .
k=0
k!
We call the n-th partial sum the n-th-degree Taylor polynomial of f at a.

93
One important application of Taylor series is to approximate a function by its Taylor poly-
nomials. This is very useful in physics and engineering, where people only need a good
approximation for most scenarios, and polynomials are usually much easier to deal with
than a transcendental function. The following theorem justifies the use of Taylor polynomi-
als for function approximation.
Theorem 40 (Taylor’s Theorem). Let n ≥ 1 be an integer, and let a ∈ R be a point. If f (x)
is a function that is n times differentiable at the point a, then there exists a function hn (x)
such that
f (x) = Tn (x) + hn (x)(x − a)n , where lim hn (x) = 0.
x→a
The term
Rn (x) = f (x) − Tn (x) = hn (x)(x − a)n
is called the Peano form of the remainder.

Sometimes we would like a better estimate on the remainder term, so that we could have a
better understanding of how good the Taylor polynomials approximate the original functions.
However, we can only do this under stronger regularity assumptions on f (x).
Theorem 41 (Lagrange Form of the Remainder). Let n ≥ 1 be an integer, and let a ∈ R
be a point. If f (x) is a function that is n + 1 times differentiable on an open interval I
containing a, then for all x ∈ I, there exists a number z strictly between a and x such that
f (n+1) (z)
Rn (x) = (x − a)n+1
(n + 1)!
This is the Lagrange form of the remainder.
Example. Find the Maclaurin series for f (x) = sin(x), and show that its sum equals sin(x).
First, we need to find the derivatives of f (x) at 0:
f (x) = sin(x), f (0) = 0,
0
f (x) = cos(x), f 0 (0) = 1,
f 00 (x) = − sin(x), f 00 (0) = 0,
f 000 (x) = − cos(x), f 000 (0) = −1,
f (4) (x) = sin(x), f (4) (0) = 0,
······ ······
The derivatives repeat in a 4-cycle, so we can write the Maclaurin series as
f 0 (0) f 00 (0) 2 f 000 (0) 3 f (4) (0) 4
f (0) + x+ x + x + x + ···
1! 2! 3! 4!
X∞
x3 x5 x7 (−1)n 2n+1
= x− + − + ··· = x .
3! 5! 7! n=0
(2n + 1)!

94
Use Ratio Test to find its radius of convergence:

(−1)n+1 x2n+3 (−1)n x2n+1 |x|2
lim = lim =0
n→∞ (2n + 3)! (2n + 1)! n→∞ (2n + 3)(2n + 2)

for all x ∈ R. Thus the radius of convergence R = ∞.


To show that the sum of the Maclaurin series equals to the function f (x) = sin(x), we
consider the n-th remainder term in Lagrange form

f (n+1) (z) n+1


Rn (x) = x ,
(n + 1)!

where z is a number strictly between 0 and x. Notice that f (n+1) (z) is a sine function or a
cosine function, so |f (n+1) (z)| ≤ 1. Then we have

xn+1 xn+1
− ≤ Rn (x) ≤
(n + 1)! (n + 1)!

However, we know that


xn+1
lim =0
n→∞ (n + 1)!

for all x ∈ R, so by Squeeze Theorem,

lim Rn (x) = 0
n→∞

for all x ∈ R. But since Rn (x) = f (x) − Tn (x), this implies that the Taylor polynomials
converges to f (x) for all x ∈ R, i.e., the sum of the Maclaurin series equals f (x) = sin(x).

Example. Find the Taylor series for f (x) = ex at a = 1.


All derivatives of f (x) are ex , so f (n) (1) = e for all n ≥ 0. Thus its Taylor series at 1 is

X∞
e
(x − 1)n
n=0
n!

with radius of convergence R = ∞. The following transformation verifies that we found the
right expression for the Taylor series:

X X∞
x x−1 (x − 1)n e
e =e·e =e = (x − 1)n .
n=0
n! n=0
n!

Exercise. Find the Maclaurin series of f (x) = cos(x).

95
First, we find the derivatives of f (x) at 0:

f (x) = cos(x), f (0) = 1,


f 0 (x) = − sin(x), f 0 (0) = 0,
f 00 (x) = − cos(x), f 00 (0) = −1,
f 000 (x) = sin(x), f 000 (0) = 0,
f (4) (x) = cos(x), f (4) (0) = 1,
······ ······

The derivatives repeat in a 4-cycle, so we can write the Maclaurin series as

f 0 (0) f 00 (0) 2 f 000 (0) 3 f (4) (0) 4


f (0) + x+ x + x + x + ···
1! 2! 3! 4!
X∞
x 2 x4 x6 (−1)n 2n
= 1− + − + ··· = x .
2! 4! 6! n=0
(2n)!

We can verify by Ratio Test to see that its radius of convergence is R = ∞.


We can use the Lagrange form of the remainder to prove that the Maclaurin series converges
to the function f (x) = cos(x) for all x ∈ R. The detail is left as an exercise.

Example. Find the Maclaurin series for f (x) = x cos(x).


We know that the Maclaurin series for cos(x) is

X (−1)n
cos(x) = x2n
n=0
(2n)!

Thus ∞ ∞
X (−1)n X (−1)n
2n
f (x) = x cos(x) = x x = x2n+1 .
n=0
(2n)! n=0
(2n)!
2
Example. Find the Maclaurin series for f (x) = e−x .
We know that the Maclaurin series for the exponential function eu is

X un
eu =
n=0
n!

Substitute u = −x2 in the expression above, we get



X ∞
X
2 (−x2 )n (−1)n
e−x = = x2n .
n=0
n! n=0
n!

96
Remark. The Taylor series / Maclaurin series of a infinitely differentiable function does not
necessarily equal to the original function. A proof is required to show that they are equal (or
not equal) for a function under consideration. We used the Lagrange form of the remainder
to prove it for sin(x) and used the differential equation method to prove it for ex .

We collect the following table of important Maclaurin series for reference.

Function Maclaurin Series



X
1
xn = 1 + x + x2 + x 3 + · · · R=1
1−x n=0

X xn x x2 x3
ex =1+ + + + ··· R=∞
n=0
n! 1! 2! 3!
X∞
(−1)n 2n+1 x3 x5 x7
sin(x) x =x− + − + ··· R=∞
n=0
(2n + 1)! 3! 5! 7!
X∞
(−1)n 2n x2 x4 x6
cos(x) x =1− + − + ··· R=∞
n=0
(2n)! 2! 4! 6!
X∞
(−1)n 2n+1 x3 x5 x7
arctan(x) x =x− + − + ··· R=1
n=0
(2n + 1) 3 5 7

X (−1)n−1 x2 x3 x4
ln(1 + x) xn = x − + − + ··· R=1
n=1
n 2 3 4

One application of Taylor series is to justify the use of L‘Hôpital’s Rule.


sin(x)
Example. Find the limit lim .
x→0 x
We could evaluate the limit with L‘Hôpital’s Rule, but let’s use the Maclaurin series instead.

x3 x5 x7
sin(x) x− + − + ···  x2 x4 x6 
lim = lim 3! 5! 7! = lim 1 − + − + · · · = 1.
x→0 x x→0 x x→0 3! 5! 7!
The result agrees with the answer we get from L‘Hôpital’s Rule:

sin(x) cos(x) cos(0)


lim = lim = = 1.
x→0 x x→0 1 1

Another important application of Taylor series is that they enable us to integrate functions
that we previous could not handle.

97
Z
2
Example. Evaluate e−x dx as an infinite series.

We know the Maclaurin series for the integrand is



X
−x2 (−1)n
e = x2n
n=0
n!

with radius of convergence R = ∞. Using term-by-term integration, we get


Z ∞
X
2 (−1)n
e−x dx = C + x2n+1
n=0
n!(2n + 1)

with radius of convergence R = ∞.

98

You might also like