Unit2 Fourier Series
Unit2 Fourier Series
Examples :
1. sin(x + 2π) = sin x, 2π is period for f (x) = sin x
2. cos(x + 2π) = cos x, 2π is period for f (x) = cos x
3. tan(x + π) = tan x, π is period for f (x) = tan x
2π 2π
4. sin x + = sin nx, is period for f (x) = sin nx
n n
2π 2π
5. cos x + = cos nx, is period for f (x) = cos nx
n n
π π
6. tan x + = tan nx, is period for f (x) = tan nx
n n
f (a−) = lim f (a − h)
h→0
89
90 Unit II - FOURIER SERIES (F.S.)
where
1 c+2`
Z
a0 = f (x) dx
` c
1 c+2`
Z nπx
an = f (x)cos dx
` c `
1 c+2`
Z nπx
bn = f (x)sin dx
` c `
Case(i): If c = 0, (c, c + 2`) becomes (0, 2`).
∴ Fourier series is
∞
a0 X nπx nπx
f (x) = + an cos + bn sin
2 n=1
` `
where
1 2`
Z
a0 = f (x) dx
` 0
1 2`
Z nπx
an = f (x)cos dx
` 0 `
1 2`
Z nπx
bn = f (x)sin dx
` 0 `
Case(ii): If c = −`, (c, c + 2`) becomes (−`, `).
∴ Fourier series is
∞
a0 X nπx nπx
f (x) = + an cos + bn sin
2 n=1
` `
where
1 `
Z
a0 = f (x) dx
` −`
1 `
Z nπx
an = f (x)cos dx
` −` `
1 `
Z nπx
bn = f (x)sin dx
` −` `
1 π
Z
a0 = f (x) dx
π 0
1 π
Z
an = f (x)cosnx dx
π 0
1 π
Z
bn = f (x)sinnx dx
π 0
where
1 π
Z
a0 = f (x) dx
π −π
1 π
Z
an = f (x)cosnx dx
π −π
1 π
Z
bn = f (x)sinnx dx
π −π
2
Example 2.1.
Find the Fourier series off (x) = x in (0, 2π) and with
8 4 −4π
period 2π. a0 = π 2 , an = 2 , bn =
3 n n
Z2π
1
where a0 = f (x) dx
π
0
Z2π
1
an = f (x) cos nxdx
π
0
Z2π
1
bn = f (x) sin nxdx
π
0
Z2π 3 3
8π 2
1 2 1 x 1 8π
Now, a0 = x dx = = −0 =
π π 3 π 3 3
0
Z2π
1
an = x2 cos nxdx
π
0
2π
1 2 sin nx − cos nx − sin nx
= x − 2x +2
π n n2 n3 0
2π
1 sin nx cos nx sin nx
= x2 + 2x 2 − 2 3
π n n n
0
1 4π
= 0 + 2 − 0 − (0 + 0 − 0) [∵ cos 2nπ = 1]
π n
4
∴ an = 2
n
Z2π
1
bn = x2 sin nxdx
π
0
1 2 − cos nx
− sin nx
cos nx 2π
= x − 2x +2
π n n2 n3 0
2π
1 cos nx sin nx cos nx
= −x2 + 2x 2 + 2 3
π n n n 0
2
1 −4π 2 2
= +0+ 3 − 0+0+ 3
π n n n
1 −4π 2
=
π n
−4π
∴ bn =
n
Sub. the value of a0 , an , bn in (1)
94 Unit II - FOURIER SERIES (F.S.)
∞
8π 2
1 X 4 4π
f (x) = + 2
cos nx − sin nx
2 3 n=1
n n
2 ∞
X cos nx π sin nx
4π
= +4 2
−
3 n=1
n n
Example 2.2. * Find the Fourier series
of f (x) = x in (0, 2π) with f (x +
−2
2π) = f (x). Ans : a0 = 2π, an = 0, bn =
n
2
= (π − x) in (0, 2π) of
Example 2.3. Find the Fourier series of f (x)
2 2 4
periodicity 2π. a0 = π , a n = 2 , b n = 0
3 n
Example 2.4. * Obtain the Fourier series expansion for the function
f (x) = x(2π − x) in 0 ≤ x ≤ 2π, with period 2π. Show that
1 1 1 π2
1 2 + 22 + 3 2 + · · · = 6
4 2 4
a0 = π , a n = − 2 , b n = 0
3 n
Z2π
1
2πx − x2 dx
Now, a0 =
π
0
2π 3 2π
x2 x3
1 1 x
= 2π − = πx2 −
π 2 3 0 π 3 0
2
1 8π
= 4π 3 − −0
π 3
1 4π 3
=
π 3
4π 2
a0 =
3
MA6351 Transforms and Partial Differential Equations by K A Niranjan Kumar 95
Z2π
1
2πx − x2 cos nxdx
an =
π
0
1 sin nx
2 − cos nx
= 2πx − x − (2π − 2x)
π n n2
2π
− sin nx
+ (−2)
n3 0
2π
1 sin nx cos nx 2 sin nx
2πx − x2
= + (2π − 2x) +
π n n2 n3 0
1 1 1
= 0 + (−2π) 2 + 0 − 0 + 2π 2
π n n +0
1 −2π 2π
= − 2
π n2 n
1 −4π
=
π n2
−4
an =
n2
Z2π
1
2πx − x2 sin nxdx
bn =
π
0
1 − cos nx − sin nx
2πx − x2
= − (2π − 2x)
π n n2
cos nx i2π
+ (−2)
n3 0
2π
1 2 cos nx
sin nx cos nx
= − 2πx − x + (2π − 2x) −2 3
π n n2 n 0
1 2 2
= 0+0− 3 − 0+0− 3
π n n
bn = 0
Sub. the value of a0 , an and bn in (1),
∞
1 4π 2
X
−4
f (x) = + 2
cos nx + 0
2 3 n=1
n
∞
2π 2 X cos nx
f (x) = −4
3 n=1
n2
96 Unit II - FOURIER SERIES (F.S.)
Deduction :
Put x = 0,
∞
2π 2 X 1
0= −4
3 n=1
n2
∞
X 1 2π 2
4 2
=
n=1
n 3
∞
X 1 2π 2
i.e., 2
=
n=1
n 12
1 1 1 π2
i.e., 2 + 2 + 2 + · · · = .
1 2 3 6
x, (0, π)
Solution: Given f (x) =
2π − x, (π, 2π)
Since the function f (x) is defined in the interval (0, 2π).
∴ The Fourier series of f (x) is given by
∞
a0 X
f (x) = + (an cos nx + bn sin nx) (1)
2 n=1
Z2π Z2π Z2π
1 1 1
where a0 = f (x) dx,an = f (x) cos nxdx, bn = f (x) sin nxdx
π π π
0 0 0
MA6351 Transforms and Partial Differential Equations by K A Niranjan Kumar 97
π
Z Z2π
1
Now, a0 = xdx + (2π − x) dx
π
0 π
" π 2π #
x2 x2
1
= + 2πx −
π 2 0 2 π
2 2
1 π π
− 0 + 4π 2 − 2π 2 − 2π 2 −
=
π 2 2
2 2
2 2 2
1 π 3π 1 π + 4π − 3π
= + 2π 2 − =
π 2 2 π 2
2
1 2π
=
π 2
a0 = π
π
Z Z2π
1
an = x cos nxdx + (2π − x) cos nxdx
π
π
0 π
1 sin nx − cos nx
= x −1·
π n n2 0
2π #
sin nx − cos nx
+ (2π − x) − (−1)
n n2 π
" π 2π #
1 x sin nx cos nx sin nx cos nx
= + + (2π − x) −
π n n2 0 n n2 π
(−1)n (−1)n
1 1 1
= 0+ − 0+ 2 + 0− 2 − 0−
π n2 n n n
1 (−1)n (−1)n
1 1
= − 2− 2+
π n2 n n n2
1 2 (−1)n
2
= −
π n2 n2
2
an = 2 [(−1)n − 1]
nπ
98 Unit II - FOURIER SERIES (F.S.)
π
Z Z2π
1
bn = x sin nxdx + (2π − x) sin nxdx
π
0 π π
1 − cos nx − sin nx
= x −1
π n n2 0
2π #
− cos nx − sin nx
+ (2π − x) − (−1)
n n2 π
" π 2π #
1 −x cos nx sin nx cos nx sin nx
= + + − (2π − x) −
π n n2 0 n n2 π
−π (−1)n −π (−1)n
1
= + 0 − (0 + 0) + (0 − 0) − −0
π n n
1 −π (−1)n π (−1)n
= +
π n n
bn = 0
f (x) = Average of
Substitute the f (x) = Average of
LHL & RHL
continuous point function at extremes
Example:
in f (x) directly Example:
x (1)f
(x) =
Example: (1)f (x) = in (0, 2π) at
2 0, 0 < x < π
(1) x = 0 is
x π, π < x < 2π
f (x) = f (x = 0)
2 in (0, 2π) is
in (0, 2π) at x = π = f (x = 0) + f (x = 2π) f (x = π)
is 2 f (π−) + f (π+)
π 0
+ 2 2π
π =
f (x = π) = = 2 = 2
2 2 2 where
(2) (2)f (x) = cos x f (π−) = lim f (π − h)
f (x) = x3 − x h→0
π in (0, 2π) at x = 2π is =0
in (0, 2π) at x =
2 &
is f (x = 2π)
π
cos 0 + cos 2π
f x= = f (π+) = lim f (π + h)
2 = h→0
π 3 π 2
− 1+1 =π
2 2 = =1 0+π
2 ∴ f (x = π) =
2
π
=
2
1
Example 2.6. Find the Fourier series for the function f (x) = (π − x)
2
1 1 π
in(0, 2π) with period 2π and deduce 1 − + − · · · = .
3 5 4
1 π
a0 = 0, an = 0, bn = &x =
n 2
Example 2.7. Find the Fourier series for the function
π2
x, (0, π) 1 1 1
f (x) = and deduce 2 + 2 + 2 + · · · = .
2π − x, (π, 2π) 1 3 5 8
2 n
a0 = π, an = [(−1) − 1] , bn = 0&x = 0
πn2
Example 2.8. * Find the Fourier series for f (x) = x (2π − x) in (0, 2π)
∞
π2 4π 2
X 1 −4
and deduce 2
= . a0 = , an = 2 , bn = 0&x = 0
n=1
n 6 3 n
100 Unit II - FOURIER SERIES (F.S.)
Example 2.9. Find the Fourier series for f (x) = x sin x in (0, 2π) and
1 1 1 π−2
deduce − + − ··· = .
(1)(3) (3)(4) (5)(7) 4
−2 −1 π
a0 = −2, an = (n 6= 1) , a1 = , bn = 0 (n 6= 1) , b1 = π&x =
1−n2 2 2
Z2π
1
Now, a0 = x sin xdx
π
0
1
= [x (− cos x) − 1 (− sin x)]2π
0
π
1
= [−x cos x + sin x]2π
0
π
1
= [(−2π + 0) − (0 + 0)]
π
a0 = −2
Z2π
1
an = x sin x cos nxdx
π
0
Z2π
1
= x cos nx sin xdx
π
0
Z2π
1 1
= x (sin (n + 1) x − sin (n − 1) x) dx
π 2
0
Z2π
1
= x (sin (n + 1) x − sin (n − 1) x) dx
2π
0
MA6351 Transforms and Partial Differential Equations by K A Niranjan Kumar 101
1 − cos (n + 1) x cos (n − 1) x
= x +
2π n+1 n−1
2π
− sin (n + 1) x sin (n − 1) x
−1 +
(n + 1)2 (n − 1)2 0
1 cos (n − 1) x cos (n + 1) x
= x −
2π n−1 n+1
2π
sin (n + 1) x sin (n − 1) x
+ −
(n + 1)2 (n − 1)2
0
1 1 1
= 2π − + 0 − 0 − [0 + 0 − 0]
2π n−1 n+1
1 1 n + 1 − (n − 1)
= − =
n−1 n+1 n2 − 1
2
an = 2 , n 6= 1
n −1
Z2π
1 1
R2π
a1 = x sin x cos xdx (∵ an = π x sin x cos nxdx)
π 0
0
Z2π
1
= x2 sin x cos xdx
2π
0
Z2π
1
= x sin 2xdx
2π
0
2π
1 − cos 2x − sin 2x
= x −1·
2π 2 4
2π 0
1 −x cos 2x sin 2x 1 −2π
= + = + 0 − (0 + 0)
2π 2 4 0 2π 2
−1
a1 =
2
102 Unit II - FOURIER SERIES (F.S.)
Z2π
1
bn = x sin x sin nxdx
π
0
Z2π
1
= x sin nx sin xdx
π
0
Z2π
1 1
= x (cos (n − 1) x − cos (n + 1) x)dx
π 2
0
Z2π
1
= x (cos (n − 1) x − cos (n + 1) x)dx
π
0
1 sin (n − 1) x sin (n + 1) x
= x −
2π n−1 n+1
2π
− cos (n − 1) x cos (n + 1) x
−1 +
(n − 1)2 (n + 1)2 0
1 sin (n + 1) x sin (n − 1) x
= x −
2π n+1 n−1
2π
cos (n − 1) x cos (n + 1) x
+ −
(n − 1)2 (n + 1)2 0
1 1 1 1 1
= 0+ − − 0+ −
2π (n − 1)2 (n + 1)2 (n − 1)2 (n + 1)2
bn = 0, n 6= 1
MA6351 Transforms and Partial Differential Equations by K A Niranjan Kumar 103
Z2π Z2π
1 1
b1 = x sin x sin xdx = x sin2 xdx
π π
0 0
Z2π
1 1
= x (1 − cos 2x) dx
π 2
0
Z2π
1
= (x − x cos 2x) dx
2π
0
2π
1 x2
sin 2x − cos 2x
= − x −1
2π 2 2 4 0
2 2π
1 x x sin 2x cos 2x
= − −
2π 2 2 4
2 0
1 4π 1 1
= −0− − 0−0−
2π 2 4 4
1
2π 2
=
2π
b1 = π
From (1),
∞
a0 X
f (x) = + (an cos nx + bn sin nx)
2 n=1
∞ ∞
a0 X X
= + an cos nx + bn sin nx
2 n=1 n=1
∞ ∞
a0 X X
= + a1 cos x + an cos nx + b1 sin x + bn sin nx
2 n=2 n=2
∞
1 1 X 2
= (−2) − cos x + 2−1
cos nx + π sin x + 0
2 2 n=2
n
∞
i.e., f (x) = −1 − 12 cos x + 2 cos nx
P
n2 −1 + π sin x
n=2
Example
2.10. * Find the Fourier series for f (x) = x cos x in (0, 2π).
2n −1
a0 = 0, an = 0 (n 6= 1) , a1 = π, bn = (n 6
= 1) , b 1 =
1 − n2 2
104 Unit II - FOURIER SERIES (F.S.)
Example 2.11. Obtain Fourier series for f (x) = eax in (0, 2π).
Solution : Given f (x) = eax in (0, 2π).
The Fourier series of f (x) is given by
∞
a0 X
f (x) = + (an cos nx + bn sin nx) (1)
2 n=1
where
Z2π Z2π Z2π
1 1 1
a0 = f (x) dx, an = f (x) cos nxdx, bn = f (x) sin nxdx
π π π
0 0 0
Z2π 2π
1 1 eax 1 1 a2π
ax
= [eax ]2π 0
Now, a0 = e dx = 0 = e − e
π π a 0 aπ aπ
0
1 2aπ
∴ a0 = e −1
aπ
Z2π ax 2π
1 1 e
an = eax cos nxdx = (a cos nx + n sin nx)
π π a2 + n2 0
0 2aπ
1 e 1
= (a + 0) − (a + 0)
π a2 + n2 a2 + n2
1 ae2aπ
a a 2aπ
= − = e − 1
π a2 + n2 a2 + n2 π (a2 + n2 )
a e2aπ − 1
∴ an =
π (a2 + n2 )
Z2π ax 2π
1 1 e
bn = eax sin nxdx = (a sin nx − cos nx)
π π a2 + n2 0
0 2aπ
1 e 1
= (0 − n) − (0 − n)
π a2 + n2 a2 + n2
1 −ne2aπ
n −n 2aπ
= + = e − 1
π a2 + n2 a2 + n2 π (a2 + n2 )
−n e2aπ − 1
∴ bn =
π (a2 + n2 )
Sub. the value of a0 , an , bn in (1)
∞
" #
2aπ 2aπ 2aπ
a e −1 n e −1
X
1 e −1
f (x) = + 2 + n2 )
cos nx − 2 + n2 )
sin nx
2 aπ n=1
π (a π (a
∞
e2aπ − 1 X e2aπ − 1
= + 2 + n2 )
[a cos nx − n sin nx]
2aπ n=1
π (a
MA6351 Transforms and Partial Differential Equations by K A Niranjan Kumar 105
∞
" #
2aπ 2aπ
e −1 e −1 X 1
= + 2 2
(a cos nx − n sin nx)
2aπ π n=1
a + n
∞
" #
e2aπ − 1 1 X 1
= + (a cos nx − n sin nx)
π 2a n=1 a2 + n2
Example 2.12. * Find the Fourier series for f (x) = e−x in (0, 2π) and
∞
X (−1)n
deduce 2
, further derive a series for cosec hπ.
n=2
1 + n
1 − e−2π 1 − e−2π n 1 − e−2π
a0 = , an = , bn = &x = π
π π (1 + n2 ) π 1 + n2
Note : General Fourier series is used in full range intervals as 2π or 2`
length. i.e., intervals of the form (0, 2π), (0, 2`), (−π, π), (−`, `).
In intervals (−π, π) & (−`, `), use even function or odd function or
neither even nor odd function(or none) ideas.
(1) If (
f (x) ⇒ Gn. f (x) is an even fn.[symmetric about y-axis]
f (−x) =
−f (x) ⇒ Gn. f (x) is an odd fn.[symmetric about origin]
( )
f (x)
(2) If f (−x) 6= ⇒ Gn. f (x) is neither even nor odd fn.
−f (x)
f1 (x), in (−π, 0)
If f (x) =
f2 (x), in (0, π)
such that
(a) f1 (−x) = f2 (x), then given f (x) is said to be an even function in
(−π, π).
(b) f1 (−x) = −f2 (x), then given f (x) is said to be an odd function
in (−π, π).
2.3.1 Fourier series formula for the intervals (−π, π), (−`, `)
` ∞
a20 X 2
Z
1 2
an + b2n
(−`, `) [f (x)] dx = +
` −` 2 n=1
Z π 2 ∞
1 2 a0 X 2
an + b2n
(−π, π) [f (x)] dx = +
π −π 2 n=1
Z 2` 2 ∞
1 2 a0 X
a2n + b2n
(0, 2`) [f (x)] dx = +
` 0 2 n=1
Z 2π 2 ∞
1 2 a0 X 2
an + b2n
(0, 2π) [f (x)] dx = +
π 0 2 n=1
Example 2.13. Find the Fourier series for the function f (x) = x + x2 in
2
(−π, π) and deduce that 112 + 212 + 312 + · · · = π6 ·
∞
X
f (x) = bn sin nx (1)
n=1
Zπ
1
where bn = f (x) sin nxdx
π
−π
Zπ
2
i.e., bn = f (x) sin nxdx [∵ f (x) is odd function]
π
0
Zπ
2
bn = x sin nxdx
π
0 π
2 − cos nx − sin nx
= x − (1)
π n n2
π 0
2 cos nx sin nx
= −x + (1)
π n n2 0
2 −π(−1)n
= + 0 − (0 + 0)
π n
−2(−1)n
bn =
n
∞ n
P (−1)
Fourier series of f1 (x) = x is given by f1 (x) = −2 n sin nx
n=1
∞
a0 X
f (x) = + an cos nx (2)
2 n=1
Zπ Zπ
1 1
where a0 = f (x) dx, an = f (x) cos nxdx
π π
−π −π
Zπ Zπ
2 2
i.e., a0 = f (x) dx, an = f (x) cos nxdx [∵ f (x) is even function]
π π
0 0
MA6351 Transforms and Partial Differential Equations by K A Niranjan Kumar 109
Zπ π
2 x3 2 π3
2 2
a0 = x dx = = −0
π π 3 0 π 3
0
2
2π
a0 = ·
3
Zπ
2
an = x2 cos nxdx
π
0 π
2 2 sin nx − cos nx − sin nx
= x − 2x +2
π n n2 n3 0
2 π
2 x sin nx 2x cos nx 2 sin nx
= + −
π n n2 n3 0
2π (−1)n
2
= 0+ − 0 − (0 + 0 − 0)
π n2
2 2π (−1)n
=
π n2
4 (−1)n
an =
n2
π2 P∞ (−1)n
f2 (x) = +4 2
cos nx
3 n=1 n
Since f (x) = x + x2
The Fourier series of f (x) is
∞ ∞
X (−1)n π2 X (−1)n
f (x) = −2 sin nx + +4 2
cos nx
n=1
n 3 n=1
n
∞ ∞
π2 X (−1)n X (−1)n
f (x) = −2 sin nx + 4 2
cos nx.
3 n=1
n n=1
n
∞
f (−π) + f (π) π 2 X (−1)n
∴ = −0+4 2
(−1)n
2 3 n=1
n
∞
−π + π 2 + π + π 2 π2 X (−1)2n
= +4
2 3 n=1
n2
∞
2 π2 X 1
π = +4
3 n=1
n2
∞
2 π2 X 1
π − =4
3 n=1
n2
∞
2π 2 X 1
=4
3 n=1
n2
∞
π2 X 1
=
6 n=1
n2
1 1 1 π2
+ + + ··· = ·
12 22 32 6
Example 2.14. Find the Fourier series for the function f (x) = x2 in
[−π, π]with period 2π and deduce
1 1 1 π2 1 1 1 π2
(i) 2 + 2 + 2 + ... = (ii) 2 − 2 + 2 − ... =
1 2 3 6 1 2 3 12
1 1 1 π2 1 1 1 π4
(iii) 2 + 2 + 2 + ... = (iv) 4 + 4 + 4 + ... =
1 3 5 8 1 2 3 90
4 (−1)n
2 2
a0 = π , a n = 2
, bn = 0(∵ even)
3 n
(i)x = π(or − π) (ii)x = 0 (iii) add i and ii
(iv) Use Parseval0 s identity
Deduction:
(i) Put x = π. [Here x = π is a point of discontinuity which is one end of
the given interval (−π, π)]
f (−π) + f (π)
∴ Sum of the Fourier series of f (x) is
2
MA6351 Transforms and Partial Differential Equations by K A Niranjan Kumar 111
∞
f (−π) + f (π) π 2 X (−1)n
i.e., = +4 2
(−1)n
2 3 n=1
n
∞
π2 + π2 π2 X (−1)2n
= +4
2 3 n=1
n2
∞
2π 2 π2 X 1
= +4
2 3 n=1
n2
∞
2 π2 X 1
π − =4
3 n=1
n2
∞
2π 2 X 1
=4
3 n=1
n2
∞
π2 X 1
=
6 n=1
n2
1 1 1 π2
+ + + ··· = (2)
12 22 32 6
(ii) Put x = 0
∞
π2 X (−1)n
0= +4
3 n=1
n2
−π 2
−1 1 1
= 4 2 + 2 − 2 + ···
3 1 2 3
2
−π 1 1 1
= −4 2 − 2 + 2 − · · ·
3 1 2 3
2
π 1 1 1
= 2 − 2 + 2 − ···
12 1 2 3
2
1 1 1 π
− + − · · · = (3)
12 22 32 12
(iii) (1) + (2) ⇒
2 2 π2 π2
2
+ 0 + 2
+ 0 + ··· = +
1 3 6 12
2
1 1 1 3π
2 2 + 2 + 2 + ··· =
1 3 5 12
1 1 1 π2
+ + + ··· = ·
12 32 52 8
112 Unit II - FOURIER SERIES (F.S.)
2
series for f (x) = x − x in(−π, π).
Example 2.16. * Find the Fourier
2 4 2
a0 = π 2 , an = 2 (−1)n , bn = (−1)n
3 n n
x − 1, −π < x < 0
Solution : Given f (x) =
x + 1, 0 < x < π
−x − 1, −π < −x < 0
f (−x) =
−x + 1, 0 < −x < π
−x − 1, 0 < x < π
=
−x + 1, −π < x < 0
−x + 1, −π < x < 0
=
−x − 1, 0<x<π
x − 1, −π < x < 0
=−
x + 1, 0<x<π
f (−x) = − f (x)
∴ f (x) is an odd function in −π < x < π.
∴ The Fourier series for the odd function f (x) is given by
X∞
f (x) = bn sin nx (1)
n=1
2 π
Z
where bn = f (x) sin nxdx
π 0
2 π
Z
= (x + 1) sin nxdx
π 0
MA6351 Transforms and Partial Differential Equations by K A Niranjan Kumar 113
π
2 − cos nx − sin nx
= (x + 1) −1
π n n2 0
π
2 cos nx sin nx
= − (x + 1) +
π n n2 0
(−1)n
2 −1
= − (π + 1) +0 − +0
π n n
(−1)n
2 1
= − (π + 1)
π n n
2
∴ bn = [1 − (π + 1) (−1)n ]
nπ
From (1), the Fourier series of f (x) is
∞
X 2
f (x) = [1 − (π + 1) (−1)n ] sin nx
n=1
nπ
∞
2X sin nx
= [1 − (π + 1) (−1)n ]
π n=1 n
Z π
2
Now, a0 = |cos x|dx
π 0
π
Z Z π
2
= 2 |cos x| dx + π |cos x| dx
π 0
π 2
Z Z π
2
= 2 cos xdx + π (− cos x)dx
π 0
π 2
Z Z π
2
= 2 cos xdx − π cos xdx
π 0
2
π
2
= (sin x)02 − (sin x)ππ
π
2
2 2
= [(1 − 0) − (0 − 1)] = [1 + 1]
π π
4
∴ a0 =
Z π
2 π
an = |cos x| cos nxdx
π 0
π
Z Z π
2
= 2 |cos x| cos nxdx + π |cos x| cos nxdx
π 0
π 2
Z Z π
2
= 2 cos x cos nxdx + π (− cos x) cos nxdx
π 0
π 2
Z Z π
2
= 2 cos nx cos xdx − π cos nx cos xdx
π 0
π 2
Z
2 2 1
= [cos (n + 1) x + cos (n − 1) x] dx
π 0 2
Z π
1
− π [cos (n + 1) x + cos (n − 1) x] dx
2
2
1
∵ cos A cos B = cos (A + B) + cos (A − B)
2
MA6351 Transforms and Partial Differential Equations by K A Niranjan Kumar 115
π
Z
1 2
= [cos (n + 1) x + cos (n − 1) x] dx
π 0
Z π
− π [cos (n + 1) x + cos (n − 1) x] dx
2
π
1 sin (n + 1) x sin (n − 1) x 2
= +
π n+1 n−1 0
π
sin (n + 1) x sin (n − 1) x
− + π
n+1 n−1
2
π π
1 sin (n + 1) 2
sin (n − 1)
= + 2 − 0
π n+1 n−1
π π
sin (n + 1) sin (n − 1)
− 0−
2 + 2
n+1 n−1
π π
1 2 sin (n + 1) 2 sin (n − 1)
= 2 + 2
π n+1 n−1
nπ π nπ π
2 sin 2 + 2 sin −
= + 2 2
π n+1 n−1
nπ π π π nπ π π π
2 sin 2 cos 2 + cos n 2 sin 2 sin cos − cos n sin
= + 2 2 2 2
π n+1 n−1
nπ nπ
2 cos cos
= 2 − 2
π n+1 n−1
nπ 2 cos nπ
2 cos 1 1 −1 − (+1)
= 2 − = 2
π n+1 n−1 π n2 − 1
nπ
−4 cos
∴ an = 2 ,n 6= 1
2
π (n − 1)
116 Unit II - FOURIER SERIES (F.S.)
2 π
Z
2
Z π ∵ an = |cos x| cos nxdx
Now, a1 = |cos x| cos xdx π Z0
π 2 π
0 ∴ a1 = |cos x| cos xdx
π 0
π
Z Z π
2 2
= cos x cos xdx + π − cos x cos xdx
π 0
π 2
Z Z π
2
= 2 cos2 xdx − π cos2 xdx
π 0
π 2
Z Z π
2 1 1
= 2 (1 + cos 2x) dx − π (1 + cos 2x) dx
π 0 2 2
π 2
Z Z π
1 1
= 2 (1 + cos 2x) dx − π (1 + cos 2x) dx
π 0 2
2
π
π
1 sin 2x 2 sin 2x
= x+ − x+
π 2 2 π
0
2
1 hh π i h π ii
= − 0 − 0 − (π + 0) − +0
πh 2 i 2
1 π π
= −
π 2 2
∴ a1 =0
From (1), the Fourier series of f (x) is
∞
a0 X
f (x) = + a1 cos x + an cos nx
2 n=2
nπ
∞ −4 cos
1 4 X
2 cos nx
= +0+ 2
2 π n=2
π (n − 1)
nπ
∞ cos
2 4 X
2 cos nx.
= − 2
π π n=1 n − 1
Example 2.20. * Find the Fourier series for
f (x) = | sin x|
in the interval (−π, π).
−4
4 2
, (n = even)
a = , a = π (n − 1) , bn = 0(∵ even)
0 π n
0, (n = odd)
MA6351 Transforms and Partial Differential Equations by K A Niranjan Kumar 117
√
Example 2.21. Find the Fourier series for f (x) = 1 − cos x in
(−π, π).
√
Solution : Given f (x) = 1 − cos x
p √
f (−x) = 1 − cos(−x) = 1 − cos x
f (−x) =f (x)
√
∴ f (x) = 1 − cos x is an even function in −π < x < π.
∴ The Fourier series for the even function f (x) is given by
∞
a0 X
f (x) = + an cos nx (1)
2 n=1
Z π
2 π
Z
2
where a0 = f (x)dxan = f (x) cos nxdx
π 0 π 0
√
r
2 x
√
Z π
2 ∵ 1 − cos x = 2 sin 2
Now, a0 = 1 − cos xdx √
π 0 x
= 2 sin
√ Z π 2
Z π√
2 x 2 2 x
= 2 sin dx = sin dx
π 0 2 π 0 2
π
√ − cos x
√ h
2 2 2 −4 2 x iπ
= 1 = cos
π π 2 0
√ 2 0
−4 2 h π i
= [0 − 1] ∵ cos = 0, cos 0 = 1
√π 2
4 2
∴ a0 =
π
118 Unit II - FOURIER SERIES (F.S.)
2 π√
Z
an = 1 − cos x cos nxdx
π 0
2 π√
Z
x
= 2 sin cos nxdx
π 0 2
√ Z π
2 2 x
= cos nx sin dx
π 2
√ Z0 π
2 2 1 1 1
= sin n + x − sin n − x dx
π 0 2 2 2
√ Z π
2 1 1
= sin n + x − sin n − x dx
π 0 2 2
π
1 1
√ cos n + x cos n − x
2− 2 2
= +
π 1 1
n+ n−
2 2
0
1 1
√ − cos n + π cos n − π
2 2 2 − −1 1
= + +
π 1 1 1 1
n+ n− n+ n−
2 2 2 2
MA6351 Transforms and Partial Differential Equations by K A Niranjan Kumar 119
π π
√
2 cos nπ − 2 cos nπ +
2 + 1 − 1
= −
π
1 1 1 1
n− n+ n+ n−
2 2 2 2
π π π π
√ cos nπ cos + sin nπ sin cos nπ cos − sin nπ sin
2
2 2 − 2 2
=
π 1 1
n− n+
2 2
1 1
n− − n+
2 2
+
1
n2 −
4
−1 1
√ −
2 2 2
h π i
= 0 − 0 + ∵ cos = 0, sin nπ = 0
π
2
1 2
n −
4
√
2 −1
=
π
2
1
n −
√ 4
− 2
an =
1
π n2 −
4
Sub. the value of a0 and an in (1)
√ ! ∞ √
1 4 2 X − 2
f (x) = + cos nx
2 π 1
n=1 π n2 −
4
√ √ ∞
2 2 2 X cos nx
= −
π π n=1 2 1
n −
4
Example 2.22. Find the Fourier series for the function f (x) = x cos x in
the interval (−π, π).
∞
X
f (x) = bn sin nx (1)
n=1
2 π
Z
where bn = f (x) sin nxdx
π 0
2 π
Z
= x cos x sin nxdx
π 0
2 π
Z
= x sin nx cos xdx
π 0
2 π 1
Z
= x (sin (n + 1) x + sin (n − 1) x) dx
π 0 2
1 π
Z
= x (sin (n + 1) x + sin (n − 1) x) dx
π 0
1 − cos(n+1)x cos(n − 1)x
= x −
π n+1 n−1
π
− sin(n+1)x sin(n−1)x
−1 −
(n+1)2 (n−1)2 0
1 cos (n + 1) x cos (n − 1) x
= −x +
π n+1 n−1
π
sin (n + 1) x sin (n − 1) x
+ +
(n + 1)2 (n − 1)2
"" ! # # 0
n+1 n−1
1 (−1) (−1)
= −π + + 0 − [0 + 0]
π n+1 n−1
!
n+1 n−1
(−1) (−1)n (−1)n
(−1) (−1)
=− + =− +
n+1 n−1 n+1 (−1) (n − 1)
− (−1)n (−1)n
n 1 1
=− − = (−1) +
n+1 n−1 n+1 n−1
n − 1 + n + 1
=(−1)n
n2 − 1
2n (−1)n
∴ bn = 2 , n 6= 1
n −Z1
2 π 2 π
Z
Now, b1 = x cos x sin xdx ∵ bn = x cos x sin xdx
π 0 π 0
1 π
Z
= x2 sin x cos xdx
π 0
1 π
Z
= x sin 2xdx
π 0
MA6351 Transforms and Partial Differential Equations by K A Niranjan Kumar 121
π
1 − cos 2x − sin 2x
= x −1
π 2 4
0π
1 − cos 2x − sin 2x
= x −1
π 2 4 0
π
1 −x cos 2x sin 2x
= +
π 2 4 0
1 h π i
= − + 0 − (0 + 0)
π 2
1
∴ b1 =−
2
From (1), the Fourier series of f (x) is
X∞
f (x) =b1 sin x + bn sin nx
n=2
∞
1 2n (−1)n
X
=− sin x + 2−1
sin nx
2 n=2
n
∞
1 X n (−1)n
=− sin x + 2 2−1
sin nx
2 n=2
n
0, −π < x < 0
Example 2.23. Obtain Fourier series for f (x) =
sin x, 0 < x < π
1 1 1 1
and deduce that + + + ··· = .
1.3 3.5 5.7 2
Solution :
0, −π < x < 0
Given f (x) =
sin x, 0 < x < π
0, 0 ≤ x ≤ π
f (−x) =
sin(−x), −π ≤ x ≤ 0
0, 0 ≤ x ≤ π
=
− sin x, −π ≤ x ≤ 0
− sin x, −π ≤ x ≤ 0
=
0, 0 ≤ x ≤ π
f (x)
f (−x) 6=
−f (x)
∴ f (x) is neither even function nor odd function.
The Fourier series for[ neither odd nor even function(none function)] f (x)
is given by
∞
a0 X
f (x) = + (an cos nx + bn sin nx) (1)
2 n=1
122 Unit II - FOURIER SERIES (F.S.)
where
π
1 π 1 π
Z Z Z
1
a0 = f (x)dx, an = f (x) cos nxdx, bn = f (x) sin nxdx
π −π π −π π −π
Z 0 Z π
1 π
Z
1
Now, a0 = 0dx+ sin xdx = sin xdx
π −π 0 π 0
1 1 1
= [− cos x]π0 = − [cos x]π0 = − [−1 − 1]
π π π
2
∴ a0 =
Z 0π Z π
1
an = 0 cos nxdx + sin x cos nxdx
π −π 0
1 π
Z
= cos nx sin xdx
π 0
1 π1
Z
= [sin (n + 1) x − sin (n − 1) x] dx
π 0 2
Z π
1
= [sin (n + 1) x − sin (n − 1) x] dx
2π 0
π
1 − cos (n + 1) x cos (n − 1) x
= +
2π n+1 n−1
" ! 0 #
n+1 n−1
1 − (−1) − (−1) −1 1
= + − −
2π n+1 n−1 n+1 n−1
− (−1) (−1)n (−1)n
1 1 1
= + + −
2π n+1 (−1) (n − 1) n+1 n−1
− (−1) (−1)n (−1)n
1 1 1
= + + −
2π n+1 (−1) (n − 1) n+1 n−1
(−1)n (−1)n
1 1 1
= − + −
2π n+1 n−1 n+1 n−1
1 n 1 1 1 1
= (−1) − + −
2π n + 1 n −
1 n + 1 n−1
1 1 1
= − ((−1)n + 1)
2π n + 1 n − 1
1 n − 1 − (n + 1)
= 2
((−1)n + 1)
2π n −1
1 −2 ((−1)n + 1)
=
2π n2 − 1
1 (−1)n + 1
∴ an =− , n 6= 1
π n2 − 1
MA6351 Transforms and Partial Differential Equations by K A Niranjan Kumar 123
1 π
Z Z 0 Z π
1
a1 = f (x) cos xdx = 0 cos xdx + sin x cos xdx
π −π π −π 0
Z π Z π
1 1
= 2 sin x cos xdx = sin 2xdx
2π 0 2π 0
π
1 − cos 2x −1 −1
= = [cos 2x]π0 = [1 − 1]
2π 2 0 4π 4π
∴ a1 =0
Z 0 Z π
1
bn = 0 sin nxdx + sin x sin nxdx
π −π 0
1 π
Z
= sin nx sin xdx
π 0
1 π1
Z
= [cos (n − 1) x − cos (n + 1) x] dx
π 0 2
Z π
1
= [cos (n − 1) x − cos (n + 1) x] dx
2π 0
π
1 sin (n − 1) x sin (n + 1) x
= − , n 6= 1
2π n−1 n+1 0
1
= [(0 − 0) − (0 − 0)] , n 6= 1
2π
∴ bn =0, n 6= 1
1 π
Z Z 0 Z π
1
b1 = f (x) sin xdx = 0 sin xdx + sin x sin xdx
π −π π π 0
1 π 2
Z
= sin xdx
π 0
1 π1
Z Z π
1
= (1 − cos 2x) dx = (1 − cos 2x) dx
π 0 2 π 2π 0
1 sin 2x 1
= x− = [(π − 0) − (0 − 0)]
2π 2 0 2π
1
∴ b1 =
2
From (1),
∞ ∞
a0 X X
f (x) = + an cos nx+ bn sin nx
2 n=1 n=1
∞ ∞
a0 X X
= + a1 cos x + an cos nx+b1 sin x + bn sin nx
2 n=2 n=2
∞
X −1 (−1)n + 1
1 2 1
= +0+ 2−1
cos nx + sin x + 0
2 π n=2
n n 2
124 Unit II - FOURIER SERIES (F.S.)
∞
1 1 X (−1)n + 1
sin x
∴ f (x) = − cos nx + (2)
π π n=2 n2 − 1 2
Example 2.24. * Find the Fourier series for f (x) = e−x in (−π, π) and
∞
X (−1)n π
hence deduce 2 2 + 1)
= .
n=2
(n sinh π
(−1)n 2n (−1)n sinh π
2 sinh π
a0 = , an = (2 sinh π), bn = &x = 0
π π (1 + n2 ) π (1 + n2 )
MA6351 Transforms and Partial Differential Equations by K A Niranjan Kumar 125
bn = 0 a0 = an = 0
∞ ∞
a0 X nπx X nπx
f (x) = + an cos f (x) = an sin
2 n=1
` n=1
`
where Z where Z
2 ` 2 ` nπx
a0 = f (x)dx bn = f (x) sin dx
` 0 ` 0 `
2 `
Z
nπx
an = f (x) cos dx
` 0 `
Note :
Half range Fourier series in (0, π), substitute ` = π in above formulae.
(If the power of n in Fourier series expansion < the power of n in deduction
part, then use appropriate Parseval’s Identity)
` ∞
a20 X 2
Z
2 2
an + b2n
(0, `) [f (x)] dx = +
`
0 2 n=1
Z π 2 ∞
2 2 a0 X 2
an + b2n
(0, π) [f (x)] dx = +
π 0 2 n=1
Example 2.25. Find Half range Fourier sine series for f (x) = x in (0, π)
1 1 1 π2
and deduce 2 + 2 + 2 + ... = .
1 2 3 6
−2 (−1)n
∵ sine ∵ sine
& Par0 s id
a0 = 0 , an = 0 , bn =
series series n
126 Unit II - FOURIER SERIES (F.S.)
Example 2.26. * Find Half range Fourier cosine series for f (x) = x in
1 1 1 π4
(0, π) and deduce 4 + 4 + 4 + ... = .
1( 3 5 96
( −4 )
, (n = odd) ∵ cos
& Par0 s id
a0 = π, an = πn2 , bn = 0
0, (n = even) series
Example 2.27. Expand x(π − x) in half range sine series in the interval
(0, π).
∞
X
f (x) = bn sin nx → (1)
n=1
Zπ
2
where bn = f (x) sin nxdx
π
0
Zπ
2
πx − x2 sin nxdx
=
π
0
2 − cos nx
2 − sin nx
= πx − x − (π − 2x)
π n n2
cos nx iπ
+ (−2)
n3 0
2 2 cos nx
sin nx cos nx iπ
= − πx − x + (π − 2x) −2 3
π n n2 n 0
n
2 2 (−1) 2
= 0+0− − 0 + 0 −
π n3 n3
2 (−1)n
2 2
= −
π n3 n3
4
bn = 3
[1 − (−1)n ]
πn
MA6351 Transforms and Partial Differential Equations by K A Niranjan Kumar 127
Example 2.28. Find the Fourier series for f (x) = (` − x)2 in (0, 2`) and
∞
π2 2`2 4`2
X 1
deduce 2
= . a0 = , an = 2 2 , bn = 0&x = 0
n=1
n 6 3 nπ
x, 0 ≤ x ≤ 3
Example 2.29. Find the Fourier series for f (x) =
6 − x, 3 ≤ x ≤ 6
−12
a0 = 3, an = 2 2 (n = odd), bn = 0
nπ
Example 2.30. * Find the Fourier series for
x " −4
, 0<x<`
( # )
, (n = odd)
f (x) = 2`−x` . a0 = 1, an = n2 π 2 , bn = 0
, ` < x < 2` 0, (n = even)
`
Example 2.31.Find the Fourier series for f (x) = e−x in (−1, 1).
2 (−1)n sinh 1 2nπ (−1)n sinh 1
a0 = 2 sinh 1, an = , bn =
1 + n2 π 2 1 + n2 π 2
0, −2 < x < −1
Example 2.32. * Find the Fourier series for f (x) = k, −1 < x < 1 .
0, 1 < x < 2
128 Unit II - FOURIER SERIES (F.S.)
nπ
2k sin
a0 = k, an = 2 , bn = 0 (∵ even function)
nπ
∞ Z 2π
X 1
(0, 2π) f (x) = Cn einx
Cn = f (x) e−inx dx
n=−∞
2π 0
∞ Z π
X 1
(−π, π) f (x) = Cn einx
Cn = f (x) e−inx dx
n=−∞
2π −π
∞ Z 2`
X 1
(0, 2`) f (x) = Cn einπx/` Cn = f (x) e−inπx/` dx
n=−∞
2` 0
∞
1 `
X Z
(−`, `) f (x) = Cn einπx/` Cn = f (x) e−inπx/` dx
n=−∞
2` −`
∞
1 π
X Z
(0, π) f (x) = Cn einx Cn = f (x) e−inx dx
n=−∞
π 0
∞
1 `
X Z
(0, `) f (x) = Cn einπx/` Cn = f (x) e−inπx/` dx
n=−∞
` 0
Example 2.37. Derive complex form for f (x)(= eax in (0, 2π).
)
(a + in) e2aπ − 1
cn =
2π (a2 + n2 )
Example 2.38. Find the complex form of the seriesfor the function
−` (−1)n
f (x) = x in (−`, `). cn =
inπ
130 Unit II - FOURIER SERIES (F.S.)
So far, we found Fourier series for a function f (x) given by the formula
in one (or) more interval. Now, there is a process of finding a Fourier series
for the function f (x) given by a Table (or) by numerical values (or) by the
Graph is known as Harmonic Analysis.
We know that Fourier series for f (x) in (0, 2π) is
∞
a0 X
f (x) = + (an cos nx + bn sin nx)
2 n=1
(or)
∞ ∞
a0 X X
f (x) = + an cos nx + bn sin nx (1)
2 n=1 n=1
1 2π
Z
where a0 = f (x) dx
π 0
Z 2π
2
= f (x) dx
2π 0
Z 2π
1
=2 f (x) dx
(2π − 0) 0
Z b
1
∵ f (x)dx = Mean value off (x) in (a, b)
b−a a P
f (x)
∴ a0 = 2 [ Meanvalueoff (x) in (0, 2π)] = 2
n
2 hX i
= f (x)
n
1 2π
Z
Now, an = f (x)cosnx dx
π 0
Z 2π
2
= f (x) cos nxdx
2π 0
Z 2π
1
=2 f (x)cosnx dx
(2π − 0) 0
Z b
1
∵ f (x) cos nxdx = Mean value off (x) cos nx in (a, b)
b−a a
2 hX i
∴ an = 2 [ Mean value off (x) cos nx in (0, 2π)] = f (x) cos nx
n hX
2 i
lly, bn = 2 [ Mean value off (x) sin nx in (0, 2π)] = f (x) sin nx
n
Note: In equation (1),
MA6351 Transforms and Partial Differential Equations by K A Niranjan Kumar 131
a0
1. The term is called constant term / direct part / direct current part
2
of Fourier series.
2. In (0, 2π), (i) (a1 cos x + b1 sin x) is called fundamental (or) first
harmonic. (ii) (a2 cos 2x + b2 sin 2x) is called octave (or) second
harmonic of F.S.
(i) Fourier series upto first harmonic is
a0
f (x) = + (a1 cos x + b1 sin x)
2
(ii) Fourier series upto second harmonic is
a0
f (x) = + (a1 cos x + b1 sin x) + (a2 cos 2x + b2 sin 2x)
2
4.(i) Fourier series upto 2 coefficients in Fourier cosine series is
a0
f (x) = + (a1 cos x + a2 cos 2x)
2
(ii) Fourier series upto 2 coefficients in Fourier sine series is
f (x) = b1 sin x + b2 sin 2x
5. In (0, 2`), Fourier series upto 2nd harmonic is
a0 πx πx
f (x) = + a1 cos + b1 sin
2 ` `
2πx 2πx
+ a2 cos + b2 sin
` `
p
6. Amplitude of the nth harmonic = An = a2n + b2n
Solution : Let
a0
f (x) = + a1 cos x + a2 cos 2x + b1 sin x + b2 sin 2x (1)
2
be the F.S. upto second harmonic.
Since the first and last values of y are same in the given table, leave the
first column (or) last column of the table. Hence only the first six column
values will be used.
Example 2.43. The following table gives the vibration of periodic current
over a period. Find Fourier series upto 1st harmonic.
T(sec) 0 T/6 T/3 T/2 2T/3 5T/6 T
I(Amp) 1.98 1.3 1.05 1.3 –0.88 –0.25 1.98
Example 2.44. Find the first harmonic of the Fourier series for f (x) for
x 0 1 2 3 4 5
the data.
f(x) 9 18 24 28 26 20
{a0 = 41.67, a1 = −8.33, b1 = −1.16}
134 Unit II - FOURIER SERIES (F.S.)
8. Obtain a Fourier series upto the second harmonics from the data
x: 0 π/3 2π/3 π 4π/3 5π/3 2π
f(x): 0.8 0.6 0.4 0.7 0.9 1.1 0.8
9. The following table gives the vibration of periodic current over a
period. Find the Fourier upto 2nd harmonic.
T(sec): 0 T /6 T /6 T /2 2T /3 5T /6 T
I(Amp): 1.98 1.3 1.05 1.3 -0.88 -0.25 1.98
10. Find the Fourier series as for as the second harmonic to represent the
x: 0 1 2 3 4 5
function given in the following table
f(x): 9 18 24 28 26 20