1 Fourier Series: F X L X L

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

1 Fourier series

The Fourier series is the trigonometric series representing functions that are
periodic. If a function f (x) is defined over the interval −L < x < L, un-
der certain conditions, the Fourier series is a periodic approximation to this
function in that interval and it is defined as follows:

a (0) X nπx nπx
 
f (x) = + a (n) cos + b (n) sin
2 n=1 L L

where a (0), a (n) and b (n) are the Fourier coefficients defined as:

1ZL
a (0) = f (x) dx
L −L
1ZL nπx
a (n) = f (x) cos dx
L −L L
Z L
1 nπx
b (n) = f (x) sin dx
L −L L
In a special situation when the period of the function f (x) is 2L = 2π,
the Fourier series is given by

a (0) X
f (x) = + [a (n) cos nx + b (n) sin nx]
2 n=1

where

1Zπ
a (0) = f (x) dx
π −π
1Zπ
a (n) = f (x) cos nxdx
π −π
Z π
1
b (n) = f (x) sin nxdx
π −π
Given the( periodic function
−1 if −π ≤ x ≤ 0
f (x) = and f (x + 2π) = f (x). Find the Fourier
1 if 0 < x < π
series for this function.
Solution:

1
The period of f (x) is 2π, so its Fourier series is given by

a (0) X
f (x) = + [a (n) cos nx + b (n) sin nx]
2 n=1

where R0 Rπ R0 Rπ
1
a (0) = π −π −1dx+ π1 0 1dx = 0, a (n) = 1
π −π − cos nxdx+ π1 0 cos nxdx =
0, (
4
R0 Rπ n = 1, 3, 5, ...
b (n) = 1
π
1
−π − sin nxdx+ π 0 sin nxdx = − π2 −1+cos
n

= , nπ
0 n = 2, 4, 6, ...
We use SWP (use Define + Evaluate) to demonstrate the first five terms
of b(n) as follows:    4 
1
 π 
 2   0 
 
   4 
b 3  = 
 
 3π 

 4   0 
   
4
5 5π

So, the Fourier series of f (x) is



4X 1
f (x) = sin (2n − 1) x
π n=1 2n − 1

The graphical presentation and the animation of how the Fourier series
approximation approaches the periodic function can be seen by clicking
BITMAPSETExploration0.4514in0.3234in0inhttp://www.np.ac.sg/ yaw/mathresources/Fourier

Find the( Fourier series of the function


2 if 0 < t < 4
f (t) = and f (t + 8) = f (t)
0 if 4 < t < 8
Solution:
The period of f (x) is 8, so its Fourier series is given by

a (0) X nπx nπx
 
f (x) = + a (n) cos + b (n) sin
2 n=1 4 4

where
a (0) = 41 0π 2dx = 21 π,
R

a (n) = 14 04 2 cos nπx


R
4
dx = 0

2
(
4
1 R4 nπx n = 1, 3, 5, ...
b (n) = 4 0
2 sin 4
dx = −2 cos nπ
nπ−1
= nπ ,
0 n = 2, 4, 6, ...
The first 6 terms of b (n) are
   4 
1 π

 2 
  0
 

 4
3
  
   
b  =  3π 

 4 

 0



 4
5
  
   5π 
6 0

So the Fourier series of f (x) is



π 4X 1
f (x) = + sin (2n − 1) x
4 π n=1 2n − 1

The graphical presentation and the animation of how the Fourier series ap-
proximation approaches the periodic function can be seen from a Maple work-
sheet on WWW. (
x if 0 < x < π
Sketch the graph of f (x) = , . Expand f (x) in a
π if π < x < 2π
Fourier series given that the period is 2π.
Solution:
The period of f (x) is 2π, so its Fourier series is given by

a (0) X
f (x) = + [a (n) cos nx + b (n) sin nx]
2 n=1

where
a (0) = π1 0π xdx + π1 π2π πdx = 32 π,
R R

1 cos nπ+n(sin nπ)π−1 sin 2nπ−sin nπ


a (n) = π1 0π x cos nxdx+ π1 (
R R 2π
π π cos nxdx = π n2
+ n
=
−2
cos nπ−1+πn sin 2nπ n = 1, 3, 5, ...
πn2
= π1 cos nnπ−1
2 = πn2 ,
0 n = 2, 4, 6, ...
b (n) = π1 0π x sin nxdx+ π1 π2π π sin nxdx = − π1 − sin nπ+n(cos nπ)π − cos 2nπ+cos nπ
R R
n2
+ n
=
− − sin nπ+πn
πn2
cos 2nπ
= −1
n
,

3
The first 6 terms of b (n) are

−1
   
1

 2 


 − 12 

3 − 31
   
   
b  =  

 4 


 − 41 

5 − 51
   
   
6 − 61

So, the Fourier series of f (x) is


∞ ∞
3π 2X 1 X 1
f (x) = − 2 cos (2n − 1) x − sin x
4 π n=1 (2n − 1) n=1 n

The graphical presentation and the animation of how the Fourier series ap-
proximation approaches the periodic function can be seen on the WWW.
Find the(Fourier series of the function
sin x if 0 < x < π
f (x) = and f (x + 2π) = f (x)
0 if π < x < 2π
Solution:
The period of f (x) is 2π, so its Fourier series is given by

a (0) X
f (x) = + [a (n) cos nx + b (n) sin nx]
2 n=1

where Rπ
1
a (0) = π 0 sin xdx = π2 , (
1 Rπ 0 n = 1, 3, 5, ...
a (n) = 0 sin x cos nxdx = − π1 cos nπ+1
−1+n2
= −2
π n = 2, 4, 6, ...
π(n2 −1)
b (n) = π1 0π sin x sin nxdx = − π1 −1+n
sin nπ
= 0, for n 6= 1, and b (1) =
R
2
1 π
R 1
π 0
sin x sin xdx = 2
The first 6 terms of b (n) are
   1 
1 2

 2 
  0
 

3  0
   
  
b  =  

 4 

 0



5  0
   
  
6 0

4
So, the Fourier series of f (x) is f (x) = π1 + 12 sin x− π2 ∞ 1 P
n=1 (4n2 −1) cos 2nx
For the graphical presentation by Maple, we refter n to WWW.
Find the Fourier series of the function: f (x) = x2 if −π < x < π
and f (x + 2π) = f (x)
Solution:
The period of f (x) is 2π, so its Fourier series is given by

a (0) X
f (x) = + [a (n) cos nx + b (n) sin nx]
2 n=1

where Rπ
1
a (0) = π −π x2 dx = 32 π 2 ,
−4
(
1 Rπ 2 2 n2 (sin nπ)π 2 +2n(cos nπ)π−2 sin nπ 4(−1)n n2
n = 1, 3, 5, ...
a (n) = π −π x cos nxdx = π n3
= n2
= 4
n2
n = 2, 4, 6, ...
π
b (n) = π1 −π x2 sin nxdx = 0,
R

So, the Fourier series of f (x) is

1 ∞
(−1)n
f (x) = π 2 + 4
X
cos nx
3 n=1 n2

To see the graphical representation of the Fourier series approximation gen-


erated by Maple, we refter to WWW.

1.1 Fourier series of odd and even function


In the example 1 and 5 above, the functions f (x) are odd and even respec-
tively. We see that when f (x) is an odd function, it can be represented by a
cosine series. On the other hand if f (x) is even , it can be represented by a
sine series. Therefore, if we can determine if a function f (x) is either even
or odd, we can make use of the following properties to find the Fourier series
of f (x).

• When f (x) is odd, i.e. f (−x) = −f (x),

a (0) = a (n) = 0
1 Z 2L nπx
b (n) = f (x) sin dx
L 0 L

5
so that ∞
X nπx
f (x) = b (n) sin
n=1 L
• When f (x) is even, i.e. f (−x) = f (x),

b (n) = 0
1 Z 2L
a (0) = f (x) dx
L 0
1 Z 2L nπx
a (n) = f (x) cos dx
L 0 L
so that

a (0) X nπx
f (x) = + a (n) cos
2 n=1 L

1.2 Half-range Fourier series


Sometimes an engineering function f (x) is not periodic but is only defined
over a finite interval , 0 < x < L, say, In this case, Fourier analysis can still
be useful. As the region of interest is only that between 0 < x < L, we may
choose to define the function arbitrarily outside the interval. In particular,
we can make our choice so that the resulting function is periodic, with period
2L. For example, we can repeat the function periodically so that the resulting
function is a periodic even function and that f (x) can be represented by a
Fourier cosine series. Alternatively, we can repeat the function so that the
resulting function is a periodic odd function and that f (x) can be represented
by a Fourier sine series. Note that within the interval of interest nothing has
altered. Whichever extension we choose, the resulting Fourier series only
give a representation of the original function in the interval 0 < x < L and
as such is termed a half range Fourier series.
• Half range sine series:

a (0) = a (n) = 0
2ZL nπx
b (n) = f (x) sin dx
L 0 L

6
and

X nπx
f (x) = b (n) sin
n=1 L

• Half range cosine series:

1ZL
a (o) = f (x) dx
L 0
1ZL nπx
a (n) = f (x) cos dx
L 0 L
b (n) = 0

and


a (0) X nπx
f (x) = + a (n) cos
2 n=1 L

Graph an appropriate periodic extension of f (x) = x, 0 < x < π, and


hence find its half range cosine series representation.
Solution
Define an even function of period 2π:
(
−x if −π < x < 0
f (x) =
x if 0 < x < π

Since f (x) is an even function, we have


b (n) = 0 R
a (o) = π1 0π xdx = 12 π,
−2
(
1 Rπ 1 cos nπ+n(sin nπ)π−1 cos nπ−1 n2 π
n = 1, 3, 5, ...
a (n) = π 0x cos nxdx = π n2
= n2 π
=
0 n = 2, 4, 6, ...
Therefore, the Fourier series is

π 2X 1
f (x) = − cos (2n − 1) x
4 π n=1 (2n − 1)2

7
1.3 Chapter exercises
1. Find the Fourier series representation of the function with period equals
1
to 50 given by
(
1 if 0 < t < 0.01
f (t) =
0 if 0.01 < t < 0.02
 
1 2
Ans:f (t) = 2
+ π
sin 100πt + 13 sin 300πt + 15 sin 500πt + ...

2. Find the Fourier series representation of


n
f (t) = 1 + t if −π < t < π f (t + 2π) = f (t).
Ans:f (t) = 1 + 2 sin t − sin 2t + 23 sin 3t + ...

3. n
Find the Fourier series of the function with period 2π defined by f (t) =
t2 if 0 < t < 2π
   
4π 2
Ans:f (t) = 3
+ 4 cos t + cos 2t + 49 cos 3t + ... −π 4 sin t + 2 sin 2t + 43 sin 3t + ...

4. n
By defining an appropriate periodic extension of the function f (t) =
t if 0 < t < π f (t + 2π) = f (t), find the half-range cosine series
representation.
π 4 4
Ans:f (t) = 2
− π
cos t − 9π
cos 3t − ...

5. Obtain the Fourier cosine series with period 2π for the function
(
t if 0 < t < π2
f (t) = π
2
if π2 < t < π
h  

Ans:f (t) = 8
− π2 cos t + 1
32
cos 3t + 1
52
cos 5t + ... + 2 1
22
cos 2t + 1
62
cos 6t + 1
102
cos 10t

6. Determine if the function is even , odd or neither. Hence obtain its


Fourier series:
π

 sin 2t if −π < t < − 2

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

sin 2t if 2
<t<π
P∞ (−1)n+1
Ans:f (t) = 12 sin 2t + 4
π n=1 (2n−1)2 −4 sin (2n − 1) t

8
2 MRM
3 Basic Definitions
A function f (x) is said to be periodic with period p if f (x + p) = f (x) for
all x in the domain of f . This means that the function will repeat itself
every p units. The trig functions sin x and cos x are periodic with period
2π, as well as with period 4π, 6π, 8π, etc. The fundamental period is the
smallest positive period of a function. The function sin nx is periodic, with
fundamental period 2π n
, though it also has period 2π.
If two functions are period with the same period, then any linear com-
bination of those functions is periodic with the same period. In particular,
the sum a0 + ∞
P
n=1 (an cos nx + bn sin nx) has period 2π. This sum is called
a Fourier series, where ai , bi are called Fourier coefficients. Given a function
f (x) which has period 2π, we write

X
f (x) = a0 + (an cos nx + bn sin nx)
n=1

where the Fourier coefficients of f (x) are given by the Euler formulas
1 Zπ 1Zπ 1Zπ
a0 = f (x)dx, an = f (x) cos(nx)dx, bn = f (x) sin(nx)dx
2π −π π −π π −π
for n ≥ 1. This is another way of expressing a function in terms of an infinite
series. A Fourier series will converge to the function f (x) for a function which
is piecewise continuous and has a left and right hand derivative at each point
of the domain. At a point of discontinuity, the Fourier series will converge
to the average of the left and right limits at that point. One main use of
Fourier series is in solving partial differential equations.
If the function has period 2L instead of period 2π, then we make a sub-
stitution in the formulas above. Replace every x above with X, and then
X x
perform the substitution 2π = 2L , or X = Lπ x. The function sin πx
L
has period
2L, and the Fourier series becomes
∞ 
nπx nπx
X 
a0 + an cos + bn sin
n=1 L L
where the Fourier coefficients are given by
1 ZL 1ZL nπx 1ZL nπx
a0 = f (x)dx, an = f (x) cos dx, bn = f (x) sin dx.
2L −L L −L L L −L L

9
3.1 Examples
Let f (x) = { 1 0 < x < π
− 1 − π < x < 0. The function f (x) has period 2π. We compute a0 =
1 Rπ 1 R0 Rπ 1
2π −π
f (x)dx = 2π −π −1dx + 0 1dx = 2π (−π + π) = 0. Also, we have

1 Rπ 1 Rπ
an = π −π
f (x) cos(nx)dx  bn = π −π
f (x) sin(nx)dx 
1 R0
− cos(nx)dx + 0π 1 R0 Rπ

R
= π  −π
cos(nx)dx = π  −π
sin(nx)dx + sin(nx)dx
  0
1 sin nx 0 sin nx π 1 cos nx 0 cos nx π
= π
− n
|−π + n
|0 = π n
|−π − n |0
1 1 1
= π
(0 − 0 + 0 − 0) = ( − n − cosnnπ + 1)
π n
cos nπ
1
=0 = nπ
(2 − 2 cos nπ)
4
If n is even then cos nπ = 1. If n is odd then cos nπ = −1. Hence bn = nπ
if
n is odd and bn = 0 if n is even. This means that we can write

4 4 1 1 1
X 
f (x) = { 1 0 < x < π−1−π < x < 0 = 0+ sin nπ = sin x + sin 3x + sin 5x + sin
n=0 nπ π 3 5 7
The Fourier series of f (x) = af1 (x) + bf2 (x) is found by computing the
Fourier series of f1 and f2 , multiplying by a and b and then adding. The
function f (x) = { 2 0 < x < π
0 − π < x < 0 is the same as f1 (x) + f2 (x), where f1 (x) = { 1 0 < x < π
− 1 − π < x < 0 and f2 (x) = 1. The Fourier series of f1 (x) was computed
above, and the Fourier series f2 has coefficients a0 = 1, an = bn = 0, so its
Fourier series is simply f2 (x) = 1. Hence this gives the Fourier series

4 4 1 1 1
X 
{ 2 0 < x < π0−π < x < 0 = 1+ sin nπ = 1+ sin x + sin 3x + sin 5x + sin 7x + ·
n=0 nπ π 3 5 7
Division by 2 gives the Fourier series

1 X 2 1 2 1 1 1

{ 1 0 < x < π0−π < x < 0 = + sin nπ = + sin x + sin 3x + sin 5x + sin 7x + ·
2 n=0 nπ 2 π 3 5 7
We now consider a function with period 8 defined by the f (x) = { 0 − 4 <
x < −2
1−2<x<2
02 < x < 4. This function is 1 for −2 < x < 2, 6 < x < 10, etc. It is a
regular pulse which is on for 4 units of time, and then off for four units of
time. Since the period is not 2π,R but instead 2L = 8, we have L = 4. The
4 1 R2
Fourier coefficients are a0 = 2(4) −4 f (x)dx = 8 −2 1dx = 12 , and
1

10
4 4
an = L1 −4 f (x) cos nπx bn = L1 −4 f (x) sin nπx
R R
4
dx 4
dx
2 2
= 14 −2 cos nπx = 14 −2 sin nπx
R R
4
dx 4
dx
= − 14 nπ 4
sin nπx |2
4 −2
= − 14 nπ 4
cos nπx |2
4 −2
1 nπx 2 1 nπx 2
= − nπ sin
 |
4 −2  = − nπ cos
 |
4 −2 
= − nπ sin 4 − sin −2nπ
1 2nπ
4
= − nπ cos 2 − cos −nπ
1 nπ
2
1
= nπ (2 sin nπ2
) = nπ1
(0) = 0
2
If n is even, then an = 0 as sine is 0 at integer values. We have a1 = nπ =
2
a5 = a9 = · · ·, and a3 = − nπ = a7 = a11 = · · ·. Hence the Fourier series is

1 2 πx 1 3πx 1 5πx 1

f (x) = { 0 −4 < x < −21−2 < x < 202 < x < 4 = + cos − cos + cos − c
2 π 4 3 4 5 4 7

4 Orthogonality of Trigonometric functions


π π
ForR any integers m 6= n, we have −π
R R
cos nx cos mxdx = 0, −π sin nx sin mxdx =
π R π
0, −π sin nx cos mxdx = 0. In addition, if m = n then −π sin nx cos nxdx =
0. Because these integrals are zero, we say that sin nx, cos mx forms an
orthogonal system of functions. This is proved using the trigonometric iden-
tities cos nx cos mx = 21 (cos(n + m) + cos(n − m)), sin nx sin mx = 21 (cos(n −
m)−cos(n+m)), sin nx cos mx = 12 (sin(n+m)+sin(n−m)),

together

with the
fact that n±m 6= 0 is an integer, and so −π cos(n±m)dx = 0 and −π sin(n±
1
m)dx = 0. If n = m, then cos nx cos nx Rπ
= 2 (cos(2nx)+1) andRsin nx sin nx =
1 π
2
(1 − cos 2nx), so we can compute −π cos nx cos nxdx = 21 −π (cos(2nx) +
1)dx = 12 (sin(2nx)/2n + x)|π−π dx = π and −π π Rπ
sin nx sin nxdx = 21 −π (1 −
R

cos(2nx))dx = 12 (x−sin(2nx)/2n)|π−π dx = π. These facts are used derive Eu-


ler’s formulas for the Fourier coefficients. If we multiply both sides of f (x) =
a0 + ∞
P
(a cos nx+bn sin nx)R by cos mx, and then integrate
Rπ n
n=1 term by terms,
π P∞ Rπ
weRhave −π f (x) cos(mx)dx = −π a0 cos(mx)dx+ n=1 (an −π cos nx cos(mx)dx+
π Rπ
bn −π sin nx cos(mx)dx) = 0 + am π. Hence am = π1 −π f (x) cos(mx)dx. The
other coefficients are derived similarly.

4.1 Half-Wave Rectifier


A half wave rectifier clips off the negative portion of a trigonometric function.
The function f (x) = { 0 − ωπ < x < 0
sin ωx0 < x < ωπ , where p = 2L = 2π ω
has had the negative portion of the

11
sine wave clipped off (hence has passed through a half wave rectifier). The
Fourier coefficients are (using the same trig identities as above)

ω Z π/ω 1 1
a0 = sin ωxdx = − cos ωx|π/ω
0 = ,
2π 0 2π π
R π/ω
and an = ωπ 0 sin ωt cos nωtdt
ω R π/ω
= 2π 0  sin(1 + n)ωt + sin(1 
− n)ωtdt
1
= − 2π cos(1+n)ωt
(1+n)
+ (1−n)ω |πω
cos(1−n)ωt
0
 
1 cos(1+n)π cos(1−n)π 1 1
= − 2π (1+n)
+ (1−n)
− 1+n − 1−n
. If n is odd, this is zero. If n is
 
1 2 2 2
even, then an = 2π 1+n
= − (n−1)(n+1)π
+ 1−n
. You can also calculate
b1 = 1/2 and bn = 0 for all n ≥ 2. This gives the Fourier series as
1 1 2 1 1 1
 
f (x) = + sin ωx− cos 2ωx + cos 4ωx + cos 6ωx + · · · .
π 2 π 1·3 3·5 5·7

5 Even and Odd Functions


We often use the facts that cos(−x) = cos(x) and sin(−x) = − sin(x) in
some of the work above. Any function f (x) which satisfies f (−x) = f (x) is
called an even function (polynomials with only even powers of x are even
functions). An odd function satisfies f (−x) = −f (x) (and polynomials
with only odd powers of x are odd functions). Even functions are sym-
metric about the y-axis. Odd functions are symmetric aboutRthe origin. The
Fourier coefficients of an even function are simply a0 = L1 0L f (x)dx, an =
2 RL
L 0
f (x) cos nπx
L
dx, bn = 0, and the corresponding Fourier series is called
a Fourier cosine series.R Similarly, for an odd function the coefficients are
a0 = 0, an = 0, bn = L2 0L f (x) sin nπx
L
dx, and the corresponding Fourier se-
ries is called a Fourier sine series. This comes because the product of two
even functions is even, the product of two odd functions is even, and the
product of an even and an odd function is odd. In addition, integration from
−L to L of an odd function is zero, while integration from −L to L of an
even function is twice the integral of 0 to L.
The sawtooth wave is the function f (x) = x+π for −π < x < π, and f (x+
2π) = f (x). It can be written as the sum of an even function f1 (x) = π and
an odd function f2 (x) =  x. The corresponding Fourier cosine and  sine series
1 1 1
are f1 = π and f2 = 2 sin x − 2 sin 2x + 3 sin 3x − 4 sin 4x + · · · . Addition

12
 
of series gives f (x) = π + 2 sin x − 12 sin 2x + 31 sin 3x − 41 sin 4x + · · · . (The
coefficients bn are obtained using integration by parts and bn = − n2 cos nπ.)
If a function is defined on the interval [0, L], then it is possible to expand
the function periodically onto the interval [−L, 0] by either using an even
expansion (reflection about the y axis), or an odd expansion (reflection about
the origin). Both expansions are called half-range expansions. The Fourier
series of an even half-range expansion is the Fourier cosine series, and the
Fourier series of an odd half-range expansion is the Fourier sine series.
Consider the triangle f (x) = { x 0 ≤ x ≤ L/2
L − xL/2 ≤ x ≤ L. The Fourier cosine series has coefficients

1 Z L/2 1ZL 1 2 Z L/2 nπx 2ZL nπx


a0 = xdx+ (L−x)dx = , an = x cos dx+ (L−x) cos dx.
L 0 L L/2 2 L 0 L L L/2 L
  L/2
R L/2 L2
Integration by parts gives 0 x cos nπx
L
L
dx = x nπ sin nπx
L
+ n2 π 2
cos nπx
L
0
    
L2 nπ L2 nπ L2 RL nπx L L2
= 2nπ
sin 2
+ n2 π 2
cos 2
− n2 π 2
and L/2 (L−x) cos L
dx = (L − x) nπ sin nπx
L
− n2 π 2
cos nπL
    
L2 L2 L2 L2 L2
= 0− 2 2 cos nπ − sin nπ − n2 π 2
cos nπ . This means an = 2
sin nπ + n2 π 2
cos nπ −
n π 2nπ 2
 2 L 2nπ 2 2 n
= n2L
2 π2 2 cos nπ2
− 1 − cos nπ . We have a0 = 12 , a2 = −8L/(2 π ), a6 = 2 2

−8L/(62 π 2 ), a10 = −8L/(102 π 2 ), . . ., and an = 0 for all n which are odd


or multiples of 4. Hence the even expansion of f has Fourier series
1 8L 1 2πx 1 2πx 1 2πx
 
f (x) = − 2 2
cos + 2 cos + 2 cos + ··· .
2 π 2 L 6 L 10 L
Similar computations show that if we use a half-range odd expansion, then
bn = n4L nπ
2 π 2 sin 2 , which means bn = 0 for all even n, and we have

4L 1 πx 1 3πx 1 5πx
 
f (x) = sin − sin + sin − ··· .
π 2 12 L 32 L 52 L

6 Identities
Fourier series can be used to prove various identities. For example, the
Fourier series of sin2 x is 21 − 12 cos(2x), a familiar identity. Fourier series also
give sin4 x = 83 − 12 cos 2x + 18 cos 4x. Essentially you can use Fourier series to
derive a power reduction formula for any power of sin x or cos x.

13
In addition, Fourier series when evaluated at a point can yield interesting
results. The function f (x) = x2 on the interval −1 < x < 1 has Fourier
coefficients a0 = 13 , an = n24π2 cos nπ, bn = 0. This means

1 4 1 1 1 1
 
x2 = − 2 cos πx − cos 2x + cos 3x − cos 4x + · · · .
3 π 12 22 32 42
Evaluation at 0 gives a formula for π 2 /12. Evaluation at 1/2 and 1 gives
additional expressions involving π 2 . These identities can lead to powerful
ways of giving numerical approximations to π, and other numbers.

7 Where do people use Fourier Series


Besides mathematicians who like studying infinite series for fun, Fourier series
have an extremely useful application in the telecommunications and graphics
industry (cell phones, internet, land lines, JPG, MP3, radio communication,
etc.). Radio waves can be thought of as periodic vibrations of space, sent
by a radio transmitter. These vibrations are sent out in all directions, and
are captured by antennae. Your radio receiver computes Fourier integrals to
compute the coefficients of the signal received. The FCC dictates at what
frequency people are allowed to broadcast. We will discuss this more in class
with an animation.
In addition, Fourier series play a major role in modeling heat transfer.
Engineers use Fourier series to model the transfer of heat in jet engines, car
engines, space craft, and any other device which could fail because it over-
heats. You can learn more about this topic in a course on partial differential
equations. We’ll take up a brief study of partial differential equations in the
next chapter, and briefly show where Fourier series appear.

14
8 MRM 1
8.1 Fourier Series Expansion of a Function
8.1.1 Fourier Series Expansion of a Function over (−π, π)
A Fourier series expansion designed to represent a given function f(x) defined
over a finite interval (−π, π), is a sum of terms

1 X
f (x) = a0 + [an cos(n x) + bn sin(n x)] (1)
2 n=1

and the constant coefficients (an , bn ) are


1 Zπ 1 Zπ
an = f (y) cos(n y) dy, bn = f (y) sin(n y) dy. (2)
π −π π −π
(For a derivation of these equations see Sec.?? and Eqs.(??) and (??).)

Whether or not you are working with a function which is periodic, the Fourier
expansion will represent a periodic function for all x, in this case having pe-
riod 2 π.

The first term of the expansion


1 1 Zπ
a0 = f (y) dy = hf (x)i (3)
2 2 π −π
is the (un-weighted) average of f(x) over the domain (−π, π). Hence a0 will
always be twice the average value of the function over the domain.

If f(x) is an even function (f (−x) = f (x)), then only the cos(n x) terms con-
tribute. If f(x) is an odd function (f (−x) = −f (x)), then only the sin(n x)
terms contribute.

If you are trying to find a fourier expansion for a function or expression f(x)
which is a homemade function which involves ”if..then..else” constructs, it is
necessary to do the preliminary work ”by hand”.

On the other hand, if the given function is a smooth function defined in


terms of elementary functions and polynomials, or includes abs of elements

15
of the function, one can use the fourie package to do most of the work
in obtaining the desired Fourier series expansion. This package is —calcu-
lus/fourie.mac—, and there is also a short demo file —fourie.dem—.

Although many secondary functions defined in this mac file are usable once
you load the package, they are not documented in the Maxima manual. The
Maxima manual gives a brief definition of the primary tools available, but
gives no examples of use, nor is there an example file for such primary func-
tions as fourier, foursimp, and fourexpand.

8.1.2 Fourier Series Expansion of f (x) = x over(-π, π)


We first use the coefficient formulas Eq.(??) to find the Fourier expansions
of this simple linear function f (x) = x by hand.

Because the average value of f(x) over the domain (−π, π) is zero, a0 = 0.
Because f(x) is an odd function, we have an = 0 for all n > 0. (((n 2 (-
1) (n (2 1 2 1 2 (3 2 5 3 7 ((2 sin(3 x) (3 sin(4 x) 2 sin(3 x) - ——– +
———- - sin(2 x) + 2 sin(x)] 2 3 The list contains, in order, the lowest
approximation 2 sin(x) which retains only the n = 1 term in the expansion,
the two term approximation 2 sin(x) − sin(2 x), which includes the n = 1, 2
terms, etc. We now load the draw package and the qdraw package (the
latter available with Ch. 5 material on the author’s webpage) to make two
simple plots. We first make a plot showing the function f (x) = x in blueblue,
the one term approximation (—fs(1) = 2 sin(x)—) in redred, and the two
term approximation (—fs(2) = 2 sin(x) - sin(2 x)—) in PineGreengreen.
(qdraw(...), qdensity(...), syntax: type qdraw();
(ex([x,fs(1),fs(2)],x,- In this plot (see next page), we have taken control
of the x and y range, using the approximate fudge factor —1.4— to relate
the horizontal canvas extent to the vertical canvas extent (see our discussion
in Ch. 5 if this is all new to you) to get the geometry approximately correct.
In the next plot we include one, two, three and four term approximations.
(ex([x,fs(1),fs(2),fs(3),fs(4)],x,- with the four term approximation in purple
being a closer approximation to f (x) = x (see the figure on the next page).

16
[scale=.8]ch7p3.eps

Figure 1: One and Two Term Approximations

[scale=1.2]ch7p4.eps

Figure 2: 1, 2, 3, and 4 Term Approximations

9 MRM2
9.0.3 Fourier Series Expansion of a Function Over (−p, p)
The Fourier series expansion of a function defined over the interval −p ≤ x ≤ p
(and whose Fourier expansion will represent a function which has a period
2 p) can be found from the expansion over the interval (−π, π) which we
have been using above by a simple change of variables in the integrals which
appear in Eqs.(??) and (??).

However, we will simply use the results derived in Sec.??, and written down
in Eqns (??) and (??).

" ! !#
1 X πnx πnx
f (x) = a0 + an cos + bn sin (4)
2 n=1 p p
with the corresponding coefficients (for an , n = 0, 1, ..., for bn , n = 1, ...):
! !
1 Zp πny 1 Zp πny
an = f (y) cos dy, bn = f (y) sin dy. (5)
p −p p p −p p
We need to warn the user of the package fourie.mac that they use the sym-
bol a0 to mean our a0 /2.

Our a0 is defined by
1 Zp
a0 = f (x) dx (6)
p −p
The fourie.mac package’s definition of their a0 is
1 Zp
[a0 ]fourie.mac = f (x) dx (7)
2 p −p
which defines the average value of the function over the domain and which
becomes the first term of the fourier series expansion they provide.

17
9.0.4 Fourier Series Expansion of the Function |x|
We define the function to have period 4 with f (x) = |x| for −2 ≤ x ≤ 2.
This function is an even function of x so the sin coefficients bn are all zero.
The average value of |x| over the domain (−2, 2) is greater than zero so we
willl have a non-zero coefficient a0 which we will calculate separately. We do
this calculation by hand here.

Note that the Maxima function integrate cannot cope with abs(x): (2
/ [ I abs(x) cos(——-) dx ] 2 / - 2 (2 so we will split up the region of
integration into two sub-intervals: −2 ≤ x ≤ 0, in which |x| = −x, and the
interval 0 ≤ x ≤ 2 in which |x| = x. We will use the formula Eq. (??) for
the coefficients an (note that an = 0 if n is even) and the expansion formula
Eq. (??). (((((integrate(x*cos(n*n 4 (- 1) 4 (2 2 2 2 (n 4 ((- 1) - 1) (2 2 (n
4 ((- 1) - 1) (2 2 (8 8 8 (2 2 2 (

18
(8 cos(—–) 8 cos(——-) 8 cos(—–) 2 2 2 (2 2 2 5 8 cos(——-) 8 cos(——-)
8 cos(—–) 2 2 2 - ————– - ————– - ———— + 1] 2 2 2 25 (qdraw(...),
qdensity(...), syntax: type qdraw();
((( The first function in the plot list is |x|, represented by abs(x), which
appears in the color blue. We see that the expansion out to n = 5 provides
a close fit to |x|. Here is that comparison:

[scale=1.2]ch7p5.eps

Figure 3: n = 5 Approximation to |x|

We now try out the package fourie.mac on this example: ((((

19
((0
n 4 (- 1) 4 (n 2 2 2 2
(n
(((0
n 4 ((- 1) - 1) (n 2 2
(n
(((((8 cos(—–) 8 cos(——-) 8 cos(—–) 2 2 2 (2 2 2 5 8 cos(——-) 8 cos(—
—-) 8 cos(—–) 2 2 2 - ————– - ————– - ———— + 1] 2 2 2 25 Notice
that (a0 )fourie = 1 = 12 (a0 )ourdef , (see Eq. (??) ) so that —fourie.mac—’s
expansion starts off with the term a0 rather than 12 a0 . Of course, the actual
end results look the same, with the first term in this example being 1, which
is the average value of |x| over the domain (−2, 2).

Here we chose to use the package function foursimp to simplify the appear-
ance of the coefficients. We see that —fourie.mac— is able to cope with the
appearance of abs(x) in the integrand, and produces the same coefficients
and expansions as were found ”by hand”.

9.0.5 Fourier Series Expansion of a Rectangular Pulse


We define f(x) to be a function of period 4, with f = 0 for −2 ≤ x < −1,
3/2 for −1 ≤ x ≤ 1 and f = 0 for 1 < x ≤ 2. ((3 3 3 (2 2 2 (qdraw(...),
qdensity(...), syntax: type qdraw();
( The plot of f(x) shows a square pulse with height 3/2 above the x axis
and with a width of 2 units over the interval −1 ≤ x ≤ 1. Over the rest of
the domain −2 ≤ x ≤ 2, f(x) is defined to be zero.

[scale=0.7]ch7p6.eps

Figure 4: Rectangular Pulse of Height 3/2

Although we can make a plot of the function f(x) as defined , Maxima’s


integrate function cannot do anything useful with it, and hence neither can
—fourie.mac— at the time of writing. (2 / [ 3 (] 2 / - 2 Hence we must
compute the Fourier series expansion ”by hand”. We see that f(x) is an even
function
(f (−x) = f (x)), so only the cos(n π x/2) terms will contribute, so we only
need to calculate the an coefficients. ((

20
(3 (2 (3 sin(—–) 2 ((3 1 3 3 ( We see that for n > 0, an = 0 for n even, and
the non-zero coefficients have n = 1, 3, 5, 7, .... Hence we only get a better
approximation if we increase nmax by 2 each time. ((3 cos(—–) cos(——-)
3 cos(—–) 2 3 2 2 3 ((( The plot with the approximations —fs(1)— and
—fs(3)— was drawn first.

[scale=0.9]ch7p7.eps

Figure 5: nmax = 1, 3 Approx. to Rectangular Pulse

21
Then a plot showing the —fs(11)— approximation:

[scale=0.7]ch7p8.eps

Figure 6: nmax = 11 Approx. to Rectangular Pulse

9.0.6 Fourier Series Expansion of a Two Element Pulse


We compute the Fourier series expansion of a function which has the defi-
nition over the interval (−10, 10) (and whose Fourier series expansion will
be a function with period 20 for all x) given by: for −10 ≤ x < −5, f = 0,
and for −5 ≤ x < 0, f = −5, and for 0 ≤ x ≤ 5, f = 5, and for 5 < x ≤ 10,
f = 0. First we define such a function for our plots. (elseif x ¿= 0 and x
¡= 5 then 5 else 0(( and plot the function (qdraw(...), qdensity(...), syntax:
type qdraw(); ( which looks like

[scale=0.5]ch7p15.eps

Figure 7: Two Element Pulse with Period 20

22
Since we have an odd function, only terms like bn sin(n π x/10) will con-
tribute to the expansion, but, just for practice, we find an too. (integrate(
5, x, 0, 5 ) ); ((integrate(5*cos(n*((integrate( 5*sin(n*ratsimp(10 cos(—–) -
10 2 ((10 cos(—–) - 10 2 ((10 10 10 2 10 10 (((10 sin(—–) 10 sin(—–) 10
sin(—–) 10 5 10 (3 10 sin(——-) 10 sin(—–) 10 sin(—–) 10 5 10 —————
+ ————- + ————-] 3 (ex( [f(x), fs(1), fs(2) ], x, -10, 10 ) ) The plot
of f(x) with the two lowest approximations looks like

[scale=0.9]ch7p16.eps

Figure 8: Two Lowest Order Approximations

23
The expansion fs(11) does pretty well as a rough approximation (ex( [ f(x),
fs(11) ], x, -10, 10 ) )

[scale=0.8]ch7p17.eps

Figure 9: nmax = 11 Approx. to Two Element Pulse

Whether you are working with a periodic function or not, the Fourier series
expansion always represents a periodic function for all x. For this example,
the period is 20, and if we make a plot of fs(11) over the range —[-10, 30]—,
we are including two periods. ( which looks like

[scale=0.8]ch7p18.eps

Figure 10: nmax = 11 Approx. Drawn for Two Periods

24
9.0.7 Exponential Form of a Fourier Series Expansion
The exponential form of a Fourier series can be based on the completeness
and orthogonality (in the Hermitian sense) of the set of exponential functions
( !)
2πinx
exp (n = 0, ±1, ±2, · · ·) (8)
b−a
on the interval (a, b). Define the function φn (x) as
!
−2 π i n x
φn (x) = exp . (9)
b−a
This function has the properties
φ−n (x) = φn (x)∗ , φn (x) φn (x)∗ = 1. (10)
in which the asterisk indicates the complex conjugate.

The (Hermitian) orthogonality of the {φn (x)} over (a, b) is expressed by


Z b
φn (x) φm (x)∗ dx = (b − a) δn m , (11)
a

in which the Kronecker delta symbol is


( )
1 f or n = m
δn m = (12)
6 m.
0 f or n =
Eq.(??) is clearly true for n = m, using Eq.(??). For m 6= n, we can sim-
plify this integral by using the exponential product law eA eB = eA+B , let-
ting r = m − n 6= 0, and changing the variable of integration x → y via
x = (b − a) y + a. The resulting integral in terms of y will then be over the
interval (0, 1). The differential dx → (b − a) dy and (b − a) comes outside
the integral. Also, inside the exponential, x/(b − a) → a/(b − a) + y, and
we can take outside
R1
an exponential function of a constant. Thus the integral is
proportional to 0 exp(2 π i r y) dy, which is proportional to exp(2 π i r) − 1 = exp(2 π i)r − 1 =

We now write some function of x as a linear combination of the φn (x) with


coefficients Cn to be determined.

X
f (x) = Cn φn (x). (13)
n=−∞

25
To find the {Cn }, we multiply both sides of Eq.(??) by φm (x)∗ dx, inte-
grate both sides over the interval (a, b), and use orthogonality, Eq.(??).
Rb ∗ P∞ Rb ∗
f
a P (x) φm (x) dx = n=−∞ C n a n (x) φm (x) dx
φ
= ∞ n=−∞ Cn (b − a) δn m
= (b − a) Cm . Hence we have for the coefficients
Z b
1
Cn = f (x) φn (x)∗ dx. (14)
(b − a) a
P∞
Inserting these

coefficients

into Eq.(??) we can write

f(x) = n=−∞ Cn φn (x)
P∞ −2 π i n x 1 Rb 2πiny
= −∞ exp b−a b−a a
f (y) exp b−a dy
 
1 P∞ b
R 2 π i n (y−x)
= b−a −∞ a f (y) exp b−a
dy. We now separate out the n = 0
term and combine the n = ±m terms into a sum over the positive integers.
f(x) = 1 Rb P∞ R b Rb P∞ R b
b−a
a
1
f (y) dy+ b−a n=1 a
f (y) [exp(
2 π i n (y−x)
b−a )+exp( −2 π b−a
i n (y−x) 1
)] dy= b−a a
2
f (y) dy+ b−a n=1 a
f(
Using the trig identity cos(A − B) = cosA cosB + sinA sinB, we recover the
trigonometric form of the Fourier series expansion of a function over the in-
terval (a, b), which will represent a function which has period equal to (b - a)
for all values of x.

1 2πnx 2πnx
X     
f (x) = a0 + an cos + bn sin (15)
2 n=1 b−a b−a
The coefficients are given by the integrals
2 Zb 2πny 2 Zb 2πny
   
an = f (y) cos dy, bn = f (y) sin dy.
b−a a b−a b−a a b−a
(16)
The expansion starts with the term
1 1 Zb
f (x) = a0 + · · · = f (y) + · · · (17)
2 b−a a
which is the (unweighted) average of f (x) over (a, b).

If we specialize to a function defined over the interval (-p, p), whose Fourier
expansion will represent a function which has period 2 p for all x, the above
results have the replacements 2/(b − a) → 2/(2 p) → 1/p, and the appro-
priate exspansion equations are

" ! !#
1 X πnx πnx
f (x) = a0 + an cos + bn sin (18)
2 n=1 p p

26
with coefficients
! !
1 Zp πny 1 Zp πny
an = f (y) cos dy, bn = f (y) sin dy. (19)
p −p p p −p p

If we specialize further to p = π, the appropriate equations are



1 X
f (x) = a0 + [an cos(n x) + bn sin(n x)] (20)
2 n=1

with coefficients
1 Zπ 1 Zπ
an = f (y) cos(n y) dy, bn = f (y) sin(n y) dy. (21)
π −π π −π

9.1 Fourier Integral Transform Pairs


9.1.1 Fourier Cosine Integrals and fourintcos(..)
Given some function f (x) defined for x ≥ 0, we define the Fourier cosine
transform of this function as
2Z ∞
FC (f , ω) = cos(ω x) f (x) dx (22)
π 0
The given function f (x) can then be written as an integral over positive
values of ω: Z ∞
f (x) = FC (f , ω) cos(ω x) dω (23)
0

The two equations (??) and (??) are an example of a ”Fourier transform
pair”, which include conventions about where to place the factor of 2/π.

Here is a simple example. We let the function be f (x) = sin(x) e−x , defined
for x ≥ 0. Let the letter —w— be used to stand for ω. We first calculate the
Fourier cosine transform FC (f , ω) (we use the symbol —fcw— in our work
here) using integrate and then show that the inverse integral over ω gives
back the original function. ((2 2 2 w (4 4 w + 4 2 w + 8 (2 2 (w - 2) (4 (Is
x positive, negative, or zero? p; - x (

27
We can also use the package fourie.mac, which we explored in the section
on Fourier series. This package provides for the calculation of our Fourier
cosine transform integral via the fourintcos(expr,var) function. The func-
tion fourintcos(f,x) returns an answer with the label az which contains the
Fourier cosine integral FC (f , z), with the letter —z— being the package con-
vention for what we called —w— (ω), (((2 2 z 2 (—— - ——) 4 4 z + 4 z
+ 4 (z
((2 2 z - 4 (4 (2 2 (z - 2) (4 Thus fourintcos(expr,var) agrees with our
definition of the Fourier cosine transform.

9.1.2 Fourier Sine Integrals and fourintsin(..)


Given some function f (x) defined for x ≥ 0, we define the Fourier sine trans-
form of this function as
2Z ∞
FS (f , ω) = sin(ω x) f (x) dx (24)
π 0
The given function f (x) can then be written as an integral over positive
values of ω: Z ∞
f (x) = FS (f , ω) sin(ω x) dω (25)
0

The two equations (??) and (??) are another ”Fourier transform pair”, which
include conventions about where to place the factor of 2/π.

28
Here is a simple example. We let the function be f (x) = cos(x) e−x , defined
for x ≥ 0. Let the letter —w— stand for ω. We first calculate the Fourier
sine transform FS (f , ω) (we use the symbol —fsw— in our work here) using
integrate and then show that the inverse integral over ω gives back the
original function. (((3 w (4 w + 4 (3 2 w (4 (Is x positive, negative, or zero?
p; - x ( We can also use the package fourie.mac, which we used above.
This package provides for the calculation of our Fourier sine transform inte-
gral via the fourintsin(expr,var) function. The function fourintsin(f,x)
returns an answer with the label bz which contains the Fourier sine integral
FS (f , z), with the letter —z— being the package convention for what we
called —w— (ω). (((((((3 2 z (z 4
((3 2 z (4 Thus fourintsin(expr,var) agrees with our definition of the
Fourier sine transform.

29
9.1.3 Exponential Fourier Integrals and fourint
Given some function f (x) defined for −∞ < x < ∞, we define the exponen-
tial Fourier transform of this function as
1 Z∞
FExp (f , ω) = f (x)ei ω x dx (26)
2 π −∞
The given function f (x) can then be written as an integral over both positive
and negative values of ω:
Z ∞
f (x) = FExp (f , ω) e−i ω x dω (27)
−∞

The two equations (??) and (??) are another ”Fourier transform pair”, which
include conventions about where to place the factor of 2 π as well as which
member has the minus sign in the exponent.

If the given function is even, f (−x) = f (x), then the exponential Fourier
transform has the symmetry

FExp (f , −ω) = FExp (f , ω) (28)

and can be expressed in terms of the Fourier cosine transform:


1
FExp (f , ω) = FC (f , ω). (29)
2
If the given function is odd, f (−x) = −f (x), then the exponential Fourier
transform has the symmetry

FExp (f , −ω) = −FExp (f , ω) (30)

and can be expressed in terms of the Fourier sine transform:


i
FExp (f , ω) = FS (f , ω). (31)
2
If the given function is neither even nor odd, the function can always be
written as the sum of an even function fe (x) and an odd function fo (x):
1 1
f (x) ≡ fe (x) + fo (x) = (f (x) + f (−x) + (f (x) − f (−x) (32)
2 2
30
and can be expressed in terms of the Fourier cosine transform of fe (x) and
the Fourier sine transform of fo (x):

1 i
FExp (f , ω) ≡ FExp (fe + fo , ω) = FC (fe , ω) + FS (fo , ω) (33)
2 2
The fourie.mac package function fourint(expr,var) displays the non-zero
coefficients az and/or the bz , in terms of which we can write down the value
of FExp (f , z) (with our conventions):

1 i
FExp (f , z) = az + bz (34)
2 2

9.1.4 Example 1: Even Function


We calculate here the exponential fourier transform FExp (f , ω) when the
function is f (x) = cos(x) e−|x| which is an even function f (−x) = f (x) and is
defined for −∞ < x < ∞.

We first use integrate, by separating the integral into two pieces, i1 is the
integral over (−∞, 0) and i2 is the integral over (0, ∞) (we ignore the overall
factor of 1/(2 π) initially). ((2 3 w + 2 (4 4 w + 4 w + 4 (3 2 (4 4 w + 4 w
+ 4 (2 2 w + 4 (4 w + 4 (2 2 (w + 2) (4 w + 4 (2 w + 2 (4 Hence, direct
use of integrate provides the exponential Fourier transform

ω2 + 2
FExp (cos(x) exp(−|x|), ω) = (35)
π (ω 4 + 4)

We can use integrate to calculate the inverse Fourier exponential transform,


recovering our original even function of x. (Is x positive, negative, or zero?
p; - x ((Is x positive, negative, or zero? n; x (

31
Next we use integrate again directly to calculate the Fourier cosine trans-
form of the given even function, now considered as defined for x ≥ 0 and
confirm that the required exponential Fourier transform in this case is cor-
rectly given by 12 FC (f , ω). (2 w + 2 (4 w + 4 (2 2 (w + 2) (4 Output —of
that value is the required exponential Fourier transform.

Next we use fourint(expr,var) with this even function. (((2 z 2 2 (——


+ ——) 4 4 z + 4 z + 4 (z
(z
((2 2 z + 4 (4 (2 2 (z + 2) (4 which confirms that for an even function,
the required exponential Fourier transform is correctly given (using fourint)
by FExp (f , z) = az /2.

32
9.1.5 Example 2: Odd Function
We calculate here the exponential fourier transform FExp (f , ω) when the
function is f (x) = sin(x) e−|x| which is an odd function f (−x) = −f (x) and
is defined for −∞ < x < ∞.

We first use integrate, by separating the integral into two pieces, i1 is the
integral over (−∞, 0) and i2 is the integral over (0, ∞) (we ignore the overall
factor of 1/(2 π) initially). (((2 w + 2 (4 w + 4 (2 w - 2 (4 w + 4 (2 (4 ((
Hence, direct use of integrate provides the exponential Fourier transform
2iω
FExp (sin(x) exp(−|x|), ω) = (36)
π (ω 4 + 4)

We can use integrate to calculate the inverse Fourier exponential transform,


recovering our original odd function of x. (Is x positive, negative, or zero?
p; - x ((Is x positive, negative, or zero? n; x (((

33
Next we use integrate again directly to calculate the Fourier sine transform
of the given odd function, now considered as defined for x ≥ 0 and confirm
that the required exponential Fourier transform in this case is correctly given
by 2i FS (f , ω). (2 w (4 w + 4 (4 w (4 Output —by i/2 yields the required
exponential Fourier transform.

Next we use fourint(expr,var) with this odd function. ((((z


4 z (z 4
( which confirms that for an odd function, the required exponential Fourier
transform is correctly given (using fourint) by FExp (f , z) = (i bz )/2.

34
9.1.6 Example 3: A Function Which is Neither Even nor Odd
We calculate here the exponential fourier transform FExp (f , ω) when the
function is f (x) = cos2 (x − 1) e−|x| which is defined for −∞ < x < ∞ and is
neither even nor odd.

We first use integrate, by separating the integral into two pieces. i1 is the
integral over (−∞, 0) and i2 is the integral over (0, ∞) (we ignore the overall
factor of 1/(2 π) initially). (((5 4 (3 2 + (- 4 + (- 4 6 4 2 /(2 w - 10 w +
38 w + 50) (5 4 (3 2 + (4 + (4 6 4 2 /(2 w - 10 w + 38 w + 50) (4 2 (cos(2)
+ 1) w + (6 cos(2) - 6) w + 5 cos(2) + 25 (6 4 2 w - 5 w + 19 w + 25 3
+ —————————– 6 4 2 w - 5 w + 19 w + 25 (4 2 (cos(2) + 1) w +
(6 cos(2) - 6) w + 5 cos(2) + 25 4 (6 4 2 4 2 w - 5 w + 19 w + 25 w - 6
w + 25 (4 2 (cos(2) + 1) w + (6 cos(2) - 6) w + 5 cos(2) + 25 (6 4 2 2 2
+ ——————– 4 2 The final —i12— is the desired exponential Fourier
transform.

35
We can now calculate the inverse Fourier transform. (Is x positive, negative,
or zero? p; - x (2 As an exercise in the manipulation of trigonometric
functions, we now go back and forth between the coefficient of —function
(for positive x). (2 ((cos(2 (x - 1)) + 1 (2 (cos(2 x - 2) + 1 (2 (sin(2) sin(2
x) + cos(2) cos(2 x) + 1 (2 which gets us from the original coefficient to that
returned by our inverse transform integral. Now we go in the blueopposite
direction: (cos(2 x - 2) + 1 (2 (cos(2 (x - 1)) + 1 (2 (2 2 - sin (x - 1) + cos (x
- 1) + 1 (2 (2 ( which returns us from the transform integral coefficient to our
original coefficient. Hence we have verified the correctness of the exponential
Fourier transform for this case.

36
Next we use fourint(expr,var) with this function which is neither even nor
odd. (((4 2 (cos(2) + 1) z + (6 cos(2) - 6) z + 5 cos(2) + 25 (z 6 4 2
4 sin(2) z (z 4 2
((4 2 (cos(2) + 1) z + (6 cos(2) - 6) z + 5 cos(2) + 25 (6 4 2 (4 sin(2)
z (4 2 (4 2 (cos(2) + 1) z + (6 cos(2) - 6) z + 5 cos(2) + 25 (6 4 2 2 2
+ ——————– 4 2 To compare this with our result using integrate we
need to replace —z— by —w—: (( which shows that, except for notation,
the results are the same. We have confirmed that for a general function, the
required exponential Fourier transform is correctly given (using fourint) by
FExp (f , z) = az /2 + (i bz )/2.

9.1.7 Dirac Delta Function δ(x)


It is conventional to define the Dirac delta function (unit impulse function)
δ(x) by δ(−x) = δ(x) evenf unction
δ(x) = 0 f or x 6= 0
Rb
−a δ(x) dx = 1 for a, b > 0 These equations imply

δ(y − x) = δ(x − y) (37)

and Z
f (y) δ(y − x) dy = f (x) (38)

for any well behaved function f (x) (we are more careful below), provided
the range of integration includes the point x. For since δ(y − x) is zero ex-
cept at the single point y = x, we can evaluate f (y) at that single point and
take the result outside the integral. The resulting integral which is left is
δ(y − x) dy, and the change of variables y → t = y − x for fixed x yields
R
R
the integral δ(t) dt = 1.

Now let c be aRpositive constant (independent of the integration variable x).


b
In the integral −a δ(c x) dx, we change variables, x → y = c x so dx = dy/c.
Z b
1 Z cb 1
δ(c x) dx = δ(y) dy = (39)
−a c −c a c
since (c a) > 0 and (c b) > 0.

37
If, on the other hand, c is a negative constant, c = −|c|, and we make the
same change of variables,
Z b
1 Z cb 1 Z −|c| b 1 Z |c| a 1
δ(c x) dx = δ(y) dy = δ(y) dy = − δ(y) dy =
−a c −c a c |c| a c −|c| b |c|
(40)
Evidently, we can always write (since both x and y are dummy integration
variables Z Z
δ(x)
δ(c x) dx = dx (41)
|c|
or simply (with the understanding that this kind of relation only makes sense
inside an integral)
δ(x)
δ(c x) = (42)
|c|
We can find a sometimes useful representation of the Dirac delta func-
tion by using the exponential Fourier transform pair Eqs.(??) and (??).
If we use y as the (dummy) variable of integration in Eq.(??), and in-
sert hinto Eq.(??), we get i (interchanging the order of integration) f(x) =
R∞ 1 R∞
−∞ 2 π −∞ e
iωy
f (y) dy e−i ω x dω
h i
∞ ∞
f (y) 21π −∞ ei ω(y−x) dω dy
R R
= −∞
R∞
= −∞ f (y) δ(y − x) dy Hence we can write

1 Z ∞ iωx
δ(x) = e dω (43)
2 π −∞
One use of such a representation of the one dimensional Dirac delta function
is to derive in a different way the result of Eq.(??). From Eq.(??) we have
1 Z ∞ iωcx
δ(c x) = e dω (44)
2 π −∞
Again, suppose c is a constant and c > 0. Then if we change variables
ω → y = ω c, we have dω = dy/c. When ω = −∞, y = −∞. When ω = ∞, y = ∞.
Hence
1 1 Z ∞ iyx 1
 
δ(c x) = e dy = δ(x) (45)
c 2 π −∞ c
If, on the other hand, c < 0, c = −|c| in Eq.(??), and we make the same
change of variables, when ω = −∞, y = ∞, and when ω = ∞, y = −∞.

38
Hence, for this case,
1 1 Z −∞ i y x 1 1 Z ∞ iyx 1
   
δ(c x) = e dy = − e dy = δ(x). (46)
c 2π ∞ c 2 π −∞ |c|

Combining the two cases leads us again to Eq.(??).

Although the representation Eq.(??) can be useful for formal properties of


the Dirac delta function, for actual calculation of integrals one is safer using
a limiting form of that result, or even simpler versions, as we will see. If we
replace the infinite limits in Eq.(??) by finite limits, we can work with the
representation
δ(x) = lim dL (x) (47)
L→∞

where
1 Z L ixy sin(x L)
dL (x) = e dy = (48)
2 π −L πx
which can then be used as
Z Z Z
sin(x L)
f (x) δ(x) dx = lim f (x) dL (x) dx = lim f (x) . (49)
L→∞ L→∞ πx
However, this will only be useful if the resulting integrals can be done.

An easier approach to the careful use of the Dirac delta function for the cal-
culation of integrals is to create a mathematically simple model of a function
of x which has the required properties and whose use will result in integrals
which can easily be done. Mathematically rigorous treatments (see the The-
ory of Distributions) of the Dirac delta function justify the use of such models
.

Here we follow the approach of William E. Boyce and Richard C. DiPrima,


in their textbook ”Elementary Differential Equations and Boundary Value
Problems”, Fifth Edition, John Wiley & Sons, Inc, New York, 1992, Section
6.5, ”Impulse Functions”.

Let ( )
1/(2 ) f or − < x < 
d (x) = (50)
0 f or x ≤ − or x ≥ 

39
which defines a rectangular pulse with base length 2 , height 1/(2 ) with
area ”under the curve” equal to 1. This is an even function of x centered on
x = 0 which gets narrower and taller as  → 0.

Then
( )
1/(2 ) f or (x − ) < y < (x + )
d (y − x) = (51)
0 f or y ≤ (x − ) or y ≥ (x + )

40
This model can then be used in the form (with the range of integration
assumed to include the point y = x):
Z Z
1 Z x+
f (y) δ(y − x) dy = lim f (y) d (y − x) dy = lim f (y) dy. (52)
→0 →0 2  x−

The integral should be done before taking the limits in this safer approach.

However, if f (y) is a continuous function and possesses a derivative in a


complete neighborhood of x, we can use the mean value theorem of calculus
to write this limit as
1
lim f (ŷ) (2 ) = lim f (ŷ)). (53)
→0 2 →0

where (x − ) < ŷ < (x + ) As  → 0, ŷ → x, and f (ŷ) → f (x), which re-


covers Eq. (??), and which we repeat here for emphasis.
Z
f (y) δ(y − x) dy = f (x) (54)

for any function f (x) which is continuous and possesses a derivative in a


complete neighborhood of x, provided the range of integration includes the
point x.

41

You might also like