You are on page 1of 24

SSCE1793

DIFFERENTIAL EQUATIONS

CHAPTER 4
FOURIER SERIES
___
Last update: April 2019

This Photo by Unknown Author is licensed under CC BY-SA-NC


1

CHAPTER 4
FOURIER SERIES

CONTENTS PAGE
4.1 Periodic Function 2
4.2 Even and Odd Function 4
4.3 Fourier Series for Periodic Function 7
4.4 Fourier Series for Half Range Expansions 17
Exercise 21
References 24

Scan or click the image to watch an interesting explanation about


Fourier series.
2

4.1 Periodic Function

A function f (t ) is periodic with period of T if


F (t + T ) = f (t ) , T  0

Example 1
Show that f ( x) = cos 2 x is a periodic function and find its
period.

Solution:
Since f ( x) = cos 2 x , then
f ( x + T ) = cos 2 ( x + T ) .
What is the value of T , such that cos 2 ( x + T ) = cos 2 x ?
Note that :

cos 2 ( x + T ) = cos 2 x cos 2 T − sin 2 x sin 2 T


cos 2 T = 1
= cos 2 x if 
sin 2 T = 0
This is true for T = 1, 2,3,...

The smallest value for T is 1 , known as fundamental period.


Therefore, f ( x) = cos 2 x is a periodic function with period of 1
3

Example 2
Determine whether f ( x ) = sin 5 x is a periodic function. If yes,
find the period.

Solution:
f ( x + T ) = sin 5 ( x + T )
= sin5 x cos5T + cos5 x sin5T
cos5T = 1
= sin 5x if sin 5T = 0

cos5T = cos 2 = 1
 5T = 2
2
T =
5

Therefore, f ( x ) = sin 5 x is a periodic function with the period of


2
.
5
4

4.2 Even and Odd Function

f ( x ) is an even function if f ( − x ) = f ( x ) , for all x. (I)


f ( x ) is an odd function if f ( − x ) = − f ( x ) , for all x. (II)

Geometrically,

Even The graph is symmetrical about the y-axis.

Odd The graph is symmetrical about the origin.

NOTE: If none of (I) and (II) are satisfied, then f ( x ) is called


neither even nor odd.

Example 3
Determine whether the following functions are even, odd, or
neither.
(i) f ( x ) = x2
(ii) h ( x ) = sin x

(iii) g ( x ) = x − sin x
1
3

(iv) f ( t ) = e
t
5

4.2.1 Properties of Even and Odd Functions


Scan or Click Me!
Even  Even→ Even Even ×/÷ Even → Even
Odd  Odd → Odd Odd ×/÷ Odd → Even
Even  Odd→ Neither Odd ×/÷ Even → Odd

Integral properties

 f ( x ) dx = 2  f ( x ) dx
l l

i) For even function: −l 0

Example: f ( x ) = x2
2 2
−2
x 2 dx = 2  x 2 dx
0
-2 2

 f ( x ) dx = 0
l

ii) For odd function: −l

Example: f ( x) = sin x
 0 

 sin x dx =   sin x dx +  2 sin x dx


2
− − 0
2 2

= 0.

NOTE: It is important to understand the integral properties of


even and odd function before you can proceed to the next
section.
6

Example:

If f ( x ) is even, then
l
➢  −l
f ( x)  sin nx dx = 0 .

Even X Odd ---> Odd

l l
➢ −l
f ( x)  cos nx dx = 2 f ( x)  cos nx dx
0

Even X Even ---> Even

If f ( x ) is odd, then
l l
➢  −l
f ( x)  sin nx dx = 2 f ( x)  sin nx dx .
0

Odd X Odd ---> Even

l
➢ −l
f ( x)  cos nx dx =0 .

Odd X Even ---> Odd


7

4.3 Fourier Series for Periodic Function f ( x ) , consisting of Sin


and Cos.

Fourier series for f ( x ) given by


a   n n 
f ( x) = 0
+   an cos x + bn sin x
2 n=1  l l 

where a0 , an and bn can be expressed as following:


1 l
f ( x ) dx
l −l
a0 =

1 l n x
(I) an =  f ( x ) cos dx
l −l l
1 l n x
bn =  f ( x ) sin dx
l −l l
T
where l = and T is period for periodic function.
2
Even X Odd→Odd.
Recall properties.
If f ( x ) is an even function, then bn = 0 .
Hence, its Fourier series is given by:
a0  n
f ( x) = +  an cos x
2 n=1 l
2 l
( II )
where
a0 =  f ( x ) dx Even
l 0
properties
2 l n
an =  f ( x ) cos x dx
l 0 l
8

Recall
properties

If f ( x ) is an odd function, then a0 = 0, an = 0 .


Hence, its Fourier series is given by:

n x
f ( x ) =  bn sin
( III ) n =1 l
2 l n x
where n l 0
b = f ( x ) sin dx
l

Odd X Odd → Even

Summary:

f ( x) Formula
Neither I
Even II
Odd III
9

Example 4

Find the Fourier series for


f ( x) = −x , −1  x  1
f ( x + 2) = f ( x ) .

Solution:
i) Determine T and l .
T = 2, l = 1.

ii) Draw the graph of f ( x ) .

f(x)

x
-3 -2 -1 1 3 5

iii) Check whether f ( x ) is an odd or even function (or neither).


Identify the corresponding formulae.

From the graph, f ( x ) is an odd function. Hence, the Fourier


series formulae are given by (III):
10

iv) Calculate the Fourier series of f(x).



f ( x ) =  bn sin n x
n =1
.
2 l n x
bn =  f ( )
x sin dx
l 0 l
1
= 2  − x sin n x dx
0
1
= −2  x sin n x dx
0

 cos n x sin n x 
1

= −2  − x + 2 2 
 n n  0
 cos n sin n  
= −2   − + 2 2  − (0 + 0) 
 n n   Remarks:
cos n
=2 sin n = 0
n
2 cos n = (−1) n
= (−1) n
n for n = 0,1, 2,...

Therefore,
2  (−1) n
f ( x) =  sin n x
 n =1 n .

Note: It is not wrong to use the full range of [-1,1] when computing bn . The result
will be the same; it’s just that you may encounter a longer calculation.
11

Example 5
Find the Fourier series for
− x −  x  0
f ( x) = 
x 0 x 
f ( x + 2 ) = f ( x )

Solution:
i) Determine T and l .
T = 2 , l =  .

ii) Draw the graph of f ( x ) .


f(x)

x
-2 π -π π 2π 3π

iii) Check whether f ( x ) is an odd or even function (or neither).


Identify the corresponding formulae.

From the graph, f ( x ) is an even function. Hence, the Fourier


series formulae are given by (II):
12

iv) Calculate the Fourier series of f(x).


a  n
f ( x ) = 0 +  an cos x
2 n=1 l
2 l
a0 =  x dx
l 0
2 
=  x dx
 0


2  x2  1
=   = ( 2 − 0) = 
  2 0 

2 l n x
an =
l 0
f ( x ) cos
l
dx

2  n x
=  x cos dx
 0 
2 
=  x cos nx dx
 0

2  x sin nx cos nx 
=  +
 n n2  0
2   sin n cos n 1 
= + − 2
  n n2 n 
2
= 2 (cos n − 1), n = 1, 2,3,....
n
13

Example 6
Show that the Fourier series of
 
f ( x) = sin x , − x
2 2
f ( x) = f ( x +  )

2 4 1
is given by f ( x) =



 4n
n =1
2
−1
cos 2nx.

Solution:
i) Determine T and l .

T =, l = .
2

ii) Draw the graph of f ( x ) .

iii) Check whether f ( x ) is an odd or even function (or neither).


Identify the corresponding formulae.
14

iv) Calculate the Fourier series of f(x).


2 2
 0
a0 = sin x dx
2

4 4
=  − cos x 02 =
 


4

an = 2
sin x cos(2nx) dx
0


2

= 2
(sin( x + 2nx) + sin( x − 2nx)) dx
0


2  cos( x + 2nx) cos( x − 2nx)  2
=  − −
 1 + 2n 1 − 2n  0

2 1 1  4
= + =
 1 + 2n 1 − 2n   (1 − 4n 2 )
15

Example 7
Find the Fourier series of
 x, −  x  0
f ( x) = 
0, 0  x  
f ( x + 2 ) = f ( x )

Solution:

i) Determine T and l .
T = 2 , l =  .

ii) Draw the graph of f ( x ) .


f(x)

-3π
.
-π π 3π
. -2π
. . 2π 4π x

iii) Check whether f ( x ) is an odd or even function (or neither).


Identify the corresponding formulae.
f ( x ) is neither even nor odd function. Hence, the Fourier series
formulae are given by (I):
16

iv) Calculate the Fourier series of f(x).


a   n n 
f ( x) = +   an cos
0
x + bn sin x
2 n=1  l l 

1 0
=
 x

cos nx dx
0
1 x 1 
=  sin ( nx ) + 2 cos ( nx )
 n n  −
1 1  ( − ) 
sin n ( − ) + 2 cos n ( − 2 ) 
1
= 0 + 2 − 
 n  n n 

11 1 
=  2 − 2 cos n 
 n n 
1
= 2 1 − cos n 
n
1
= 2 1 − ( −1)  , n = 1, 2,3,...
n

n  
17

4.4 Fourier Series for Half Range Expansions.

In this section, we will address the following question:

Can we find a Fourier series expansion of a function defined over a finite


interval? (as for now, we know a periodic function demands an infinite
interval)

The answer is YES, but we need to convert the non-periodic function into
a periodic function.

This can be accomplished by extending the definition of the function in


question to the interval [−l, 0] so that the extended function is either even
(if we want a cosine series) or odd (if we want a sine series).

Such Fourier series are called half-range expansions.

Fourier Cosine series form


a0  n x
f ( x) = +  an cos
2 n =1 l
where
2 l
f ( x ) dx
l 0
a0 =

2 l n x
an =  f ( x) cos dx, n = 1, 2,3,..
l 0 l

Fourier Sine series form



n x
f ( x ) =  bn sin
n =1 l
2 l n x
where bn =  f ( x ) sin dx, n = 1, 2,3...
l 0 l
18

Example 8
Find the half range Fourier series for
f ( x) = 1− x 0  x  1.

Solution:

i) Fourier Cosine.
To get the Fourier cosine series, we need to extend f ( x ) to be an
even function as shown below:
Remember!
Even function

Symmetry about y-
axis.

Hence, the Fourier cosine series of f ( x ) is


a0  n x
f ( x ) = +  an cos , l =1
2 n =1 l
where
a0 = 2 (1 − x ) dx
1

0
1
 x2 
= 2 x −  = 1
 2 0
19

and
an = 2 (1 − x ) cos n x dx
1

ii) Fourier Sine.

To get the Fourier sine series, we need to extend f ( x ) to be an


odd function as shown below:
f(x)
. Remember!
Odd function
x
-3 -2 -1 1 2 3 Symmetry about the
origin.

Hence, the Fourier sine series of f ( x ) is given by



n x
f ( x ) =  bn sin
n =1 l
where
20

2 l n x
bn =  f ( x ) sin dx, l =1
l 0 l

= 2  (1 − x ) sin n x dx
1

(1 − x ) 2
= −2 cos n x − sin n x 0
1

n n 2 2
−2 2 2
=  0 − 2 2 sin n + cos 0 + 0
n n n
2
=
n

Example 9 (Final exam 2017/2018)


21

Exercise:

1. The graph of f ( x ) is shown as below. Find its Fourier series.


f ( x)

(0, 2) ( , 2)

(−,0) x
Ans. 3 + 2  1 − (−1) n cos nx + (−1) n+1 sin nx 
 
 (n ) n
2
2 n =1 

2. Write the Fourier series for f ( x ) = sinh x , −  x   .

Ans. 2sinh 

n

 (−1)
n =1
n +1

1 + n2
sin nx.

3. Show that if f ( x ) = 0 when −3  x  0 , f ( x ) = 1 when 0  x  3, and


1
f (0) = , then
2
1 2  1 (2n − 1) x
f ( x) = +  sin .
2  n =1 2n − 1 3
22

4. Consider the following graph of f ( x ).


f ( x)

−2 − 0  2 x

−

a) Write the function of f ( x ).


b) Determine the Fourier series of f ( x ).
Ans. −  + 2 sin(2n − 1) x .

2 n =1 2n − 1

5. Write the Fourier Sine series for f ( x) =  − x (0  x   ) .



Ans. 2 sin nx
n =1 n

6. Let h be a given number in the interval (0,  ) . Find the Fourier cosine
series of the function
1 if 0 xh
f ( x) = 
0 if h  x 

Ans. f ( x) = 2h  1 + sin nh cos nx 


 
  2 n=1 nh

END
23

REFERENCES

1. Normah Maan et. al., (2008), Differential Equations Module, Jabatan


Matematik, UTM.
2. Nagel et. al., (2004), Fundamentals of Differential Equations, 5th ed., Addison
Wesley Longman.
3. Ruel V.Churchill and James W.B., (1978), Fourier Series and Boundary Value
Problems, McGraw Hill.

You might also like