Chapter 7 Fourier Series: 1 Learning Outcomes
Chapter 7 Fourier Series: 1 Learning Outcomes
A Function (𝜃)is periodic if it is defined for all real 𝜃and if there is some positive number, 𝑇 such
that𝑓(𝑇 + 𝜃) = 𝑓(𝜃).
Generally, a periodic functions are functions which consist of a single cycle which repeats itself
endlessly. Some examples can be seen in Figure 1.
1
MTCA4001 | Engineering Mathematics 2
The period of a periodic function is the length of single cycle of the function. The inverse of this
length is called the fundamental frequency, i.e. .
These functions are full described by simply writing down their behaviour over a single period 𝑇. For
example, in the case of the functions above:
(𝑥) = −𝑥 + 1, 0≤𝑥<𝑇
where 𝐴 is the amplitude of the sinusoid, 𝜔 is its angular frequency and 𝜃 is the phase offset which
determines the “starting point” of the waveform. A sine wave, cosine wave and more general
sinusoidal function is given in Figure 2.
2
MTCA4001 | Engineering Mathematics 2
Figure 2. (Top) A sine wave. (Middle) A cosine wave. (Bottom). A general sinusoid.
We then separate the cosine term into two products based upon the well-known trigonometric
identity.
cos(𝛼 − 𝛽) = cos𝛼 cos 𝛽 + sin 𝛼 sin𝛽
→ 𝐴 cos(𝜔𝑡 − 𝜃) = 𝐴(cos𝜔𝑡 cos 𝜃 + sin𝜔𝑡 sin𝜃)
= 𝐴 cos𝜃 cos 𝜔𝑡 + 𝐴 sin𝜃 sin𝜔𝑡
This means that any arbitrary sinusoidal function with amplitude 𝐴, phase offset 𝜃, and angular
frequency 𝜔 can be written as the sum of a sine wave and cosine wave of specific amplitudes 𝑎 and
𝑏.
For example:
is a harmonic function of fundamental frequency 𝜔, consisting of the first, second and third
harmonic. This function is plotted in Figure 3.
3
MTCA4001 | Engineering Mathematics 2
Harmonic functions are periodic, and the frequency is equal to the fundamental frequency.
On the other hand, an odd function is one which satisfies the following property:
4 Fourier Series
The previous sections described some periodic functions and some properties of functions generally.
We’ve previously seen that harmonic functions are composed of sinusoids whose frequencies have
an integer relationship with a particular fundamental. We’ve also seen that a sinusoid function can
be composed of both a sine and cosine wave component.
4
MTCA4001 | Engineering Mathematics 2
We now state that all periodic functions are harmonic functions which can be written in terms of a
sine and cosine functions. For example, the “sawtooth” waveform can be expressed as:
1 1 (−1)𝑘−1
𝑓(𝑥) = 2(sin 𝑥 − sin 2𝑥 + sin 3𝑥 − ⋯ + sin 𝑘𝑥 + ⋯ )
2 3 𝑘
containing an infinite number of sinusoidal components.
This sum-of-sinusoids representation of a periodic function is called the functions Fourier Series. In
general, the series can be written:
[4.3]
where 𝑎𝑛 and 𝑏𝑛 are called the Fourier coefficients. These values are calculated according to the
following formulae:
5
MTCA4001 | Engineering Mathematics 2
1 1
𝑎0 = ∫ 𝑓(𝑥)𝑑𝑥
2 −1
1 1
= ∫ 2𝑥 + 1 𝑑𝑥
2 −1
1
1 2 1
= (𝑥 + 𝑥)| = (2)
2 −1 2
=1
1 𝐿 𝝅𝑛
𝑎𝑛 = ∫ 𝑓(𝑥) cos 𝑥 𝑑𝑥
𝐿 −𝐿 𝑳
1
= ∫ (2𝑥 + 1) cos 𝝅𝑛 𝑥 𝑑𝑥
−1
1
−(2𝑥 + 1) sin 𝒏𝝅𝑥 𝟏 1
= | − ∫ sin 𝒏𝝅𝑥 𝑑𝑡
𝒏𝝅 −1
𝝅𝑛 −1
1
3 1 2 cos(𝒏𝝅𝒙)
=− sin 𝒏𝝅 − sin(−𝒏𝝅) + |
𝒏𝝅 𝒏𝝅 (𝒏𝝅)2 −1
=0
Note that sin 𝑛𝜋 = 0 for all 𝑛 ∈ 𝑍 and cos 𝑛𝜋 = (−1)𝑛 for all 𝑛 ∈ 𝑍.
6
MTCA4001 | Engineering Mathematics 2
1
𝑏𝑛 = ∫ 𝑓(𝑥) sin 𝒏𝝅𝑥 𝑑𝑥
−1
3 1 4
=− cos 𝒏𝝅 − cos(−𝒏𝝅) = − cos 𝒏𝝅
𝒏𝝅 𝒏𝝅 𝒏𝝅
4
= (−1)𝑛 (− )
𝒏𝝅
Therefore,
∞
4 (−1)𝑛
𝑓(𝑥) = 1 − ∑ sin 𝝅𝑛 𝑥.
𝝅 𝒏
𝑛=1
Let now compute the Fourier coefficient. Note that 𝐿 = 2 in this case.
Note that sin 𝑛𝜋 = 0 for all 𝑛 ∈ 𝑍 and cos 𝑛𝜋 = (−1)𝑛 for all 𝑛 ∈ 𝑍.
7
MTCA4001 | Engineering Mathematics 2
2
1 2 𝑛𝜋𝑥 1 2 1 −1 1 2
𝑏𝑛 = ∫ 𝑓(𝑥) sin 𝑑𝑥 = ∫ 𝑥 sin 𝑛𝜋𝑥 𝑑𝑥 = ([ 𝑥 2 cos 𝑛𝜋𝑥] + ∫ 2x cos 𝑛𝜋𝑥 𝑑𝑥 )
𝐿 −2 𝐿 2 −2 2 𝑛𝜋 −2 𝑛𝜋 −2
=0
The Fourier series is given by
Even functions can solely be represented by cosine waves because, cosine waves are even functions.
A sum of even functions is another even function.
Odd functions can solely be represented by sine waves because, sine waves are odd functions. A
sum of odd functions is another odd function.
8
MTCA4001 | Engineering Mathematics 2
Example 3:- Show that the trigonometric series of 𝑓(𝑥) = 3𝑥 for 𝑥 ∈ (−𝜋, 𝜋) given by
∞
6
∑− (−1)𝑛 sin 𝑛𝑥
𝑛
𝑛=1
Solution:
Setp1: 𝑓(−𝑥) = 3(−𝑥) = −3𝑥 = −𝑓(𝑥), so 𝑓 is odd function.
Setp2: since 𝑓(𝑥) is odd and cos 𝑛𝑥 is even, it follow that 𝑓(𝑥) cos 𝑛𝑥 is odd, so
1 𝝅 1
𝑎𝑛 = ∫ 𝑓(𝑥) cos 𝒏𝝅𝑥 𝑑𝑥 = (0) = 0.
𝝅 −𝝅 𝝅
Moreover, since 𝑓 is odd
1 𝝅 1
𝑎0 = ∫ 𝑓(𝑥) 𝑑𝑥 = (0) = 0
𝟐 −𝝅 2
Step3: Noting that 𝑓(𝑥) and sin 𝑛𝑥 are odd, and therefore 𝑓(𝑥) sin 𝑛𝑥 is even, we have
1 𝝅
𝑏𝑛 = ∫ 𝑓(𝑥) sin 𝒏𝝅𝑥 𝑑𝑥 =.
𝝅 −𝝅
−(3𝑥) cos 𝒏𝑥 𝝅 𝟏 𝝅
=( | + ∫ cos 𝒏𝑥 𝑑𝑡)
𝒏 −𝝅 𝝅𝑛 −𝝅
𝝅
3 3 3 sin(𝒏𝒙)
= − cos 𝒏𝝅 − cos(−𝒏𝝅) + |
𝒏 𝒏 (𝒏)2 −𝝅
3 3 6
= − cos 𝒏𝝅 − cos(−𝒏𝝅) = − cos 𝒏𝝅
𝒏 𝒏 𝒏
6
= (−1)𝑛 (− )
𝒏
Therefore,
∞
(−1)𝑛
𝑓(𝑥) = −6 ∑ sin 𝑛𝑥.
𝒏
𝑛=1
9
MTCA4001 | Engineering Mathematics 2
Example 4:- Show that the trigonometric series of 𝑓(𝑥) = 𝑥 2 for 𝑥 ∈ (−𝜋, 𝜋) given by
∞
𝜋2 (−1)𝑛
+4∑ cos 𝑛𝑥
3 𝑛2
𝑛=1
Solution:
Setp1: 𝑓(−1) = (−1)2 = 1, so 𝑓 is an even function.
Setp2: since 𝑓(𝑥) is even function and sin 𝑛𝑥 is odd, it follow that 𝑓(𝑥) sin 𝑛𝑥 is odd, so
1 𝝅 1
𝑏𝑛 = ∫ 𝑓(𝑥) sin 𝒏𝝅𝑥 𝑑𝑥 = (0) = 0.
𝝅 −𝝅 𝝅
Step3:
As 𝑓(𝑥) is even
1 𝝅 𝜋2
𝑎0 = ∫ 𝑓(𝑥) 𝑑𝑥 =
𝟐𝝅 −𝝅 3
Moreover, as 𝑓(𝑥) and cos 𝑛𝑥 are even, therefore 𝑓(𝑥) cos 𝑛𝑥 is also even, so, we have
1 𝝅
𝑎𝑛 = ∫ 𝑓(𝑥) cos 𝒏𝑥 𝑑𝑥
𝝅 −𝝅
1 𝝅
= ∫ 𝑥 2 cos 𝒏𝑥 𝑑𝑥
𝝅 −𝝅
1 2 (sin 𝒏𝑥) 𝝅 𝝅
sin 𝒏𝑥
= (𝑥 | − ∫ 2𝑥 𝑑𝑥 )
𝝅 𝒏 −𝝅 −𝝅 𝑛
1 (cos 𝒏𝑥) 𝝅
= (0 + (2𝑥 | − 0))
𝝅 𝒏𝟐 −𝝅
(−1)𝑛
=4
𝑛2
Whereas
1 𝝅
𝑏𝑛 = ∫ 𝑓(𝑥) sin 𝒏𝑥 𝑑𝑥 = 0
𝝅 −𝝅
10
MTCA4001 | Engineering Mathematics 2
Therefore,
∞
𝜋2 (−1)𝑛
𝑓(𝑥) = +4∑ cos 𝑛𝑥.
3 𝑛2
𝑛=1
syms t k L n
evalin(symengine,'assume(k,Type::Integer)');
a1=@(f,t,k,L) int(f/2*L,t,-L,L);
a = @(f,t,k,L) int(f*cos(k*pi*t/L)/L,t,-L,L);
b = @(f,t,k,L) int(f*sin(k*pi*t/L)/L,t,-L,L);
11
MTCA4001 | Engineering Mathematics 2
ezplot(fs(f,t,2,1),-1,1)
hold on
ezplot(f,-1,1)
hold off
title('Partial sum with n=1')
12