But
Z
π

π
e
i
(
n

k
)
x
dx
=
1
i
(
n

k
)
e
i
(
n

k
)
x
±
±
±
π

π
= 0
if
n
6
=
k,
(7)
Z
π

π
e
i
(
n

k
)
x
dx
=
Z
π

π
dx
= 2
π
if
n
=
k.
(8)
Notice that via (5) one obtains from this easily the following formulas, which are
useful otherwise, (
m,n
∈
IN),
Z
π

π
sin
nx
sin
mxdx
=
²
0
for
n
6
=
m,
or
n
=
m
= 0
π
for
n
=
m
6
= 0
,
(9)
Z
π

π
cos
mx
cos
nxdx
=
²
0
for
n
6
=
m,
π
for
n
=
m
6
= 0
,
(10)
Z
π

π
sin
mx
cos
nxdx
= 0
.
(11)
In view of (7) and (8), the only term in the series that survives the integration is
the term with
n
=
k
, hence
Z
π

π
f
(
x
)
e

ikx
dx
= 2
πc
k
.
In other words, relabeling the integer
k
as
n
, we ﬁnd
c
n
=
1
2
π
Z
π

π
f
(
x
)
e

inx
dx,
n
= 0
,
±
1
,
±
2
,. .. .
(12)
Using (6) and (2), this leads to
a
n
=
1
π
Z
π

π
f
(
x
) cos
nxdx,
n
= 0
,
1
,
2
,. .. ,
(13)
b
n
=
1
π
Z
π

π
f
(
x
) sin
nxdx,
n
= 1
,
2
,. .. .
(14)
To summarize:
If
f
has a series expansion of the form (3) and (4), and the series
converge decently so that termbyterm integration is permissable,
then
the coeﬃ
cients
c
n
,
a
n
and
b
n
are given by (12), (13) and (14).
On the other hand, if