This complex form of the Fourier series is completely equivalent to the original series. Given
the
a
n
’s and
b
n
’s we can compute the
c
n
’s using the formula above, and conversely, given the
c
n
’s we can solve for
a
0
= 2
c
0
a
n
=
c
n
+
c

n
for
n >
0
b
n
=
ic
n

ic

n
for
n >
0
III.4.2 Inner product for a space of functions
We will consider the space of complex valued functions
f
(
x
) on the interval [0
,
1] that obey
Z
1
0

f
(
x
)

2
dx <
∞
This space is called
L
2
([0
,
1]) and is an example of a Hilbert space.
If
f
and
g
are two
functions in this space, then we define the inner product to be
h
f, g
i
=
Z
1
0
f
(
x
)
g
(
x
)
dx
Here
f
(
x
) denotes the complex conjugate of
f
.
III.4.3 An orthonormal basis
Now we will show that the complex exponential functions appearing in the Fourier expansion
are an orthonormal set. Let
e
n
(
x
) =
e
i
2
πnx
for
n
= 0
,
±
1
,
±
2
, . . .
. We must compute
h
e
n
, e
m
i
. Since
e
n
(
x
) =
e

i
2
πnx
, we find
h
e
n
, e
m
i
=
Z
1
0
e

i
2
πnx
e
i
2
πmx
dx
=
Z
1
0
e
i
2
π
(
m

n
)
x
dx
90
III.4 Fourier series
If
n
=
m
then
e
i
2
π
(
m

n
)
x
= 1 so the integral equals 1. On the other hand if
n
6
=
m
then
e
i
2
π
(
m

n
)
x
has an antiderivative
e
i
2
π
(
m

n
)
x
/
2
π
(
m

n
) that takes on the same value (namely
1
/
2
π
(
m

n
)) at both endpoints
x
= 0 and
x
= 1. Hence the integral is zero in this case.
Thus the functions
{
e
n
(
x
)
}
form an orthonormal set. In fact, they are a basis for our space
of functions. The fact that they span the space, i.e., that every function can be written as
an infinite linear combination of the
e
n
’s, is more difficult to show. (For a start, it would
require a discussion of what it means for an infinite linear combination to converge!)
However, if you accept the fact that the
e
n
’s do indeed form an infinite basis, then it is
very easy to compute the coefficients. Starting with
f
(
x
) =
∞
X
n
=
∞
c
n
e
n
(
x
)
we simply take the inner product of both sides with
e
m
. The only term in the infinite sum
that survives is the one with
n
=
m
. Thus
h
e
m
, f
i
=
∞
X
n
=
∞
c
n
h
e
m
, e
n
i
=
c
m
and we obtain the formula
c
m
=
Z
1
0
e

i
2
πmx
f
(
x
)
dx
III.4.4 An example
Let’s compute the Fourier coefficients for the square wave function
f
(
x
) =
1
if
0
≤
x
≤
1
/
2

1
if
1
/
2
< x
≤
1
If
n
= 0 then
e

i
2
πnx
=
e
0
= 1 so
c
0
is simply the integral of
f
.
c
0
=
Z
1
0
f
(
x
)
dx
=
Z
1
/
2
0
1
dx

Z
1
1
/
2
1
dx
= 0
91
III Orthogonality
Otherwise, we have
c
n
=
Z
1
0
e

i
2
πnx
f
(
x
)
dx
=
Z
1
/
2
0
e

i
2
πnx
dx

Z
1
1
/
2
e

i
2
πnx
dx
=
e

i
2
πnx

i
2
πn
x
=1
/
2
x
=0

e

i
2
πnx

i
2
πn
x
=1
x
=1
/
2
=
2

2
e
iπn
2
πin
=
0
if
n
is even
2
/iπn
if
n
is odd
Thus we conclude that
f
(
x
) =
∞
X
n
=
∞
n
odd
2
iπn
e
i
2
πnx
To see how well this series is approximating
f
(
x
) we go back to the real form of the series.
Using
a
n
=
c
n
+
c

n
and
b
n
=
ic
n

ic

n
we find that
a
n
= 0 for all
n
,
b
n
= 0 for
n
even and
b
n
= 4
/πn
for
n
odd. Thus
f
(
x
) =
∞
X
n
=1
n
odd
4
πn
sin(2
πnx
) =
∞
X
n
=0
4
π
(2
n
+ 1)
sin(2
π
(2
n
+ 1)
x
)
We can use MATLAB/Octave to see how well this series is converging. The file
ftdemo1.m
contains a function that take an integer
N
as an argument and plots the sum of the first
2
N
+ 1 terms in the Fourier series above. Here is a listing: