Solutions homework 8 1 Exercise 1: n 0 2 nπ 4 nπ 2 nπ
Solutions homework 8 1 Exercise 1: n 0 2 nπ 4 nπ 2 nπ
Solutions homework 8 1 Exercise 1: n 0 2 nπ 4 nπ 2 nπ
1 Exercise 1
First function
The function is odd so only sine coefficients are non-zero. They are given
by:
Z π 0 if n = 4p
2 2 2 h nπ i 2
if n = 4p + 1
bn = sin(nt)dt = − cos( ) − 1 = nπ
4
π 0 nπ 2 if n = 4p + 2
nπ
2
nπ
if n = 4p + 3
Therefore, the Fourier series is:
∞ ∞ ∞
2X 1 X 1 X 1
f (x) = sin((4p+2)x)+ sin((4p+1)x)+ sin((4p+3)x)
π p=0 2p + 1 p=0
4p + 1 p=0
(4p + 3)
(1)
The picture of the original curve (in blue) and the Fourier series up to p = 30
is:
Since the function is piecewise continuous, the Fourier series will converge
to the average of the left and right limit at any point. In particular at x = 0
the Fourier series is 0 while at x = ± π2 it takes the value ± 12 . These are the
only points on [−π, π] were the initial function and the Fourier series are not
identical.
1
Second function f (x) = x is an odd function so only sine coefficients are
non-zero. We have after an integration by part:
1 a 2(−1)n+1 a
Z
nπx
bn = x sin( )dx =
a −a a πn
The function is continuous on [−a, a] so the Fourier series may only differ
from the function at the end of the interval. The Fourier series vanishes at
theses points and hence we have: The picture of the original curve (in blue)
and the Fourier series up to p = 30 is:
Fourth function The function is neither even nor odd so we have to com-
pute both an and bn terms. We find:
a0 = 2
2
2(−1 + (−1)n )
0 if n = 2p
an = = 4
2
π n 2 − π2 n2 if n = 2p + 1
n
1 + (−1) 0 if n = 2p + 1
bn = − = 2
πn − πn if n = 2p
(3)
Fifth function The function is neither odd nor even. Computing the co-
efficients give:
a0 = 1
an = 0
0 if n = 2p
bn = 2
πn
if n = 2p + 1
(5)
3
Therefore the Fourier series is:
∞
1 X 2
f (x) ∼ + sin((2p + 1)πx) (6)
2 p=0 π(2p + 1)
2 Exercise 2
The function f (x) = x2 is even so only cosine coefficients are non-zero. They
are given by (after a double integration by parts):
1 π 2 2π 2
Z
a0 = x dx =
π Z−π 3
1 π 2 4(−1)n
an = x cos(nx)dx =
π −π n2
(7)
Therefore, the Fourier series is:
∞
π2 X (−1)n
x2 ∼ +4 2
cos(nx) (8)
3 n=1
n
The Fourier series is equals the initial function x2 on [−π, π] including the
endpoints. Taking x = 0 leads to:
∞ ∞
π2 X (−1)n X (−1)n π2
0= +4 ⇒ = (9)
3 n=1
n2 n=1
n2 12
4
Taking x = π gives:
∞ ∞
π2 X (−1)n X 1 π2
π2 = +4 (−1)n
⇒ = (10)
3 n=1
n2 n=1
n2 6
Here is the picture for only the first 10 terms in the Fourier series (the
convergence is extremely fast):
3 Exercise 3
The solution of the boundary problems are of the form:
∞
2t
X
u(x, t) = Bn sin(nx)e−5n (11)
n=1
5
Second Case In order to only have sine coefficients in the Fourier series,
we have to use the sine Fourier series on [0, π]. Doing so leads to:
0 if n = 4p
4 sin( nπ
Z π 4
2 2
)
− πn2 if n = 4p + 1
Bn = f (x) sin(nx)dx = − = (14)
π 0 πn 2
0 if n = 4p + 2
4
πn2
if n = 4p + 3