5 Fourier Series
5 Fourier Series
Applications: Solving important partial differential equations arising in the theory of sound,
heat conduction, electromagnetic waves, and mechanical vibrations.
It is More Powerful than Power Series: Can represent very general functions with many
discontinuities, like the impulse function.
Fourier Series: Its Relation to Power Series
Recall: A power series is a series of the form
∞
X
an x n = a0 + a1 x + a2 x 2 + . . . + an x n + . . . .
n=0
∞
X
an x n = . . . + a−n x −n + . . . + a−2 x −2 + a−1 x −1 + a0 + a1 x + a2 x 2 + . . . + an x n + . . . .
n=−∞
∞
X
cn z n = . . . + c−n z −n + . . . + c−2 z −2 + c−1 z −1 + c0 + c1 z + c2 z 2 + . . . + cn z n + . . . .
n=−∞
A Further Generalization to Complex Numbers:
∞
X
cn z n = . . . + c−n z −n + . . . + c−2 z −2 + c−1 z −1 + c0 + c1 z + c2 z 2 + . . . + cn z n + . . . .
n=−∞
Taking z = e ix , we obtain
∞
X
cn e inx = . . . + c−n e −inx + . . . + c−2 e −i2x + c−1 e −ix + c0 + c1 e ix + c2 e i2x + . . . + cn e inx + . . . .
n=−∞
This is Fourier Series! Why? (Our Fourier series is only a special case of this series!)
A Bit of Complex Analysis
a cos x + b sin x.
There is a unique pair of complex numbers c and d such that the linear combination
(Prove!)
Let n be any integer. For any pair of real numbers a and b, there is a unique choice of complex
numbers c and d such that
Then, for each n ≥ 1, we can find complex numbers cn and c−n such that
Hence we have
∞ ∞ ∞
1 X X X n
a0 + (an cos nx + bn sin nx) = cn e inx = cn e ix .
2 n=1 n=−∞ n=−∞
Properties of Sine and Cosine Functions
Case 1: n = 0: Then Z π Z π
sin nx dx = 0 dx = 0.
−π −π
Case 2: n 6= 0: Then
Z π π
− cos nx −1
sin nx dx = = [cos nπ − cos nπ] = 0
−π n −π n
and Z π π
sin nx 1
cos nxdx = = [sin nπ + sin nπ] = 0.
−π n −π n
Properties of Sine and Cosine Functions
1
sin mx cos nx = [sin(m + n)x + sin(m − n)x]
2
1
cos mx cos nx = [cos(m + n)x + cos(m − n)x]
2
1
sin mx sin nx = [cos(m − n)x − cos(m + n)x]
2
Z π
sin mx cos nx dx = 0
−π
Z π
cos mx cos nx dx = 0 (m 6= n)
−π
Z π
sin mx sin nx dx = 0 (m 6= n)
−π
Let n be any nonzero integer. Then
Z π
cos2 nx dx = π
−π
and
Z π
sin2 nx dx = π.
−π
Note
Suppose the Fourier series on the RHS of the equation below converges and has sum f (x):
∞
1 X
f (x) = a0 + (an cos nx + bn sin nx), −π ≤ x ≤ π.
2 n=1
Then
∞
" #
Z π Z π
1 X
f (x) dx = a0 + (an cos nx + bn sin nx) dx
−π −π 2 n=1
Z π ∞ Z π Z π
1 X
= a0 dx + an cos nx dx + bn sin nx dx
2 −π n=1 −π −π
But
Z π Z π
sin nx dx = 0 and cos nx dx = 0
−π −π
for n = 1, 2, 3, . . ..
So, we have
Z π
f (x) dx = a0 π
−π
Z π
1
=⇒ a0 = f (x) dx
π −π
Now
∞
Z π " #
Z π
1 X
f (x) cos x dx = a0 + (an cos nx + bn sin nx) cos x dx
−π −π 2 n=1
Z π ∞ Z π Z π
1 X
= a0 cos x dx + an cos x cos nx dx + bn cos x sin nx dx
2 −π n=1 −π −π
But
Z π Z π Z π
cos x dx = 0, cos x cos nx dx = 0 (n ≥ 2) and cos x sin nx dx = 0.
−π −π −π
So, we have
Z π Z π
f (x) cos x dx = a1 cos2 x dx = a1 π
−π −π
Z π
1
=⇒ a1 = f (x) cos x dx
π −π
Similarly, we have
Z π
1
an = f (x) cos nx dx (n ≥ 1)
π −π
and
Z π
1
bn = f (x) sin nx dx (n ≥ 1).
π −π
Summary
Suppose
∞
1 X
f (x) = a0 + (an cos nx + bn sin nx), −π ≤ x ≤ π.
2 n=1
1 π
Z
a0 = f (x) dx
π −π
Z π
1
an = f (x) cos nx dx (n ≥ 1)
π −π
Z π
1
bn = f (x) sin nx dx (n ≥ 1)
π −π
Remarks
I In the preceding discussion, we assumed that we are given a convergent Fourier series
whose sum is f (x).
I In this case, if the convergence is uniform, then the coefficients an and bn can be derived
from the sum function f (x) by the formulas given for them.
I In the following slides, we assume that we are given an integrable function f (x) defined on
the interval −π ≤ x ≤ π. We use it find its Fourier Series, by finding the coefficients an
and bn from f (x).
The Fourier Series of a Function
Definition
Let f (x) be an integrable function defined on the interval −π ≤ x ≤ π. Then the coefficients
1 π
Z
a0 = f (x) dx
π −π
Z π
1
an = f (x) cos nx dx (n ≥ 1)
π −π
Z π
1
bn = f (x) sin nx dx (n ≥ 1)
π −π
are called the Fourier coefficients of the function f (x) and the corresponding trigonometric
series
∞
1 X
a0 + (an cos nx + bn sin nx)
2 n=1
I The Fourier series of f (x) need not converge on the interval −π ≤ x ≤ π. Even if it
converges, its limit need not be f (x).
I If the Fourier series of f (x) converges uniformly to f (x), then its Fourier coefficients can
obviously be recovered from the sum function f (x).
I If the Fourier series converges, it defines a periodic function of period 2π over the entire
real line.
Example 1
f(x)
−2π −π π 2π x
(2) The Fourier series of the function:
Step 1:
Z π
1
a0 = f (x)dx
π −π
Z 0 Z π
1 1
= 1 · dx + 0 · dx
π −π π 0
Z 0
1
= 1 · dx
π −π
1 0
= x −π = 1.
π
Step 2:
Z π
1
an = f (x) cos nx dx
π −π
Z 0 Z π
1 1
= 1 · cos nx dx + 0 · cos nx dx
π −π π 0
Z 0
1
= 1 · cos nx dx
π −π
0
1 sin nx
=
π n −π
1
= sin 0 − sin(−nπ) = 0.
nπ
Step 3:
Z π
1
bn = f (x) sin nx dx
π −π
Z 0 Z π
1 1
= 1 · sin nx dx + 0 · sin nx dx
π −π π 0
Z 0
1
= sin nx dx
π −π
0
1 cos nx
= −
π n −π
1
= − [cos 0 − cos(−nπ)]
nπ
1
= − [1 − (−1)n ].
nπ
2
Thus we have a0 = 1, an = 0 and bn = 0 if n is even and bn = − if n is odd.
nπ
Under what conditions does the Fourier series of f (x) converge to f (x)?
Dirichlet Conditions
I f (x) is defined and bounded on −π ≤ x < π.
I f (x) has a finite number of discontinuities and a finite number of maxima and minima.
I f (x) is defined for other values of x by the periodicity condition f (x + 2π) = f (x).
Examples
1 1
Fail: tan x, sin and on [−π, π).
x x
Classwork:
1. Explain explicitly which properties the above functions fail to satisfy.
2. Give an example of a function which has an infinite number of maxima.
Note
1
[f (x−) + f (x+)]
2
at every point x and therefore it converges to f (x) at every point x of continuity of the
function.
Example 1 Contd.
So, by Dirichlet theorem, the Fourier of f (x) above converges to f (x) at x = π/2.
So, on substituting x = π/2 in the Fourier series of f (x) below,
1 2 1 1
− sin x + sin 3x + sin 5x + · · · ,
2 π 3 5
we have
π 1 2 π 1 3π 1 5π 1 7π
f = − sin + sin + sin + sin + ···
2 2 π 2 3 2 5 2 7 2
Thus, by Dirichlet theorem, at these points of discontinuity, the Fourier series of f (x) has sum
1 1
[f (x−) + f (x+)] = .
2 2
Example 2
f(x)
−3π −2π −π π 2π 3π x
(2) The Fourier Series of the Function:
Step 1:
Z π
1
a0 = f (x)dx
π −π
Z 0 Z π
1 1
= 0 · dx + x · dx
π −π π 0
1 π
Z
= xdx
π 0
2 π
1 x
=
π 2 0
π
= .
2
Step 2:
Z π
1
an = f (x) cos nxdx
π −π
Z 0
1 π
Z
1
= 0 · cos nxdx + x · cos nxdx
π −π π 0
1 π
Z
= x cos nxdx
π 0
π Z π
1 sin nx sin nx
= x − dx
π n 0 n
0 π
1 1 cos nx
= 0− −
π n n 0
1
= [(−1)n − 1].
πn2
Step 3:
Z π
1
bn = f (x) sin nxdx
π −π
Z 0
1 π
Z
1
= 0 · sin nxdx + x · sin nxdx
π −π π 0
Z π
1
= x sin nxdx
π 0
π Z π
1 cos nx cos nx
= −x − − dx
π n 0 0 n
π
1 1 1 sin nx
= − [π cos nπ − 0] +
π n n n 0
1
= − π(−1)n + 0
nπ
1
= (−1)n+1 .
n
Thus the values of an , bn for different values of n are as follows:
n 1 2 3 4 5
2 2 1 2 1
an − 0 − 0 −
π π 32 π 52
1 1 1 1
bn 1 − −
2 3 4 5
Hence the required Fourier series is
1 π 2 2 1
f (x) = + − cos x + 0 cos 2x + − . 2 cos 3x + 0. cos 4x
2 2 π π 3
2 1 1 1
+ − . 2 cos 5x + · · · + sin x − sin 2x + sin 3x − · · ·
π 5 2 3
π 2 1 1 1 1
= − cos x + 2 cos 3x + 2 cos 5x + · · · + sin x − sin 2x + sin 3x − · · ·
4 π 3 5 2 3
π
3(a) A series for :
4
The given function satisfies the Dirichlet conditions on −π ≤ x < π and is continuous at
x = π/2. So, by Dirichlet theorem, the Fourier series of f (x) converges to f (π/2) = π/2 at
x = π/2.
So, we have
π π 2 π 1 π 1 π
f = − cos + 2 cos 3 + 2 cos 5 + ···
2 4 π 2 3 2 5 2
π 1 π 1 π
+ sin − sin 2 + sin 3 − ···
2 2 2 3 2
π 2 π 1 π 1 π
= − 0 + 0 + 0 + · · · + sin − sin 2 + sin 3 −···
4 π 2 2 2 3 2
| {z } | {z } | {z }
Thus 1 0 −1
π π 1 1 1
= + 1 − + − + ··· .
2 4 3 5 7
π2
3(b) A series for :
8
Again, by Dirichlet theorem, the Fourier series at x = 0 converges to f (0) = 0. So,
π 2 1 1
f (0) = − cos(0) + 2 cos(0) + 2 cos(0) + · · ·
4 π 3 5
1 1
+ sin(0) − sin(0) + sin(0) − · · ·
2 3
That is,
π 2 1 1 1
0= − 1 + 2 + 2 + 2 + ··· .
4 π 3 5 7
Hence
π2 1 1 1
= 1 + 2 + 2 + 2 + ···
8 3 5 7
Homework
Prove that
1 1 1 π2
1+ + + + · · · = .
22 32 42 6
Even and Odd Functions: Cosine and Sine Series
Example: x, x 3 , sin x
I If f (x) and g (x) are both even, then f (x)g (x) is even.
I If f (x) and g (x) are both odd, then f (x)g (x) is even.
I If one of f (x) and g (x) is even and the other is odd, then f (x)g (x) is odd.
Theorem
Let f (x) be a function defined and integrable on −π ≤ x ≤ π.
I If f (x) is even, then its Fourier series has only cosine terms and the coefficients are given
by
2 π
Z
an = f (x) cos nx dx and bn = 0.
π 0
I If f (x) is odd, then its Fourier series has only sine terms and the coefficients are given by
2 π
Z
an = 0 and bn = f (x) sin nx dx.
π 0
Proof: Homework.
Examples
Example 1: The function f (x) = x is an odd function on −π ≤ x ≤ π. So, its Fourier series is
automatically a sine series. Indeed
sin 2x sin 3x
x = 2 sin x − + − · · · , −π < x < π.
2 3
(Prove!)
Example 2: The function f (x) = |x| is an even function on −π ≤ x ≤ π. So, its Fourier series
is automatically a cosine series. Indeed
π 4 cos 3x cos 5x
|x| = − cos x + + + · · · , −π ≤ x ≤ π.
2 π 32 52
(Prove!)
Extending any Function on 0 ≤ x ≤ π to an Even or Odd Function on
−π ≤ x ≤ π
Theorem
If f (x) is an integrable function on the interval 0 ≤ x ≤ π, then it can be expanded both as a
sine series and as a cosine series on this interval.
Example
Find the sine series, and also the cosine series, for the function f (x) = cos x, 0 ≤ x ≤ π.
Solution: To obtain the sine series, we just assume that f (x) has been extended to an odd
function (We do not really bother to extend!). So, we will have
2 π
Z
an = 0 and bn = f (x) sin nx dx.
π 0
2 π
Z
an = f (x) cos nx dx and bn = 0.
π 0
Now, Z π
2 1, n = 1
an = cos x sin nx dx =
π 0 6 1
0, n =
Find the sine series and the cosine series of the constant function f (x) = π/4.
Extension to Arbitrary Intervals −L ≤ x ≤ L
−4 −2 2 4 x
Here Z 2 Z 2
1 1
a0 = f (x)dx = 5dx = 5.
2 −2 2 0
Z 2
1 nπx
an = f (x) cos
2 −2 2
Z 2
1 nπx
= 5 cos dx
2 0 2
2
5 2 sin nπx
2 5 2nπ 0nπ
= = sin − sin =0
2 nπ 0 nπ 2 2
Z 2
1 nπx
bn = f (x) sin
2 −2 2
Z 2
1 nπx
= 5 sin dx
2 0 2
2
5 −2 cos nπx
2
=
2 nπ
Example
∞
a0 X nπx nπx
f (x) = + an cos + bn sin
2 n=0
2 2
∞
5 X 5 nπx
= + (1 − (−1)n ) sin
2 n=0 nπ 2
5 10 πx 1 3πx 1 5πx 1 7πx
= + sin + sin + sin + sin + ··· .
2 π 2 3 2 5 2 7 2
Homework
1. Find the Fourier series of the following functions:
1.1 (
−3, −2 ≤ x < 0
f (x) =
3, 0≤x <2
1.2 (
1 + x, −1 ≤ x < 0
f (x) =
1 − x, 0≤x ≤1
1.3
f (x) = |x|, −2 ≤ x ≤ 2.
2. Show that
∞
1 LX 2nπx
L−x = sin , 0 < x < L.
2 π n=1 L