Solutions homework 8 1 Exercise 1: n 0 2 nπ 4 nπ 2 nπ

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Solutions homework 8

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

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

Therefore, the Fourier series is:



X 2(−1)n+1 nπx
x∼ sin( ) (2)
n=1
πn a

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:

Third function If f (x) = cos(x)2 then it can be rewriten as f (x) = 12 +


1
2
cos(2x) This function is already expanded in the Fourier series on [−π, π].
Therefore the Fourier series is: 12 + 12 cos(2x) and it is identical to the function
on [−π, π].

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)

Therefore the Fourier series is:


∞ ∞
X 4 (2p + 1)πx X 1
f (x) ∼ 1 − cos( ) − sin(pπx) (4)
p=0
π 2 (2p + 1)2 2 p=1
πp

The picture is the following:

The function is continuous everywhere except 0 so the only points where


the Fourier series is not equal to the initial function are x = 0 and at the
endpoints. For x = ±2, the Fourier series takes the value ± 32 . For x = 0, the
Fourier series takes the value 21 .

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)

The picture is the following:

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

Now we also have to satisfy the initial condition: u(x, t = 0) = f (x).


First 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:
2 π
Z 
0 if n = 2p
Bn = x(π − x) sin(nx)dx = 8 (12)
π 0 πn3
if n = 2p + 1
Therefore the solution is:

X 8 2
u(x, t) = 3
sin((2p + 1)x)e−5(2p+1) t (13)
p=0
π(2p + 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

Therefore the solution is:


∞ ∞
X 4 −5(4p+3)2 t
X 4 −5(4p+1)2 t
u(x, t) = sin ((4p + 3)x) e − sin ((4p + 1)x) e
p=0
π(4p + 3)2 p=0
π(4p + 1)2
(15)
Here are the pictures of the Fourier series and the initial functions for
the functions f (x) for only terms involving p ∈ {0, 1, 2}. The convergence is
very fast since we can almost not distinguish the two curves.

You might also like