1014L1 Note 9
1014L1 Note 9
L1 (Spring 2024)
In chapter 8, we have used a power series to construct a function which is defined on the interval
of convergence. We have seen that the sum of a power series can sometimes be written in a
“closed form”, e.g.
1
1 + 𝑥 + 𝑥2 + 𝑥3 + ⋯ = for every 𝑥 ∈ (−1, 1),
1−𝑥
1 1 1
𝑥 − 𝑥 2 + 𝑥 3 − 𝑥 4 + ⋯ = ln(1 + 𝑥) for every 𝑥 ∈ (−1, 1].
2 3 4
In this chapter, we first study the opposite problem: Given any function,
Can this function be “expressed as” a power series? Or equivalently,
Is this function the sum of a certain power series?
Let’s begin by approximating a function by polynomial (which is a “finite” version of power series).
Recall that in chapter 3 we have learnt about the linear approximation of a function.
Definition 3.71 Let 𝑎 be a real number and 𝑓 be a function which is differentiable at 𝑎. The
linear polynomial 𝐿 defined by
𝐿(𝑥) = 𝑓(𝑎) + 𝑓 ′ (𝑎)(𝑥 − 𝑎)
is called the linear approximation (or the linearization) of 𝑓 at 𝑎.
𝑦 = 𝐿(𝑥)
𝑦 = 𝑓(𝑥)
The linear approximation is a “good” approximation of the values 𝑓(𝑥) when 𝑥 is close to 𝑎,
because when 𝑥 ≈ 𝑎 the difference |𝑓(𝑥) − 𝐿(𝑥)| is small compared with the distance |𝑥 − 𝑎|:
|𝑓(𝑥) − 𝐿(𝑥)| 𝑓(𝑥) − 𝑓(𝑎) 𝐿(𝑥) − 𝑓(𝑎)
lim = lim | − | = |𝑓 ′ (𝑎) − 𝑓 ′ (𝑎)| = 0.
𝑥→𝑎 |𝑥 − 𝑎| 𝑥→𝑎 𝑥−𝑎 𝑥−𝑎
Definition 9.1 Let 𝑎 be a real number, let 𝑓 be a function that is defined near 𝑎, and let 𝑛 be
a non-negative integer. An 𝒏th order approximation of 𝑓 at 𝑎 is a polynomial 𝑃𝑛 of degree at
most 𝑛 such that
This is equivalent to
𝑓(𝑥) − 𝑃𝑛 (𝑥)
lim = 0. |𝑓(𝑥) − 𝑃𝑛 (𝑥)|
𝑥→𝑎 (𝑥 − 𝑎)𝑛 lim
𝑥→𝑎 |𝑥 − 𝑎|𝑛
= 0.
Page 1 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
Definition 9.2 Let 𝑎 be a real number and let 𝑓 and 𝑔 be functions that are defined near 𝑎.
In numerical analysis and computer science, it is customary to write the little-o notation
𝑓(𝑥) = 𝑜(𝑔(𝑥)) as 𝑥 → 𝑎
if
𝑓(𝑥)
lim = 0.
𝑥→𝑎 𝑔(𝑥)
Remark 9.3 It is important to note that the “equal sign” in the little-o notation is not really an
equal sign. To be precise, when
𝑓1 (𝑥) = 𝑜(𝑔(𝑥)) and 𝑓2 (𝑥) = 𝑜(𝑔(𝑥)) as 𝑥 → 𝑎,
we DO NOT have 𝑓1 (𝑥) = 𝑓2 (𝑥) in general.
The equal sign in the little-o notation should better be understood as “set belonging”. The
notation 𝑓(𝑥) = 𝑜(𝑔(𝑥)) as 𝑥 → 𝑎 means that 𝑓 belongs to the set of all functions which
𝑓(𝑥)
satisfy lim 𝑔(𝑥) = 0, i.e. the set of all functions that “decay faster” than 𝑔 as 𝑥 → 𝑎.
𝑥→𝑎
Example 9.4 Let 𝑓: ℝ → ℝ be a polynomial of degree 𝑚. Then for every 𝑛 ≥ 𝑚, 𝑓 is its own
𝑛th order approximation at every 𝑎 ∈ ℝ, because
𝑓(𝑥) − 𝑓(𝑥)
lim = 0.
𝑥→𝑎 (𝑥 − 𝑎)𝑛
1
Example 9.5 Let 𝑓(𝑥) = cos 𝑥. Then the quadratic polynomial 𝑃2 (𝑥) = 1 − 2 𝑥 2 is a second
−2𝜋 −𝜋 0 𝜋 2𝜋
𝑦 = cos 𝑥
−1 1
𝑦 = 1 − 𝑥2
2
1
𝑦 = 1 − 𝑥2 𝜋
2
− 0 𝜋
2 2
Page 2 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
sin 𝑥 − 𝑥
=0 lim
𝑥→0 𝑥
and so 𝑃1 (𝑥) = 𝑥 is a first order approximation of 𝑓 at 0.
sin 𝑥−𝑥 1
By ľHôpital’s rule we observe that lim = − 6, so
𝑥→0 𝑥3
sin 𝑥 − (𝑥 − (1/6)𝑥 3 )
lim = 0;
𝑥→0 𝑥3
1
and so 𝑃3 (𝑥) = 𝑥 − 6 𝑥 3 is a third order approximation of 𝑓 at 0. We may write
1
sin 𝑥 = 𝑥 − 𝑥 3 + 𝑜(𝑥 3 ) as 𝑥 → 0.
6
𝑦 = sin 𝑥
1
1
1
𝑦 = sin 𝑥 𝑦 = 𝑥 − 𝑥3
6
−2𝜋 −𝜋 0 𝜋 2𝜋 −
𝜋 0 𝜋
2 2
−1
1
𝑦 = 𝑥 − 𝑥3 −1
6
Proof. Suppose that 𝑃𝑛 and 𝑄𝑛 are both 𝑛th order approximations of 𝑓 at 𝑎. Then
𝑓(𝑥) − 𝑃𝑛 (𝑥) 𝑓(𝑥) − 𝑄𝑛 (𝑥)
lim = lim = 0.
𝑥→𝑎 (𝑥 − 𝑎)𝑛 𝑥→𝑎 (𝑥 − 𝑎)𝑛
This implies that
𝑃𝑛 (𝑥) − 𝑄𝑛 (𝑥) 𝑓(𝑥) − 𝑄𝑛 (𝑥) 𝑓(𝑥) − 𝑃𝑛 (𝑥)
lim 𝑛
= lim 𝑛
− lim = 0.
𝑥→𝑎 (𝑥 − 𝑎) 𝑥→𝑎 (𝑥 − 𝑎) 𝑥→𝑎 (𝑥 − 𝑎)𝑛
Since 𝑃𝑛 − 𝑄𝑛 is a polynomial, the above limit implies that it must be a multiple of (𝑥 − 𝑎)𝑛+1.
But 𝑃𝑛 − 𝑄𝑛 has degree at most 𝑛, so it must be the zero polynomial. ∎
Page 3 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
So
𝑓(𝑥) − 𝑃𝑚 (𝑥) 𝑓(𝑥) − 𝑃𝑛 (𝑥) 𝑓(𝑥) − 𝑃𝑛 (𝑥)
lim 𝑚
= lim 𝑚
= lim ( ⋅ (𝑥 − 𝑎)𝑛−𝑚 ) = 0.
𝑥→𝑎 (𝑥 − 𝑎) 𝑥→𝑎 (𝑥 − 𝑎) 𝑥→𝑎 (𝑥 − 𝑎)𝑛
This shows that 𝑃𝑚 is an 𝑚th order approximation of 𝑓 at 𝑎; by Lemma 9.7 it is the only one. ∎
Example 9.9 Let 𝑓(𝑥) = 𝑥 3 . The 𝑛th order approximations of 𝑓 at 0 are given by
𝑃0 (𝑥) = 0, 𝑃1 (𝑥) = 0, 𝑃2 (𝑥) = 0, 𝑃3 (𝑥) = 𝑥 3 , 𝑃4 (𝑥) = 𝑥 3 , 𝑃5 (𝑥) = 𝑥 3 ,
and so on. To find the 𝑛th order approximations of 𝑓 at 1, we note that
3
𝑥 3 = (1 + (𝑥 − 1)) = 1 + 3(𝑥 − 1) + 3(𝑥 − 1)2 + (𝑥 − 1)3 .
𝑓(𝑥)−𝑃𝑛 (𝑥)
Proof. We have lim = 0. With a change of variables that replaces 𝑥 by −𝑥, we have
𝑥→0 𝑥𝑛
𝑓(−𝑥) − 𝑃𝑛 (−𝑥)
lim = 0.
𝑥→0 𝑥𝑛
If 𝑓 is an even function, i.e. 𝑓(−𝑥) = 𝑓(𝑥) for all 𝑥, then
𝑓(𝑥) − 𝑃𝑛 (−𝑥)
lim = 0,
𝑥→0 𝑥𝑛
which shows that 𝑃𝑛 (−𝑥) = 𝑃𝑛 (𝑥) since the 𝑛th order approximation is unique. The case when
𝑓 is an odd function is similar. ∎
Page 4 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
Theorem 9.11 (Taylor) Let 𝑎 be real number, 𝑛 be a non-negative integer and 𝑓 be a function
which is 𝑛-times differentiable at 𝑎. Then the polynomial
𝑛
𝑓 (𝑘) (𝑎)
𝑃𝑛 (𝑥) = ∑ (𝑥 − 𝑎)𝑘 ,
𝑘!
𝑘=0
called the 𝒏th degree Taylor polynomial of 𝒇 at 𝒂, is the 𝑛th order approximation of 𝑓 at 𝑎; i.e.
𝑓 ′′ (𝑎) 𝑓 (𝑛) (𝑎)
𝑓(𝑥) = 𝑓(𝑎) + 𝑓 ′ (𝑎)(𝑥 − 𝑎) + (𝑥 − 𝑎)2 + ⋯ + (𝑥 − 𝑎)𝑛 + 𝑜(𝑥 − 𝑎)𝑛
2! 𝑛!
as 𝑥 → 𝑎.
Example 9.12 Let 𝑓(𝑥) = 𝑒 𝑥 . Then for every non-negative integer 𝑛, we have 𝑓 (𝑛) (𝑥) = 𝑒 𝑥
so that 𝑓 (𝑛) (0) = 1. Therefore the 𝑛th degree Taylor polynomial of 𝑓 at 0 is given by
1 2 1 3 1
𝑃𝑛 (𝑥) = 1 + 𝑥 + 𝑥 + 𝑥 + ⋯ + 𝑥𝑛.
2! 3! 𝑛!
By Taylor’s Theorem, we have
1 2 1 3 1
𝑒𝑥 = 1 + 𝑥 + 𝑥 + 𝑥 + ⋯ + 𝑥 𝑛 + 𝑜(𝑥 𝑛 ) as 𝑥 → 0.
2! 3! 𝑛!
1
Example 9.13 Let 𝑓(𝑥) = ln(1 + 𝑥). Then 𝑓 ′ (𝑥) = 1+𝑥, and by induction we obtain
(𝑛 − 1)!
𝑓 (𝑛) (𝑥) = (−1)𝑛−1
(1 + 𝑥)𝑛
for each 𝑛 ∈ ℕ, so 𝑓 (𝑛) (0) = (−1)𝑛−1 (𝑛 − 1)!. Therefore the 𝑛th degree Taylor polynomial of
𝑓 at 0 is given by
1 1 1 (−1)𝑛−1 𝑛
𝑃𝑛 (𝑥) = 𝑥 − 𝑥 2 + 𝑥 3 − 𝑥 4 + ⋯ + 𝑥 .
2 3 4 𝑛
By Taylor’s Theorem, we have
1 2 1 3 1 4 (−1)𝑛−1 𝑛
ln(1 + 𝑥) = 𝑥 − 𝑥 + 𝑥 − 𝑥 + ⋯ + 𝑥 + 𝑜(𝑥 𝑛 ) as 𝑥 → 0.
2 3 4 𝑛
Example 9.14 Let 𝑝 ∈ ℝ and let 𝑓(𝑥) = (1 + 𝑥)𝑝 . Then for each non-negative integer 𝑛,
𝑓 (𝑛) (𝑥) = 𝑝(𝑝 − 1)(𝑝 − 2) ⋯ (𝑝 − 𝑛 + 1)(1 + 𝑥)𝑝−𝑛 ;
so 𝑓 (𝑛) (0) = 𝑝(𝑝 − 1)(𝑝 − 2) ⋯ (𝑝 − 𝑛 + 1). Therefore the 𝑛th degree Taylor polynomial of 𝑓
at 0 is given by
𝑝(𝑝 − 1) 2 𝑝(𝑝 − 1)(𝑝 − 2) 3 𝑝(𝑝 − 1)(𝑝 − 2) ⋯ (𝑝 − 𝑛 + 1) 𝑛
𝑃𝑛 (𝑥) = 1 + 𝑝𝑥 + 𝑥 + 𝑥 +⋯+ 𝑥 .
2! 3! 𝑛!
Page 5 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
In particular:
In case 𝑝 = −1, by Taylor’s Theorem we have for each non-negative integer 𝑛,
1
= 1 − 𝑥 + 𝑥 2 − 𝑥 3 + ⋯ + (−1)𝑛 𝑥 𝑛 + 𝑜(𝑥 𝑛 ) as 𝑥 → 0.
1+𝑥
In case 𝑝 = 1/2, by Taylor’s Theorem we have
1 1 1 3
√1 + 𝑥 = 1 + 𝑥 − 𝑥 2 + 𝑥 + 𝑜(𝑥 3 ) as 𝑥 → 0.
2 8 16
We can in turn extract information about 𝒇(𝒏) from the Taylor polynomials of 𝑓.
1
Example 9.15 Consider the function 𝑓(𝑥) = 1+𝑥 2. From Example 9.14 we have seen that
1
= 1 − 𝑥 + 𝑥 2 − 𝑥 3 + ⋯ + (−1)𝑛 𝑥 𝑛 + 𝑜(𝑥 𝑛 ) as 𝑥 → 0.
1+𝑥
Thus
1
= 1 − 𝑥 2 + 𝑥 4 − 𝑥 6 + ⋯ + (−1)𝑛 𝑥 2𝑛 + 𝑜(𝑥 2𝑛 ) as 𝑥 → 0.
1 + 𝑥2
Now by Taylor’s Theorem, the above polynomial 1 − 𝑥 2 + 𝑥 4 − 𝑥 6 + ⋯ + (−1)𝑛 𝑥 2𝑛 is identical to
𝑓 ′′ (0) 2 𝑓 (2𝑛) (0) 2𝑛
𝑃2𝑛 (𝑥) = 𝑓(0) + 𝑓 ′ (0)𝑥 + 𝑥 + ⋯+ 𝑥 .
2! (2𝑛)!
Comparing coefficients, we conclude that for every non-negative integer 𝑚,
𝑓 (2𝑚) (0) = (2𝑚)! (−1)𝑚 and 𝑓 (2𝑚+1) (0) = 0.
Note how tedious it would be if we compute 𝑓 (𝑛) (0) by directly differentiating 𝑓 for 𝑛 times.
1
Example 9.17 Let 𝑓(𝑥) = arctan 𝑥. Then 𝑓 ′ (𝑥) = 1+𝑥 2, so from Example 9.15 we conclude that
Page 6 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
Example 9.19 Let 𝑓(𝑥) = sin 𝑥. The successive derivatives of 𝑓 are given by
𝑓(𝑥) = sin 𝑥 𝑓(0) = 0
𝑓 ′ (𝑥) = cos 𝑥 𝑓 ′ (0) = 1
𝑓 ′′ (𝑥) = − sin 𝑥 𝑓 ′′ (0) = 0
𝑓 ′′′ (𝑥) = − cos 𝑥 𝑓 ′′′ (0) = −1
𝑓 (4) (𝑥) = sin 𝑥 𝑓 (4) (0) = 0
𝑓 (5) (𝑥) = cos 𝑥 𝑓 (5) (0) = 1
and so on. So by Taylor’s Theorem, for each non-negative integer 𝑛 we have
1 3 1 5 1 7 (−1)𝑛 2𝑛+1
sin 𝑥 = 𝑥 − 𝑥 + 𝑥 − 𝑥 +⋯+ 𝑥 + 𝑜(𝑥 2𝑛+2 ) as 𝑥 → 0.
3! 5! 7! (2𝑛 + 1)!
Note that there are no terms of even powers because sin is odd. By Corollary 9.18, we also have
1 2 1 4 1 6 (−1)𝑛 2𝑛
cos 𝑥 = 1 − 𝑥 + 𝑥 − 𝑥 + ⋯+ 𝑥 + 𝑜(𝑥 2𝑛+1 ) as 𝑥 → 0.
2! 4! 6! (2𝑛)!
Evaluating limits using Taylor’s Theorem sometimes helps avoid the repeated use of ľHôpital’s rule.
Solution: [Instead of applying ľHôpital’s rule four times, let’s use Taylor’s Theorem instead.]
According to Taylor’s Theorem, the fourth order approximation of the numerator at 0 is given by
(sin 𝑥)2 (sin 𝑥)4 𝑥2 𝑥4
cos(sin 𝑥) − cos 𝑥 = [1 − + + 𝑜(sin 𝑥)] − [1 − + + 𝑜(𝑥 4 )]
4
2! 4! 2! 4!
2 4
1 𝑥3 1 𝑥3 𝑥2 𝑥4
= [1 − (𝑥 − + 𝑜(𝑥 3 )) + (𝑥 − + 𝑜(𝑥 3 )) ] − (1 − + ) + 𝑜(𝑥 4 )
2! 3! 4! 3! 2! 4!
1 𝑥4 1 𝑥2 𝑥4 1
= (1 − (𝑥 2 − ) + 𝑥 4 ) − (1 − + ) + 𝑜(𝑥 4 ) = 𝑥 4 + 𝑜(𝑥 4 ) Ignore all the terms
2 3 24 2 24 6 in 𝑥 5 or higher.
as 𝑥 → 0. Therefore
cos(sin 𝑥) − cos 𝑥 (1/6)𝑥 4 + 𝑜(𝑥 4 ) 1
lim = lim = .
𝑥→0 𝑥4 𝑥→0 𝑥4 6
Page 7 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
Solution:
Writing sin 𝑥 and cos 𝑥 into their 5th degree Taylor polynomials at 0, we have
1 3 1 5 5
sin 𝑥 𝑥 − 6 𝑥 + 120 𝑥 + 𝑜(𝑥 )
tan 𝑥 = = as 𝑥 → 0.
cos 𝑥 1 2 1 4 5
1 − 2 𝑥 + 24 𝑥 + 𝑜(𝑥 )
To handle the denominator, we recall that
1
= 1 + 𝑥 + 𝑥 2 + 𝑥 3 + 𝑜(𝑥 3 ) as 𝑥 → 0.
1−𝑥
1 1
Replacing 𝑥 by 𝑥 2 − 24 𝑥 4 + 𝑜(𝑥 5 ) in the above, we have
2
1 1 5 1 5
tan 𝑥 = (𝑥 − 𝑥 3 + 𝑥 + 𝑜(𝑥 5 )) (1 + 𝑥 2 + 𝑥 4 + 𝑜(𝑥 5 ))
6 120 2 24
1 2
= 𝑥 + 𝑥 3 + 𝑥 5 + 𝑜(𝑥 5 )
3 15
as 𝑥 → 0. Note that the coefficients of the Taylor polynomials of tan 𝑥 do not have a general
formula that is as simple as those of cos 𝑥 and sin 𝑥, because a division of two polynomial
approximations is involved in the computation.
Page 8 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
Definition 9.22 Let 𝑎 be a real number and 𝑓 be a function that is infinitely differentiable at 𝑎.
The power series
+∞
𝑓 (𝑘) (𝑎)
∑ (𝑥 − 𝑎)𝑘
𝑘!
𝑘=0
is called the Taylor series of 𝒇 at 𝒂. The Taylor series of a function 𝑓 at 0 is also called the
Maclaurin series of 𝒇.
Remark 9.23 For each non-negative integer 𝑛, the difference 𝑓 − 𝑃𝑛 between a function 𝑓 and
its 𝑛th degree Taylor polynomial at 𝑎 is called the remainder term,
𝑅𝑛 (𝑥) ≔ 𝑓(𝑥) − 𝑃𝑛 (𝑥).
Taylor’s Theorem in the previous section says that for each fixed 𝑛, we always have lim 𝑅𝑛 (𝑥) = 0.
𝑥→𝑎
Now in this section, we investigate whether for each fixed 𝑥 we always have lim 𝑅𝑛 (𝑥) = 0.
𝑛→+∞
Note that this issue only makes sense for those 𝑥 in the interval of convergence of the power
series in Definition 9.22.
Note that for a certain number 𝑥, if the above limit indeed holds, then we may write
+∞
𝑓 (𝑘) (𝑎)
𝑓(𝑥) = ∑ (𝑥 − 𝑎)𝑘 ,
𝑘!
𝑘=0
1
Example 9.24 Let 𝑓(𝑥) = 1−𝑥. For each non-negative integer 𝑛, we have already found the
Page 9 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
It is in general difficult to find an explicit closed-form expression for the remainder term 𝑅𝑛 (𝑥).
Since we only need to determine for which 𝑥 we have lim 𝑅𝑛 (𝑥) = 0, it is already enough to
𝑛→+∞
i.e.
𝑓 (𝑛+1) (𝑐)
𝑅𝑛 (𝑥) = (𝑥 − 𝑎)𝑛+1 . 𝑐 depends on 𝑛
(𝑛 + 1)! as well.
Proof. Assume without loss of generality that 𝑎 = 0 and 𝑥 > 𝑎. Let 𝐹 be the function
𝑛 𝑛
𝑡 𝑛+1 𝑓 (𝑘) (0) 𝑘 𝑥 𝑛+1 𝑓 (𝑘) (0) 𝑘
𝐹(𝑡) = (𝑓(𝑥) − ∑ 𝑥 )− (𝑓(𝑡) − ∑ 𝑡 ),
(𝑛 + 1)! 𝑘! (𝑛 + 1)! 𝑘!
𝑘=0 𝑘=0
which is continuous on [0, 𝑥] and (𝑛 + 1)-times differentiable on (0, 𝑥). We can check that
𝐹(0) = 𝐹 ′ (0) = 𝐹 ′′ (0) = ⋯ = 𝐹 (𝑛) (0) = 0 and 𝐹(𝑥) = 0.
Applying Rolle’s Theorem to 𝐹, there exists 𝑐1 ∈ (0, 𝑥) such that
𝐹 ′ (𝑐1 ) = 0.
Applying Rolle’s Theorem to 𝐹 ′ , there exists 𝑐2 ∈ (0, 𝑐1 ) such that
𝐹 ′′ (𝑐2 ) = 0.
Applying Rolle’s Theorem to 𝐹 ′′ , 𝐹 ′′′ , …, and finally to 𝐹 (𝑛) , there exists 𝑐 ∈ (0, 𝑐𝑛 ) such that
𝐹 (𝑛+1) (𝑐) = 0.
This is equivalent to
𝑛
𝑓 (𝑘) (0) 𝑘 𝑓 (𝑛+1) (𝑐) 𝑛+1
𝑓(𝑥) = ∑ 𝑥 + 𝑥 ,
𝑘! (𝑛 + 1)!
𝑘=0
as desired. ∎
Remark 9.26 Lagrange’s remainder formula is in fact a generalization of the Mean Value Theorem
(Theorem 4.12). In the case 𝑛 = 0, it reduces to the Mean Value Theorem: For each 𝑥 near 𝑎,
there exists 𝑐 between 𝑎 and 𝑥 such that
𝑓(𝑥) = 𝑓(𝑎) + 𝑓 ′ (𝑐)(𝑥 − 𝑎).
Page 10 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
Example 9.27 Let 𝑎 be a real number and 𝑓 be a function. If 𝑓 (2𝑛+1) is continuous near 𝑎,
𝑓 ′ (𝑎) = 𝑓 ′′ (𝑎) = 𝑓 ′′′ (𝑎) = ⋯ = 𝑓 (2𝑛) (𝑎) = 0 and 𝑓 (2𝑛+1) (𝑎) ≠ 0,
then for every 𝑥 near 𝑎, there exists 𝑐 between 𝑎 and 𝑥 such that
𝑓 (2𝑛+1) (𝑐)
𝑓(𝑥) = 𝑓(𝑎) + (𝑥 − 𝑎)2𝑛+1 ,
(2𝑛 + 1)!
⏟
≠0
Example 9.28 Let 𝑎 be a real number and 𝑓 be a function. If 𝑓 (2𝑛) is continuous near 𝑎,
𝑓 ′ (𝑎) = 𝑓 ′′ (𝑎) = 𝑓 ′′′ (𝑎) = ⋯ = 𝑓 (2𝑛−1) (𝑎) = 0 and 𝑓 (2𝑛) (𝑎) > 0,
then for every 𝑥 near 𝑎, there exists 𝑐 between 𝑎 and 𝑥 such that
𝑓 (2𝑛) (𝑐)
𝑓(𝑥) = 𝑓(𝑎) + (𝑥 − 𝑎)2𝑛 ,
⏟(2𝑛)!
>0
so 𝑓 attains local minimum at 𝑎. The case 𝑛 = 1 is the “second derivative test” in MATH1013.
Example 9.29 Let 𝑓(𝑥) = 𝑒 𝑥 and consider its remainder term at 0. For each non-negative
integer 𝑛 we have 𝑓 (𝑛) (𝑥) = 𝑒 𝑥 . So according to Lagrange’s remainder formula, for each fixed
𝑥 ∈ ℝ there exists 𝑐 between 0 and 𝑥 such that
𝑓 (𝑛+1) (𝑐) 𝑛+1 𝑒𝑐 𝑛+1
𝑒 |𝑥|
|𝑅𝑛 (𝑥)| = | 𝑥 |= |𝑥| ≤ |𝑥|𝑛+1 .
(𝑛 + 1)! (𝑛 + 1)! (𝑛 + 1)!
|𝑥|𝑛+1
Note that 𝑥 is fixed, so lim = 0 (similar to Example 2.22(b)). So by squeeze theorem
𝑛→+∞ (𝑛+1)!
lim 𝑅𝑛 (𝑥) = 0.
𝑛→+∞
Example 9.30 Let 𝑓(𝑥) = sin 𝑥 and consider its remainder term at 0. For each non-negative
integer 𝑛 we have 𝑓 (𝑛+1) (𝑥) = sin 𝑥 or − sin 𝑥 or cos 𝑥 or − cos 𝑥 . So according to
Lagrange’s remainder formula, for each fixed 𝑥 ∈ ℝ there exists 𝑐 between 0 and 𝑥 such that
𝑓 (𝑛+1) (𝑐) 𝑛+1 1
|𝑅𝑛 (𝑥)| = | 𝑥 |≤ |𝑥|𝑛+1 .
(𝑛 + 1)! (𝑛 + 1)!
So similar to the previous example we have lim 𝑅𝑛 (𝑥) = 0 by squeeze theorem. Therefore the
𝑛→+∞
Estimation of the remainder term using Lagrange’s remainder formula is useful only when the size
of 𝑓 (𝑛+1) can be estimated easily. In case such an estimation is too difficult, we may still try to
directly compute the sum of the Taylor series of 𝑓 and see if it equals 𝑓(𝑥).
Example 9.31 Let 𝑓(𝑥) = ln(1 + 𝑥). For each non-negative integer 𝑛 we have
(𝑛+1)
(−1)𝑛 𝑛!
𝑓 (𝑥) = .
(1 + 𝑥)𝑛+1
If we use Lagrange’s remainder formula to estimate the remainder term at 0, we would obtain
𝑓 (𝑛+1) (𝑐) 𝑛+1 1 𝑥 𝑛+1
|𝑅𝑛 (𝑥)| = | 𝑥 |= | | .
(𝑛 + 1)! 𝑛+1 1+𝑐
1
From this we would only be able to show that lim 𝑅𝑛 (𝑥) = 0 if 𝑥 ∈ [− 2 , 1]. However, we
𝑛→+∞
already know from chapter 8, using termwise integration of power series, that
1 1 1
ln(1 + 𝑥) = 𝑥 − 𝑥 2 + 𝑥 3 − 𝑥 4 + ⋯ for 𝑥 ∈ (−1, 1].
2 3 4
Example 9.32 (Binomial series) Let 𝑝 be a real number and let 𝑓(𝑥) = (1 + 𝑥)𝑝 , and consider
the Maclaurin series of 𝑓. For each non-negative integer 𝑛, we have
𝑓 (𝑛) (𝑥) = 𝑝(𝑝 − 1)(𝑝 − 2) ⋯ (𝑝 − 𝑛 + 1)(1 + 𝑥)𝑝−𝑛 .
The estimation of |𝑓 (𝑛) (𝑥)| is too difficult, so instead of analyzing 𝑅𝑛 (𝑥) using Lagrange’s
remainder formula, we try to directly compute the sum of the Maclaurin series of 𝑓,
+∞
𝑝(𝑝 − 1)(𝑝 − 2) ⋯ (𝑝 − 𝑘 + 1) 𝑘
𝑔(𝑥) ≔ ∑ 𝑥 .
𝑘!
𝑘=0
We aim to find all those 𝑥 such that the series 𝑔(𝑥) indeed converges to 𝑓(𝑥). Since the limit
𝑝(𝑝 − 1)(𝑝 − 2) ⋯ (𝑝 − 𝑛 + 1)
|𝑐𝑛 | 𝑛! 𝑛+1
lim = lim | | = lim =1
𝑛→+∞ |𝑐𝑛+1 | 𝑛→+∞ 𝑝(𝑝 − 1)(𝑝 − 2) ⋯ (𝑝 − 𝑛 + 1)(𝑝 − 𝑛) 𝑛→+∞ 𝑛 − 𝑝
(𝑛 + 1)!
exists, it follows that the radius of convergence of the above power series is 1, i.e. the power series
𝑔(𝑥) converges at least on (−1, 1). Using termwise differentiation, one can deduce that
(1 + 𝑥)𝑔′ (𝑥) = 𝑝𝑔(𝑥) for every 𝑥 ∈ (−1, 1).
Now let ℎ(𝑥) = (1 + 𝑥)−𝑝 𝑔(𝑥). Then
ℎ′ (𝑥) = −𝑝(1 + 𝑥)−𝑝−1 𝑔(𝑥) + (1 + 𝑥)−𝑝 𝑔′ (𝑥)
= (1 + 𝑥)−𝑝−1 ⏟
(−𝑝𝑔(𝑥) + (1 + 𝑥)𝑔(𝑥)) = 0
=0
for every 𝑥 ∈ (−1, 1), so ℎ is a constant function on (−1, 1). In other words, there exists a
constant 𝑐 ∈ ℝ such that 𝑔(𝑥) = 𝑐(1 + 𝑥)𝑝 for every 𝑥 ∈ (−1, 1).
Page 12 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
It is left as an exercise for the readers (Q6 of Problem Set 8) whether the above power series
converges at the end-points −1 and 1 of the interval of convergence. It turns out that we have
+∞
ℝ if 𝑝 ∈ ℕ ∪ {0}
𝑝(𝑝 − 1)(𝑝 − 2) ⋯ (𝑝 − 𝑘 + 1) 𝑘 [−1, 1] if 𝑝 ∈ (0, +∞) ∖ ℕ
(1 + 𝑥)𝑝 = ∑ 𝑥 for every 𝑥 ∈ .
𝑘! (−1, 1] if 𝑝 ∈ (−1, 0)
𝑘=0
{(−1, 1) if 𝑝 ∈ (−∞, −1]
Remark 9.33 If 𝑎 and 𝑏 are real numbers with 𝑎 > |𝑏|, then |𝑏/𝑎| < 1; so the above result
implies that for every real number 𝑝,
+∞
𝑝 𝑝
𝑏 𝑝 𝑝
𝑝(𝑝 − 1)(𝑝 − 2) ⋯ (𝑝 − 𝑘 + 1) 𝑏 𝑘
(𝑎 + 𝑏) = 𝑎 (1 + ) = 𝑎 ∑ ( )
𝑎 𝑘! 𝑎
𝑘=0
+∞
𝑝(𝑝 − 1)(𝑝 − 2) ⋯ (𝑝 − 𝑘 + 1) 𝑝−𝑘 𝑘
=∑ 𝑎 𝑏 .
𝑘!
𝑘=0
Remark 9.34 The following is a summary of the Maclaurin series of some elementary functions.
+∞
1
= ∑ 𝑥𝑘 = 1 + 𝑥 + 𝑥2 + 𝑥3 + ⋯ 𝑥 ∈ (−1, 1)
1−𝑥
𝑘=0
+∞
1 𝑘 1 2 1 3
𝑒𝑥 = ∑ 𝑥 =1+𝑥+ 𝑥 + 𝑥 +⋯ 𝑥∈ℝ
𝑘! 2! 3!
𝑘=0
+∞
(−1)𝑘 2𝑘 1 2 1 4 1 6
cos 𝑥 = ∑ 𝑥 =1− 𝑥 + 𝑥 − 𝑥 +⋯ 𝑥∈ℝ
(2𝑘)! 2! 4! 6!
𝑘=0
+∞
(−1)𝑘 2𝑘+1 1 3 1 5 1 7
sin 𝑥 = ∑ 𝑥 =𝑥− 𝑥 + 𝑥 − 𝑥 +⋯ 𝑥∈ℝ
(2𝑘 + 1)! 3! 5! 7!
𝑘=0
+∞
(−1)𝑘 2𝑘+1 1 1 1
arctan 𝑥 = ∑ 𝑥 = 𝑥 − 𝑥3 + 𝑥5 − 𝑥7 + ⋯ 𝑥 ∈ [−1, 1]
2𝑘 + 1 3 5 7
𝑘=0
+∞
(−1)𝑘+1 𝑘 1 1 1
ln(1 + 𝑥) = ∑ 𝑥 = 𝑥 − 𝑥2 + 𝑥3 − 𝑥4 + ⋯ 𝑥 ∈ (−1, 1]
𝑘 2 3 4
𝑘=1
+∞
𝑝(𝑝 − 1) ⋯ (𝑝 − 𝑘 + 1) 𝑘 𝑝(𝑝 − 1) 2
(1 + 𝑥)𝑝 = ∑ 𝑥 = 1 + 𝑝𝑥 + 𝑥 +⋯ See above
𝑘! 2
𝑘=0
Page 13 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
Now by using the table in Remark 9.34 and evaluating the Taylor series of some elementary
function at special values of 𝑥, we can compute the sum of some more series.
Example 9.35 Evaluate the sum of each of the following series, if it converges.
+∞ +∞ +∞
(−1)𝑘−1 1 ⋅ 3 ⋅ 5 ⋅ 7 ⋯ (2𝑘 − 1) 1
(a) ∑ (b) 1 + ∑ (c) ∑
2𝑘 𝑘 𝑘! ⋅ 4𝑘 (2𝑘)!
𝑘=1 𝑘=1 𝑘=0
Solution:
(−1)𝑘−1 (−1)𝑘−1 1 𝑘
(a) The given series ∑+∞
𝑘=1 = ∑+∞
𝑘=1 ( ) is the Maclaurin series of ln(1 + 𝑥)
2𝑘 𝑘 𝑘 2
1 3
evaluated at 2. Therefore its sum is ln 2.
1 1 −1/2
is the Maclaurin series of (1 + 𝑥)−1/2 evaluated at − 2. So its sum is (1 − 2) = √2.
1 (−1)𝑘
(c) Note that ∑+∞ +∞
𝑘=0 𝑘! and ∑𝑘=0 are the Maclaurin series of 𝑒 𝑥 evaluated at 1 and −1
𝑘!
So far, the Taylor series of all the functions 𝑓 we have seen in the previous examples converge back
to 𝑓(𝑥) on its interval of convergence. However in general, the Taylor series of a function may
not converge back to 𝒇(𝒙) even if it converges. The following example shows a function 𝑓
which is infinitely differentiable, and the Maclaurin series of 𝑓 converges at every 𝑥 ∈ ℝ, but not
always to 𝑓(𝑥).
Page 14 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
Solution:
We first compute the successive derivatives of 𝑓 at 0. We have 𝑓(0) = 0. Since
𝑓(𝑥) − 𝑓(0) 𝑒 −1/𝑥 − 0
lim = lim+ = lim 𝑡𝑒 −𝑡 = 0
𝑥→0+ 𝑥 𝑥→0 𝑥 𝑡→+∞
𝑓(𝑥)−𝑓(0)
and lim− = lim− 0 = 0, we have 𝑓 ′ (0) = 0; and so
𝑥→0 𝑥 𝑥→0
1 −1/𝑥
𝑒 if 𝑥 > 0
𝑓 ′ (𝑥)
= {𝑥 2 .
0 if 𝑥 ≤ 0
Similarly since
1 −1/𝑥
𝑓 ′ (𝑥) − 𝑓 ′ (0) 𝑥 2𝑒 −0
lim+ = lim+ = lim 𝑡 3 𝑒 −𝑡 = 0
𝑥→0 𝑥 𝑥→0 𝑥 𝑡→+∞
𝑓 ′ (𝑥)−𝑓 ′ (0)
and lim− = lim− 0 = 0, we have 𝑓 ′′ (0) = 0 also; and so
𝑥→0 𝑥 𝑥→0
1 − 2𝑥 −1/𝑥
𝑒 if 𝑥 > 0
𝑓 ′′ (𝑥) = { 𝑥 4 .
0 if 𝑥 ≤ 0
(𝑛)
Continuing in a similar way, one can show that 𝑓 (0) = 0 for every 𝑛 ∈ ℕ; in fact
𝑝𝑛−1 (𝑥) −1/𝑥
𝑒 if 𝑥 > 0
𝑓 (𝑛) (𝑥) = { 𝑥 2𝑛 for every 𝑛 ∈ ℕ,
0 if 𝑥 ≤ 0
where 𝑝𝑛−1 is some polynomial of degree at most 𝑛 − 1. Therefore the Maclaurin series of 𝑓 is
the zero power series. This Maclaurin series obviously converges to 0 for every 𝑥 ∈ ℝ. But we
note that it converges to 𝑓(𝑥) only for every 𝑥 ≤ 0, but not for any 𝑥 > 0.
𝑦
𝑦 = 𝑓(𝑥)
1
𝑥
0
Remark 9.37 Let 𝑎 be a real number. A function 𝑓 defined near 𝑎 is said to be analytic at 𝒂
if its Taylor series at 𝑎 converges to 𝑓(𝑥) for every 𝑥 in some interval (𝑎 − 𝛿, 𝑎 + 𝛿). All the
functions listed in the table in Remark 9.34 are analytic at 0, while the functions
−1/𝑥 −1/|𝑥|
𝑓(𝑥) = {𝑒 if 𝑥 > 0 and 𝑔(𝑥) = {𝑒 if 𝑥 ≠ 0
0 if 𝑥 ≤ 0 0 if 𝑥 = 0
are not analytic at 0.
Page 15 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
In the previous section, we have seen that some infinitely differentiable functions can be nicely
represented by power series. In this section, we study another type of series of functions called
trigonometric series. We will then try to represent periodic functions using trigonometric series.
Definition 1.41 A function 𝑓: ℝ → ℝ is called a periodic function if there exists 𝑐 > 0 such that
𝑓(𝑥 + 𝑐) = 𝑓(𝑥) for every 𝑥 ∈ ℝ.
The number 𝑐 is called a period of 𝑓.
Apart from famous periodic functions like cos and sin, a periodic function can also be constructed
by specifying its value on a certain interval, and then extending the definition periodically.
𝑦 = 𝑓(𝑥)
1
−5 −3 −1 0 1 3 5
−3𝜋 −2𝜋 −𝜋 0 𝜋 2𝜋 3𝜋
Page 16 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
Lemma 9.40 Let 𝑎0 , 𝑎1 , … , 𝑎𝑛 , 𝑏1 , … , 𝑏𝑛 be real numbers and consider the finite sum
𝑛
𝑎0
𝑓(𝑥) ≔ + ∑(𝑎𝑘 cos 𝑘𝑥 + 𝑏𝑘 sin 𝑘𝑥)
2
𝑘=1
(which is called a trigonometric polynomial). Then 𝑓 is a periodic function with a period 2𝜋, and
the coefficients 𝑎0 , 𝑎1 , … , 𝑎𝑛 , 𝑏1 , … , 𝑏𝑛 are related to the values of 𝑓 via the formulas
1 𝜋 1 𝜋
𝑎𝑘 = ∫ 𝑓(𝑥) cos 𝑘𝑥 𝑑𝑥 and 𝑏𝑘 = ∫ 𝑓(𝑥) sin 𝑘𝑥 𝑑𝑥
𝜋 −𝜋 𝜋 −𝜋
for every 𝑘.
Remark 9.41 If we use ideas from dot product of vectors and try to define the “dot product” of
two functions 𝑓 and 𝑔 as
𝜋
𝑓 ⋅ 𝑔 ≔ ∫ 𝑓(𝑥)𝑔(𝑥)𝑑𝑥 ,
−𝜋
then the above proof is saying that every two different members from the set of functions
{1, cos 𝑥 , sin 𝑥 , cos 2𝑥 , sin 2𝑥 , cos 3𝑥 , sin 3𝑥 , … } are orthogonal to each other. We will learn
more about this idea when we study linear algebra.
Example 9.42 Let 𝑓(𝑥) = sin4 𝑥. Then 𝑓 is a trigonometric polynomial of the form
3 1 1
sin4 𝑥 =
− cos 2𝑥 + cos 4𝑥
8 2 8
by applying double angle formula twice. So by Lemma 9.40 we deduce immediately that
1 𝜋 4 3
∫ sin 𝑥 𝑑𝑥 = 𝑎0 = ,
𝜋 −𝜋 4
1 𝜋 4 1
∫ sin 𝑥 cos 2𝑥 𝑑𝑥 = 𝑎2 = − ,
𝜋 −𝜋 2
1 𝜋 4 1
∫ sin 𝑥 cos 4𝑥 𝑑𝑥 = 𝑎4 = .
𝜋 −𝜋 8
Page 17 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
For the sake of simplicity, for the rest of this section we only consider periodic functions with a
period 𝟐𝝅.
Definition 9.43 Let 𝑓 be a periodic function with a period 2𝜋, which is integrable on [−𝜋, 𝜋].
The series of trigonometric functions
+∞
𝑎0
ℱ𝑓(𝑥) ≔ + ∑(𝑎𝑘 cos 𝑘𝑥 + 𝑏𝑘 sin 𝑘𝑥) ,
2
𝑘=1
Then the Fourier series of 𝑓 is just 𝑓 itself. For example, 𝑓(𝑥) = sin4 𝑥 equals to its own
Fourier series.
Remark 9.45 In general, a periodic function does not necessarily equal to its Fourier series. We
usually write a periodic function 𝑓 and its Fourier series in the following notation
+∞
𝑎0
𝑓(𝑥) ∼ + ∑(𝑎𝑘 cos 𝑘𝑥 + 𝑏𝑘 sin 𝑘𝑥) ,
2
𝑘=1
which suggests that the sequence of partial sums of the Fourier series may not converge to 𝑓(𝑥).
−3𝜋 −2𝜋 −𝜋 0 𝜋 2𝜋 3𝜋
Page 18 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
The diagrams below show the approximation to 𝑓(𝑥) by partial sums 𝑆𝑛 (𝑥) of its Fourier series.
𝑦 = 𝑆5 (𝑥)
−3𝜋 −2𝜋 −𝜋 0 𝜋 2𝜋 3𝜋
𝑦 = 𝑆25 (𝑥)
−3𝜋 −2𝜋 −𝜋 0 𝜋 2𝜋 3𝜋
Although each term in the Fourier series is a continuous function, it turns out that the sum is a
discontinuous function. The sum agrees with 𝑓(𝑥) at those 𝑥 where 𝑓 is continuous; but at
the places where 𝒇 is discontinuous, the Fourier series does not converge to 𝒇(𝒙). The diagram
below shows the graph of the sum of the Fourier series of 𝑓.
𝑦 = ℱ𝑓(𝑥)
1
−3𝜋 −2𝜋 −𝜋 0 𝜋 2𝜋 3𝜋
Page 19 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
The following is a sufficient condition for the convergence of the Fourier series.
Theorem 9.47 (Convergence of Fourier series) Let 𝑓 be a periodic function with period 2𝜋, and
let 𝑎 be a real number. If the following one-sided limits
and
Example 9.49 Let 𝑓(𝑥) = 𝑥 for every 𝑥 ∈ (−𝜋, 𝜋) , and extended periodically so that 𝑓
becomes a periodic function with a period 2𝜋. Here we allow 𝑓(𝑥) to remain undefined at the
end-points −𝜋 and 𝜋.
𝜋
𝑦 = 𝑓(𝑥)
−5𝜋 −3𝜋 −𝜋 𝜋 3𝜋 5𝜋
−𝜋
Page 20 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
For every 𝑥 ∈ (−𝜋, 𝜋), according to Theorem 9.47 we actually have the equality
2 2 2
𝑥 = 2 sin 𝑥 − sin 2𝑥 + sin 3𝑥 − sin 4𝑥 + ⋯.
2 3 4
When 𝑥 = 𝜋/2, we recover
1 1 1
𝜋 = 4 (1 − + − + ⋯ )
3 5 7
as obtained before (in Example 8.63).
When 𝑥 = 𝜋, although 𝑓(𝜋) is undefined, we still see that
𝑓(𝜋 − ) + 𝑓(𝜋 + ) 𝜋 + (−𝜋)
ℱ𝑓(𝜋) = 0 and = = 0,
2 2
which verifies the conclusion of Theorem 9.47.
Example 9.50 (Basel problem) Let 𝑓(𝑥) = 𝑥 2 for every 𝑥 ∈ [−𝜋, 𝜋], and extended periodically
so that 𝑓: ℝ → ℝ becomes a continuous periodic function with a period 2𝜋.
𝜋2
𝑦 = 𝑓(𝑥)
−5𝜋 −3𝜋 −𝜋 0 𝜋 3𝜋 5𝜋
Page 21 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
In Examples 9.49 and 9.50, we observe that the Fourier series of an even function consists of cosine
terms only, while the Fourier series of an odd function consists of sine terms only.
Theorem 9.52 Let 𝑓 be a periodic function with period 2𝜋, and let
+∞
𝑎0
ℱ𝑓(𝑥) = + ∑(𝑎𝑘 cos 𝑘𝑥 + 𝑏𝑘 sin 𝑘𝑥)
2
𝑘=1
Page 22 of 23
MATH1014 Calculus II Chapter 9 Taylor series and Fourier series
L1 (Spring 2024)
Summary of Chapter 9
The following are what you need to know in this chapter in order to get a pass (a distinction) in this
course:
Page 23 of 23