Vinay Bharadwaj DS (2147326)
Vinay Bharadwaj DS (2147326)
Problem: Find the Fourier series of the function f (x) = |sinx|, −π < x < π.
Neatly sketch the function and using Excel/Origin, try to recreate the function
using the sum of first four terms of the series.
The Fourier series of an even function contains only cosine terms and
is given by,
∞
a0 X
f (x) = + an cos nx (1)
2 n=1
where ,
Z π
1
a0 = f (x) dx
π −π
Z π
1
an = f (x) cos nx dx
π −π
(i) a0
1
We have,
Z π Z π
1 2
a0 = f (x) dx = f (x) dx
π −π π 0
Z π
2
a0 = sin x dx
π 0
2 2 4
∴ a0 = [− cos x]π0 = · (2) =
π π π
4
∴ a0 =
π
(ii) an
We have,
Z π
2
an = f (x) cos nx dx
π 0
Z π
2
∴ an = sin x cos nx dx
π 0
π
sin (1 + n)x + sin (1 − n)x
Z
2
∴ an = dx
π 0 2
1
∵ sin A cos B = [sin (A + B) + sin (A − B)]
2
Z π
1
∴ an = sin (1 + n)x + sin (1 − n)x dx
π 0
π
1 − cos (1 + n)x cos (1 − n)x
∴ an = −
π 1+n 1−n 0
1 − cos (1 + n)π cos (1 − n)π 1 1
∴ an = − + +
π 1+n 1−n 1−n 1+n
2
1 − cos (π + nπ) cos (π − nπ) 2
∴ an = − +
π 1+n 1−n 1 − n2
1 −(− cos nπ) − cos (nπ) 2
∴ an = − +
π 1+n 1−n 1 − n2
1 2 cos nπ 2
∴ an = +
π 1 − n2 1 − n2
2
∴ an = (cos nπ + 1)
π
2
∴ an = (2)
π(1 − n2 )
We get
4
an =
π(1 − n2 )
Therefore
4
π
if n = 0
an = 0 if n is odd
4
if n is even
π(1−n2 )
∞
1 4 X
=⇒ f (x) = · + an cos (2nx)
2 π n=1
∞
2 X 4
=⇒ f (x) = + · cos (2nx)
π n=1 π(1 − (2n)2 )
3
∞
2 4 X cos (2nx)
=⇒ f (x) = +
π π n=1 (1 − (2n)2 )
∞
2 4 X cos 2nx
f (x) = −
π π n=1 (4n2 − 1)
Plot:
The plot for the given function is as follows:
Figure 1:
References:
1. https://www.ques10.com/p/6001/find-fourier-series-for-fx-sinx-in-pi-pi-1/
2. https://www.quora.com/What-is-the-Fourier-series-of-f-x-sin-x-in