0% found this document useful (0 votes)
27 views16 pages

MATE2A2 Introduction Fourier Series

This document provides an introduction to Fourier series. It discusses how Fourier series can be used to represent periodic functions as infinite sums of sines and cosines. Key points include: 1) Fourier series allow modeling of periodic phenomena that appear frequently in engineering and science. 2) A function is periodic if its values repeat at constant intervals. The Fourier series represents a periodic function as an infinite series using cosines and sines of multiples of x. 3) Integrals involving multiples of cosines and sines play an important role in calculating Fourier series. Specific values and patterns for sin(nπ), cos(nπ), sin(2nπ), and cos(2nπ) are highlighted.

Uploaded by

portia733hh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views16 pages

MATE2A2 Introduction Fourier Series

This document provides an introduction to Fourier series. It discusses how Fourier series can be used to represent periodic functions as infinite sums of sines and cosines. Key points include: 1) Fourier series allow modeling of periodic phenomena that appear frequently in engineering and science. 2) A function is periodic if its values repeat at constant intervals. The Fourier series represents a periodic function as an infinite series using cosines and sines of multiples of x. 3) Integrals involving multiples of cosines and sines play an important role in calculating Fourier series. Specific values and patterns for sin(nπ), cos(nπ), sin(2nπ), and cos(2nπ) are highlighted.

Uploaded by

portia733hh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

University of Johannesburg

Faculty of Science
Department of Mathematics and Applied Mathematics
Lecturers: PG Dlamini, IK Letlhage & SM Simelane

Fourier Series

1. Introduction
Fourier series is an infinite expansion designed/used to represent a period function in terms of sine and cosine
functions. Fourier analysis has its most important applications in modeling as well as solving of both ordinary dif-
ferential equations (ODEs) and partial differential equations (PDEs) related to boundary and initial value problems of
mechanics, heat flow, electrostatics, and other fields.
Fourier analysis allows us to model periodic phenomena which appear frequently in engineering and science.
Think of rotating parts of machines, alternating electric currents or the motion of planets. More applications include
CAT scans, computing and data compression, vibration analysis, acoustics, optics, signal and image processing,
astronomy and many more. For instance, in astronomy, astronomers are able to deduce the chemical composition of
star by analyzing the frequency components, and/or spectrum of the star’s emitted light.
The discovery of Fourier series had a huge impetus on applied mathematics as well as on mathematics as a whole.
Indeed, its influence on the concept of a function, on integration theory, on convergence theory, and other theories of
mathematics has been substantial.

2. Definition
Fourier series is an infinite series that represents a periodic function in terms of cosines and sines. To define
Fourier series, we first need to recall some of the concepts we know from first year mathematics.

A function f (x) is periodic if its values repeat itself at constant intervals of x. The constant interval between
repetitions is called the period of f (x), denoted by p. Algebraically, a periodic function is defined as
f (x) = f (x + p).
The equation above means that the function value at any x value is equal to the function value at another x value p
units away from x.
The graph of a periodic function has the characteristic that it can be obtained by periodic repetition of its graph in
any interval of length p (see figure 1).
f(x)

1.5

1.0

0.5

x
-10 -5 5 10 15

-0.5

-1.0

-1.5

Figure 1: An example of a periodic function

1
We know that f (x) = sinx and f (x) = cosx are periodic with period p = 2π. Hence we can represent f (x) as
f (x) = f (x + 2π). Graphically,

f(x) f(x)

1.0 1.0

0.5 0.5

x x
1 2 3 4 5 6 1 2 3 4 5 6

-0.5 -0.5

-1.0 -1.0

(a) (b)

Figure 2: (a) f (x) = sin x. (b) f (x) = cos x.

The graph of f (x) = sin2x has a smaller period, the period is now p = π.
f(x)

1.0

0.5

x
1 2 3 4 5 6

-0.5

-1.0

Figure 3: f (x) = sin 2x

If f (x) has period p, then for any integer n = 1, 2, 3, ...

f (x) = f (x + np).

Further more, if f (x) and g(x) have period p, then a f (x) + bg(x) with any constants a and b also has the period p.
The smallest positive period is often called the fundamental period. Familiar periodic functions are the cosine,
sine, tangent, and cotangent. Examples of functions that are not periodic are x, x2 , xn , e x , cosh x, ln x, etc.
Consider the function f (x) = sin x, we observe the following
• f (x) = sin x gives rise to the largest period, p = 2π. This is known as the first harmonic of sine.

• f (x) = sin 2x gives rise to a smaller period, p = = π. This is known as the second harmonic of sine.
2

• Generally, f (x) = sin nx has the period p = . This is known as the nth harmonic of sine.
n
We use the harmonics of sine and cosine to present a periodic function as an infinite series.

2
3. Integrals
The calculation of a Fourier series involves the integration of sine and/or cosine functions and its combinations.
Therefore, we recall some basic concepts of integration that we encountered in MATE1A1 and MATE1B1.
Multiples of cos nx and sin nx play an important role in the evaluation of certain definite integrals and hence, we
highlight and emphasize the following (make a mental note of these values):

3.1. Multiples of sine


f(x)

1.0

0.5

x
2 4 6 8 10 12

-0.5

-1.0

Figure 4: f (x) = sin x

Reading off the values from the graph of f (x) = sin x above, we make the following conclusions

sin nπ = 0 for all n ∈ N or n = 1, 2, 3, ...
• Similarly,
sin 2nπ = 0 for all n ∈ N or n = 1, 2, 3, ...
π
• With intervals of , the values oscillate between -1, 0 and 1. i.e.
2
0 n = even


nπ 

= n = 1, 5, 9, . . .

sin 1

2 

n = 3, 7, 11, . . .

 −1

3.2. Multiples of cosine


f(x)

1.0

0.5

x
2 4 6 8 10 12

-0.5

-1.0

Figure 5: f (x) = cos x

From the graph of f (x) = cos x, we conclude that


3

n = odd
(
−1
cos nπ =
1 n = even

• Similarly,
cos 2nπ = 1 for all n ∈ N or n = 1, 2, 3, ...
π
• With intervals of , the values oscillate between -1, 0 and 1. i.e.
2
0 n = odd


nπ 

= = 2, 6, 10, . . .

cos −1 n

2 

n = 4, 8, 12, . . .

 1

We use the above defined/mentioned values to evaluate some integrals and later the Fourier series.

3.3. Worked out examples


Evaluate the following
1.
Z π Z π
1
sin nx dx = n sin nx dx
0 n 0
π
1
=− cos nx
n 0
1
= − (cos nπ − cos 0)
n
cos nπ is either 1 or -1 and cos 0 = 1
n = odd
(
1 −1 − 1
=−
n 1−1 n = even
n = odd
 2
=

 n
 0 n = even

2.
Z π Z π
2 1 2
cos nx dx = n cos nx dx
0 n 0
π
1 2
= sin nx
n 0
1 nπ
= (sin − sin 0)
n 2
sin 0 = 0 and sin π2 is either 0, 1 or -1
0 n = even


1

=  n = 1, 5, 9, ....

1

n
n = 3, 7, 11, ...

 −1

4
3.
Z 2 Z 2
nπx 2 nπ nπx
cos dx = cos dx
0 2 nπ 0 2 2
2 nπx 2
= sin
nπ 2 0
!
2 2nπ
= sin − sin0
nπ 2
2
= (sin 2nπ − sin 0)

sin nπ = 0 and sin 0 = 0
=0

4.
Z 0 Z 0
1
sin nπx dx = n sin nπx dx
−1 nπ −1
0
1
=− cos nπx
nπ −1
1
= − (cos 0 − cos (−nπ))

cos 0 = 1 and cos (−β) = cos (β)
n = odd
(
1 1 − (−1)
=−
nπ 1 − 1 n = even
n = odd
 2
 − nπ
=

 0 n = even
5. Z 0
2x cos nx dx
−π
We have a product of two functions of x, and so we use integration by parts (IBP). We let

u=x dv = cos nx
1
du = dx v = sin nx
n
Now,
Z 0 0
!
Z 0
x 1
2x cos nx dx = 2 sin nx − sin nx
−π n −π n
−π
0 0 !
x 1
= 2 sin nx + 2 cos nx
n −π n −π
2 2
= (0 − 0) + 2 (cos 0 − cos (−nπ))
n n
cos 0 = 1 and cos (−β) = cos (β)
n = odd
(
2 1 − (−1)
= 2
n 1−1 n = even
n = odd
 4
=
 n2

 0 n = even

5
6. Z π
x2 sin nx dx
−π
We have a product of two functions of x, thus we can use either integration by parts or the Kronecker’s
method. We apply the Kronecker’s method for repeated integration by parts which states that
Z
0 00
u v dx = u v1 − u v2 + u v3 − u000 v4 + . . .

where
Z Z Z Z
v1 = v dx, v2 = v1 dx, v3 = v2 dx, v4 = v3 dx . . .

To evaluate −π
x2 sin nx dx using the Kronecker method, we let u = x2 and v = sin nx. Then
0 00 000
u = x2 , u = 2x, u = 2, u =0

Z
1
v1 = sin nx dx = − cos nx
n
Z Z
1 1
v2 = v1 dx = − cos nx dx = − 2 sin nx
n n
Z Z
1 1
v3 = v2 dx = − 2 sin nx = 3 cos nx
n n
Thus
Z π
0 00
x2 sin nx dx = u v1 − u v2 + u v3
−π
! ! !π
1 1 1
= x − cos nx − 2x − 2 sin nx + 2 3 cos nx
2
n n n −π
π2 π2
!
2π 2 2(−π) 2
=− cos nπ + 2 sin nπ + 3 cos nπ − − cos(−nπ) + sin(−nπ) + 3 cos(−nπ)
n n n n n2 n
Recall that sin (−β) = - sin (β) and sin nπ = 0
π2 2π π2 2
=− cos nπ + 3 cos nπ + cos nπ − 3 cos nπ
n n n n
=0

Exercise 1

Determine the following integrals:



1. 0 cos nx dx
R0 nπx
2. −3
sin dx
3
2Rπ
3. cos x sin nx dx (Hint: use an identity).
π 0

4. −π x2 cos nxdx

6
4. Fourier Expansion
This section is covered in section 11.2 in the Trench textbook (page 587).

Suppose the function f (x) is periodic, then the Fourier series of a periodic function f (x) with period p is given
by
∞ !
X 2nπx 2nπx
f (x) = a0 + an cos + bn sin (1)
n=1
p p
where
Z
1
a0 = f (x) dx integrate over the complete period p (2)
p
Z
2 2nπx
an = f (x) cos dx integrate over the complete period p (3)
p p
Z
2 2nπx
bn = f (x) sin dx integrate over the complete period p (4)
p p
a0 , an and bn are called the Fourier coefficients. Should the function f (x) be defined over Rthe interval (0, p), then we
p
always perform the integrals given above from zero (lower limit) up to p (upper limit) i.e. 0 f (x) dx.

If f is integrable on [−L, L], then the period becomes p = L − (−L) = 2L. Substitute p = 2L, then the Fourier
series becomes
∞ 
X nπx nπx 
f (x) = a0 + an cos + bn sin (5)
n=1
L L
where
Z L
1
a0 = f (x) dx (6)
2L −L
1 L
Z
nπx
an = f (x) cos dx (7)
L −L L
1 L
Z
nπx
bn = f (x) sin dx (8)
L −L L
which is exactly the same as the formula in Trench, as well as most books in literature.
Also note that if we let
Z
2
a0 = f (x) dx , (9)
p
then the Fourier series becomes
∞ !
a0 X 2nπx 2nπx
f (x) = + an cos + bn sin . (10)
2 n=1 p p

The 2 in the denominator in a0 will cancel out with the 2 in f (x), simplifying back to Eq. (1).

Another way to write the series (1) is by using the relationship a cos ωx + b sin ωx = R sin (ωx + α) i.e.
f (x) = a0 + R1 sin (x + α1 ) + R2 sin (2x + α2 ) + R3 sin (3x + α3 ) + . . . + Rn sin (nx + αn ), (11)
where a0 is constant and
q
Rn = a2n + b2n are the amplitude ,
an
αn = tan−1 are the phase angle.
bn
7
For the series of Eq. (1), the term a1 cos x + b1 sin x = R1 sin (x + α1 ) is called the first harmonic or the fundamental.
a2 cos x + b2 sin x = R2 sin (x + α2 ) is called the second harmonic, and so on.

For an exact representation of a complex wave, an infinite number of terms are, in general, required. In many
practical cases, however, it is sufficient to take the first few terms only.

The sum of a Fourier series at a point of discontinuity is given by the arithmetic mean of the two limiting
values of f (x) as x approaches the point of discontinuity from the two sides. For example, for the waveform shown in
Fig. 6, the sum of the Fourier series at the points of discontinuity (i.e. at π2 , π, . . .) is given by
8 + (−3) 5
=
2 2

f(x)

x
-2 2 4

-2

Figure 6

For the purpose of these notes, we will adopt the formulas (1)-(4). However, you are free to use any of the
formulas which you are comfortable with.

Worked out examples

Example 7: Find a Fourier series for the periodic function


0≤x<π
(
3
f (x) =
0 π ≤ x < 2π
if f (x) = f (x + 2π).

Solution: A sketch of this function is given below


f(x)

3.0

2.5

2.0

1.5

1.0

0.5

x
5 10 15 20

8
Also notice that the period of f (x) is 2π, hence we substitute p = 2π in all formulas. f (x) is also defined over the
interval (0, 2π) in two different steps. So we will need to integrals.
The first Fourier coefficient,
1 2π
Z
a0 = f (x) dx
p 0
Z 2π
1
= f (x) dx
2π 0
Z π Z 2π !
1
= 3 dx + 0 dx
2π 0 π
π
1
= 3x
2π 0
1
= (3π − 3(0))

3
=
2
The second Fourier coefficient,
2 2π
Z
2nπx
an = f (x) cos dx
p 0 p
Z 2π
2 2nπx
= f (x) cos dx
2π 0 2π
Z π Z 2π !
1
= 3 cos nx dx + 0 cos nx dx
π 0 π
π
3
= sin nx
nπ 0
3
= (sin nπ − sin 0)

=0
The third Fourier coefficient,
2 2π
Z
2nπx
bn = f (x) sin dx
p 0 p
Z 2π
2 2nπx
= f (x) sin dx
2π 0 2π
Z π Z 2π !
1
= 3 sin nx dx + 0 sin nx dx
π 0 π
π
3
=− cos nx
nπ 0
3
= − (cos nπ − cos 0)

n = even
(
3 1−1
=−
nπ −1 − 1 n = odd
6
= if n = odd

Therefore, the Fourier approximation for the function f (x) is
∞ !
X 2nπx 2nπx
f (x) = a0 + an cos + bn sin
n=1
p p
9
3 6
Since a0 = , an = 0 and bn = (if n=odd)
2 nπ
∞ !
3 X 2nπx 2nπx
f (x) = + (0) cos + bn sin
2 n=1 2π 2π

3 X
= + bn sin nx
2 n=1

Which means that


3
f (x) = + b1 sin 1x + b3 sin 3x + b5 sin 5x + . . .
2
3 6 6 6
= + sin x + sin 3x + sin 5x + . . .
2 π 3π 5π !
3 6 1 1
= + sin x + sin 3x + sin 5x + . . .
2 π 3 5

Graphs of the Fourier approximation for example 7 are shown below up to the 5th harmonic and 23rd harmonic,
respectively.

f(x) f(x)

3.0 3.0

2.5 2.5

2.0 2.0

1.5 1.5

1.0 1.0

0.5 0.5

x x
5 10 15 20 5 10 15 20

(a) (b)

Notice the sine-activity about the lines f (x) = 3 and f (x) = 0. In the regions where f (x) has jump-discontinuities
(between x = 0 and x = 3), we observe a strange behavior in the Fourier approximation of f (x). The curve “over-
shoot” the actual mark at the end of each jump point as though it cannot quite accommodate itself to the sharp turn
required at this point. This behavior is typical of Fourier approximation at points of discontinuity and is knows as the
Gibbs phenomenon.

Example 8: Find a Fourier series for the periodic function

2(x + 1) −1 ≤ x < 0
(
f (x) =
0 0≤x<1

if f (x) = f (x + 2).

Solution: We first notice that the period is 2, thus we substitute p = 2 in all the formulas. The function f (x) is also
defined over the interval (-1,1) in two different steps, meaning that we will need two different integrals.

10
The first Fourier coefficient,

1 1
Z
a0 = f (x) dx
p −1
Z 1
1
= f (x) dx
2 −1
Z 0 Z 1 !
1
= 2(x + 1) dx + 0 dx
2 −1 0
0
1
= (x + 1)2
2 −1
1
=
2
The second Fourier coefficient,

2 1
Z
2nπx
an = f (x) cos dx
p −1 p
Z 1
2 2nπx
= f (x) cos dx
2 −1 2
Z 0 Z 1
= 2(x + 1) cos nπx dx + 0 cos nπx dx
−1 0
Z 0
= 2(x + 1) cos nπx dx
−1
We use IBP. Let u = 2(x + 1) and dv = cos nπx
2(x + 1) 2 0
= sin nπx + 2 2 cos nπx
nπ n π −1
sin nπx = 0, cos 0 = 1 and cos −β = cos β
2 2
= 2 2 − 2 2 cos (−nπ)
nπ nπ
2 2
= 2 2 − 2 2 cos (nπ)
nπ nπ
2
= 2 2 (1 − cos nπ)

n = even
(
2 1−1
= 2 2
nπ 1 − (−1) n = odd
4
= 2 2 if n = odd

11
The third Fourier coefficient,
2 1
Z
2nπx
bn = f (x) sin dx
p −1 p
2 1
Z
2nπx
= f (x) sin dx
2 −1 2
Z 0 Z 1
= 2(x + 1) sin nπx dx + 0 sin nπx dx
−1 0
Z 0
= 2(x + 1) sin nπx dx
−1
We use IBP. Let u = 2(x + 1) and dv = cos nπx
2(x + 1) 2 0
=− cos nπx + 2 2 sin nπx
nπ nπ −1
2 2 2(0) 2
= − + 2 2 sin 0 + cos (−nπ) − 2 2 sin (−nπ)
nπ n π nπ n π
2
=

Therefore, the Fourier approximation for the function f (x) is
∞ !
X 2nπx 2nπx
f (x) = a0 + an cos + bn sin
n=1
p p

1 4 2
Since a0 = , an = 2 2 when n = odd and bn = for all n,
2 n π nπ
∞ !
1 X 2nπx 2nπx
f (x) = + an cos + bn sin
2 n=1 2 2

1 X
= + (an cos nπx + bn sin nπx)
2 n=1

Which means that


1
f (x) = + a1 cos 1πx + a3 cos 3πx + a5 cos 5πx + . . . + b1 sin 1πx + b2 sin 2πx + b3 sin 3πx + b4 sin 4πx . . .
2 ! !
1 4 1 1 2 1 1 1
= + 2 cos πx + cos 3πx + cos 5πx + . . . − sin πx + sin 2πx + sin 3πx + sin 4πx . . .
2 π 9 25 π 2 3 4

Graph of the Fourier approximation for example 8 is shown below up to the 7th harmonic.
f(x)
2.0

1.5

1.0

0.5

x
2 4 6 8 10

12
Example 9: Obtain the Fourier series for the periodic function

−π ≤ x < 0
(
−k
f (x) =
k 0≤x<π

The function is periodic outside of this range with 2π.

Solution: The square wave function defined is shown in the figure below (for the case where k = 1)

f(x)

1.0

0.5

x
-5 5

-0.5

-1.0

Since f (x) is given by two different expressions in the two halves of the range the integration is performed in two
parts, one from −π to 0 and the other from 0 to π.
The first Fourier coefficient,
1 π
Z
a0 = f (x) dx
p −π
Z 0 Z π !
1
= −k dx + k dx
2π −π 0
1 
(−kx)|0−π + (kx)|π0

=

=0

a0 is in fact the mean value of the waveform over a complete period of 2π and this could have been deduced on sight
from the figure above.
The second Fourier coefficient,
2 π
Z
2nπx
an = f (x) cos dx
p −π p
Z π
2 2nπx
= f (x) cos dx
2π −π 2π
Z 0 Z π !
1
= −k cos nx dx + k cos nx dx
π −π 0
1 −k sin nx 0 k sin nx π
( )
= +
π n −π n 0
=0

Hence, a1 , a2 , a3 , ... are all zero (since sin 0 = sin (−nπ) = sin (nπ) = 0). Therefore, there are no cosine terms will
appear in the series.

13
The third Fourier coefficient,
2 π
Z
2nπx
bn = f (x) sin dx
p −π p
Z π
2 2nπx
= f (x) sin dx
2π −π 2π
Z π Z π !
1
= −k sin nx dx + k sin nx dx
π −π 0
1 k cos nx 0 −k cos nx π
( )
= +
π n −π n 0

When n is odd:
( ! !)
k 1 −1 −1 −1
bn = − + − −
π n n n n
!
k 2 2
= +
π n n
4k
=

When n is even:
( ! !)
k 1 1 1 −1
bn = − + − −
π n n n n
=0

Therefore, the Fourier approximation for the function f (x) is


∞ !
X 2nπx 2nπx
f (x) = a0 + an cos + bn sin
n=1
p p

4k
Since a0 = 0, an = 0 and bn = when n is odd,

∞ !
X 2nπx 2nπx
f (x) = 0 + (0) cos + bn sin
n=1
2π 2π

X
= bn sin nx
n=1

Which means that

f (x) = b1 sin 1πx + b3 sin 3πx + b5 sin 5πx . . .


!
4k 1 1
= sin x + sin 3x + sin 5x . . .
π 3 5
π π
Example 10: If in the Fourier series of example 9, let k = 1, deduce a series for at the point x = .
4 2
Solution: If k = 1 in the Fourier series above, then
!
4 1 1
f (x) = sin x + sin 3x + sin 5x . . .
π 3 5

14
π
When x = , f (x) = 1 (This is taken from the definition of f (x) in the initial step function),
2
π
sin x = sin = 1
2

sin 3x = sin = −1
2

sin 5x = sin =1
2
and so on.
Hence,
" #
4 1 1 1
1= 1 + (−1) + (1) + (−1) + . . .
π 3 5 7
π 1 1 1
= 1 − + − + ...
4 3 5 7

π X 1
= (−1)n 1
4 n=0
2n +1

Exercise 2
Find a Fourier series for the following periodic functions
1.
− π2 ≤ x < 0

 0
f (x) = 

π
 2
πx 0≤x< 2
if f (x) = f (x + π).

2.
−π ≤ t < 0
(
0
f (t) =
t 0≤t<π
if f (t) = f (t + 2π).

3.
−π ≤ t < 0
(
1
f (t) =
cos t 0≤t<π
if f (t) = f (t + 2π).
1
4. f (x) = − x if 0 ≤ x ≤ 1 and f (x) = f (x + 1)
2
5. For the waveform shown in below determine
(a) a function representing one cycle of the periodic waveform above.
(b) the Fourier series for the function and
(c) the sum of the Fourier series at the points of discontinuity.

15
6. The Fourier series expansion for f (θ) = θ2 is

π2
!
1 1 1
f (θ) = − 4 cos θ − 2 cos2 θ + 2 cos3 θ − 2 cos4 θ + . . .
3 2 3 4

Let θ = π,
P∞ 1
(a) Use the given series to deduce a sum for the series n=1
n2
3π2
(b) Deduce the series for
2
7. Given the series for the function g(x) = 2x over −π ≤ x ≤ π as
!
1 1 1 1 1
g(x) = 4 sin x − sin 2x + sin 3x − sin 4x + sin 5x − sin 6x + . . . .
2 3 4 5 6
π π
Let x = , deduce a series for .
2 4
8. All the exercises in the Trench textbook (page 599 - 600). Work on problems 1. to 20.

c Compiled by SM Simelane

16

You might also like