Section 3. Fourier Series and Periodic Functions: F (X) F (X + P) For Any X, and Fixed Period P
Section 3. Fourier Series and Periodic Functions: F (X) F (X + P) For Any X, and Fixed Period P
n=1
a
n
cos(nx) + b
n
sin(nx). (1)
(School of Mathematical Sciences) HG2M13 September 29, 2008 1 / 31
Before proceeding to calculate the coecients of this polynomial it is
helpful to evaluate the following integrals:
I
mn
=
_
cos(mx) cos(nx)dx, J
mn
=
_
sin(mx) sin(nx)dx,
K
mn
=
_
sin(mx) cos(nx)dx,
where m and n are positive integers. Using standard trigonometric
identities we can write
I
mn
=
_
1
2
[cos((m n)x) + cos((m + n)x)] dx,
J
mn
=
_
1
2
[cos((m n)x) cos((m + n)x)] dx,
K
mn
=
_
1
2
[sin((m n)x) + sin((m + n)x)] dx.
(School of Mathematical Sciences) HG2M13 September 29, 2008 2 / 31
It follows (for m 1 and n 0) that
I
mn
= 0 for m = n, I
mm
=
_
1
2
dx = ,
J
mn
= 0 for m = n, I
mm
=
_
1
2
dx = , K
mn
= 0.
(School of Mathematical Sciences) HG2M13 September 29, 2008 3 / 31
To summarise
_
cos(mx) cos(nx)dx =
mn
,
_
sin(mx) sin(nx)dx =
mn
,
_
1 cos(mx)dx = 2
0m
_
1 sin(mx)dx = 0.
where the Kronecker delta function
mn
is equal to 1 if m = n and is equal
to zero otherwise.
(School of Mathematical Sciences) HG2M13 September 29, 2008 4 / 31
Fourier Series
By taking N , we hope to obtain an exact series representation of
f (x). In other words can we write any 2 periodic piecewise continuous
function f as an innite series of the following form:
f (x) =
a
0
2
+
n=1
a
n
cos(nx) + b
n
sin(nx). (3)
If this is the case, coecients a
n
and b
n
can be found as follows:
Multiplying the above by cos(mx), integrating between and
gives
(School of Mathematical Sciences) HG2M13 September 29, 2008 5 / 31
_
f (x) cos(mx)dx =
a
0
2
_
cos(mx)dx
+
n=1
_
a
n
__
cos(mx) cos(nx)dx
_
+b
n
__
sin(nx) cos(mx)dx
__
= a
0
0m
+
n=1
a
n
mn
= a
m
.
Here we have made use of the results in (2). The coecients a
m
are thus
a
m
=
1
2
x for x 0.
Using (4) and (5) to calculate the coecients in the Fourier series gives
(School of Mathematical Sciences) HG2M13 September 29, 2008 7 / 31
a
0
= 0,
a
m
=
1
__
2
cos(mx)dx +
_
0
x cos(mx)dx
+
_
0
x cos(mx)dx
_
for m 1,
b
m
=
1
__
2
sin(mx)dx +
_
0
x sin(mx)dx
_
0
x sin(mx)dx
_
= 0.
Note that the rst integrals in the expressions for both a
m
and b
m
are zero
and that the second and third integral in the expression for a
m
take the
same value whilst those in the expression for b
m
cancel. Thus
(School of Mathematical Sciences) HG2M13 September 29, 2008 8 / 31
a
m
=
2
_
0
x cos(mx)dx =
2
_
x sin(mx)
m
+
cos(mx)
m
2
_
0
a
m
=
2
m
2
(1 (1)
m
) ,
and the Fourier series for f (x) is
f (x) =
m=1
2
m
2
(1 (1)
m
) cos(mx).
Plots of the rst 10 terms in the Fourier series are shown in gure (1).
(School of Mathematical Sciences) HG2M13 September 29, 2008 9 / 31
1.5
1
0.5
0.5
1
1.5
4 2 2 4
x
f (x)
x
Figure 1: The rst 10 terms in the Fourier series of f (x).
(School of Mathematical Sciences) HG2M13 September 29, 2008 10 / 31
Remark
Note that f (x) is an even function and furthermore that its Fourier series
contains no terms involving sin(mx). It is in general true that the Fourier
series for an even function f (x) takes the form
f (x) =
a
0
2
+
n=1
a
n
cos(nx),
while that for an odd function g(x) takes the form
g(x) =
n=1
b
n
sin(nx),
(convince yourself that these statements are true). Remembering these
facts can save time when evaluating the coecients in a Fourier series.
(School of Mathematical Sciences) HG2M13 September 29, 2008 11 / 31
3.1 Fourier series for 2-periodic functions
Consider now a function f (x) which has period 2. It is straightforward to
transform the problem of nding a Fourier series for f (x) on the interval
< x < into one on the interval , < x < x.
It follows that its Fourier series is given by
f (x) =
a
0
2
+
n=1
a
n
cos
_
n
x
_
+ b
n
sin
_
n
x
_
, (6)
where
a
m
=
1
f (x) cos
_
m
x
_
dx,
b
m
=
1
f (x) sin
_
m
x
_
dx
_
_
(7)
Example
Obtain the Fourier series for the periodic function
g(x) = x for 1 < x < 1.
(School of Mathematical Sciences) HG2M13 September 29, 2008 12 / 31
Note that this is an odd function in x and hence a
m
= 0 for all m. The
values of b
m
are determined using (7)
b
m
=
_
1
1
x sin(mx)dx =
_
x cos(mx)
m
+
sin(mx)
(m)
2
_
1
1
b
m
=
2
m
(1)
m
.
Substituting this expression for b
m
back into (6) gives the Fourier series as
g(x) =
n=1
2
1
n
(1)
n
sin(nx).
The rst 5 and rst 40 terms of this series are plotted in gure 2.
(School of Mathematical Sciences) HG2M13 September 29, 2008 13 / 31
1
0.5
0.5
1
1.5 1 0.5 0.5 1 1.5
x
x
g(x)
Figure 2: The rst 5 terms and the rst 40 terms in the Fourier series of
g(x).
(School of Mathematical Sciences) HG2M13 September 29, 2008 14 / 31
Remark
The Fourier series converges much more slowly for the function g(x) (as
we take more terms in the series) than it did for f (x). This is because the
periodic function g(x) has a discontinuity in contrast to f (x) which is
continuous. In particular note that the Fourier series has diculty
approximating g close to the discontinuity where it has many nescale
oscillations; this is termed Gibbs phenomenon. We consider these aspects
in more detail after a summary and some examples.
(School of Mathematical Sciences) HG2M13 September 29, 2008 15 / 31
3.2 Summary of formulae and examples
If f (x) is a periodic function with fundamental period 2 then
n=1
(a
n
cos nx + b
n
sin nx)
where a
0
, a
n
, b
n
for n = 1, 2, . . . are the Fourier coecients.
f (x)dx
a
n
=
1
x
3 2 2 3
x cos nxdx =
_
x sin nx
n
_
sin nx
n
dx
= 0 +
_
cos nx
n
2
_
= 0
_
x sin nxdx =
_
x cos nx
n
_
+
_
cos nx
n
dx
=
2 cos n
n
+
_
sin nx
n
2
_
=
2(1)
n
n
+ 0
=
2(1)
n+1
n
since cos n = (1)
n
and cos n = (1)
n+1
.
(School of Mathematical Sciences) HG2M13 September 29, 2008 18 / 31
The Fourier coecients are
a
0
=
1
xdx
a
n
=
1
x cos nxdx n = 1, 2, . . .
b
n
=
1
x sin nxdx n = 1, 2, . . . .
Evaluating the integrals we obtain the results
a
0
= 0, a
n
= 0, b
n
=
2(1)
n+1
n
for n = 1, 2, . . . .
Hence the required Fourier series is
2
_
sin x
1
2
sin 2x +
1
3
sin 3x
1
4
sin 4x . . .
_
ie f (x) = 2
n=1
(1)
n+1
sin nx
n
.
(School of Mathematical Sciences) HG2M13 September 29, 2008 19 / 31
Example
Find the Fourier coecients of f (x) dened
f (x) = x
2
for < x , and f (x + 2) = f (x).
The graph of the function in the region 3 < x < 3 is
f (x)
0 x
(School of Mathematical Sciences) HG2M13 September 29, 2008 20 / 31
The Fourier coecients are
a
0
=
1
x
2
dx
a
n
=
1
x
2
cos nxdx n = 1, 2, . . . .
b
n
=
1
x
2
sin nxdx n = 1, 2, . . . .
Evaluating the integrals we obtain the results
a
0
=
2
2
3
, a
n
=
4(1)
n
n
2
, b
n
= 0 for n = 1.2. . . . .
Hence the required Fourier series is
2
3
+ 4
_
cos x +
1
4
cos 2x
1
9
cos 3x +
1
16
cos 4x + . . .
_
ie
2
3
+ 4
n=1
(1)
n
cos nx
n
2
.
(School of Mathematical Sciences) HG2M13 September 29, 2008 21 / 31
If f (x) is a periodic function with period 2 i.e. f (x + 2) = f (x).
The Fourier series for f (x) is
1
2
a
0
+
n=1
_
a
n
cos
_
nx
_
+ b
n
sin
_
nx
__
where
a
0
=
1
f (x)dx
a
n
=
1
f (x) cos
_
nx
_
dx n = 1, 2, . . .
b
n
=
1
f (x) sin
_
nx
_
dx n = 1, 2, . . .
(School of Mathematical Sciences) HG2M13 September 29, 2008 22 / 31
Example
If g(x) = x
2
for x <
g(x + 2) = g(x)
the Fourier series for g(x) is
1
2
a
0
+
n=1
a
n
cos
_
nx
_
where a
0
=
1
x
2
dx =
2
2
3
and a
n
=
1
x
2
cos
_
nx
_
dx =
4
2
(1)
n
n
2
2
Note:
(1) b = 0 because g(x) is an even function
(2) set = then series reduces to that in a previous example.
(School of Mathematical Sciences) HG2M13 September 29, 2008 23 / 31
3.3 Properties of Fourier Series
A Fourier series is an innite series used to represent function values and
therefore we must ask the questions
Is it convergent?
, is also f (a)
Examples
(1) a continuous function (2) a discontinuous function
f(x)
x
a
f(a)
x
f(x)
2
1
a
(School of Mathematical Sciences) HG2M13 September 29, 2008 25 / 31
A function is continuous in
the interval a < x < b if it
is continuous at every point
of the interval a < x < b
Example
f(x)
x
a b
A function is said to be
piecewise continuous in an
interval a < x < b if it has
at most a nite number of
nite discontinuities in the
interval a < x < b
Example
b
a
x
f(x)
(School of Mathematical Sciences) HG2M13 September 29, 2008 26 / 31
Dierentiability
(a).
, b
n
=
(1)
n+1
n
n = 1, 2, . . .
The Fourier series is therefore
1
4
+
n=1
_
((1)
n
1)
n
2
cos nx +
(1)
n+1
n
sin nx
_
Dene S
1
=
1
4
2
cos x + sin x
S
2
= S
1
1
2
sin 2x
S
3
= S
2
2
3
2
cos 3x +
1
3
sin 3x etc.
(School of Mathematical Sciences) HG2M13 September 29, 2008 28 / 31
S
1
S
5
S
9
(School of Mathematical Sciences) HG2M13 September 29, 2008 29 / 31
We see from this example that as n