#15 (10/18/2023)

Even and odd functions

A function, f(x), is an even function if f(x) = f(−x) and is an odd function if f(x) = −f(−x). When a function, f(x), is neither even nor odd, it can be decomposed into the even part and the odd part as

f(x) = G(x) + H(x),
(1)
where
G(x)
=
f(x) + f(−x)

2
,
(2)
H(x)
=
f(x) − f(−x)

2
.
(3)
The function, G(x), is the even part of f(x) and the function, H(x), is the odd part of f(x).
Example 1: f(x) = ex:
G(x)=(ex + ex)/2 = cosh x and H(x) = (exex)/2 = sinh x. The even part of ex is the hyperbolic cosine function and the odd part of ex is the hyperbolic sine function.
Example 2: f(x) = eix:
G(x)=(eix + eix)/2 = cos x and H(x) = (eixeix)/2 = sin x. The even part of eix is the cosine function and the odd part of eix is the sine function.
Similarities:
cos2  x + sin2  x = 1,     cosh2  x − sinh2  x = 1,

(cos x)′ = − sin x,     (cosh x)′ = sinh x,

(sin x)′ = cos x,     (sinh x)′ = cosh x.

Fourier Series

The function, eimx, is called the fundamental periodic function as it is a combination of sin  mx and cos  mx. A periodic function, f(x), over [−π, π] can be expanded by a linear combination of the fundamental periodic functions as

f(x) =

m=−∞ 
cm eimx.
(4)
Multiplying einx on the both sides of Eq.(4) and integrating the result from −π to π yields


π

−π 
f(x) einx dx
=


m=−∞ 
cm
π

−π 
ei(mn)x dx
=
cn,
(5)
thus

cn = 1



π

−π 
f(x) einx dx,
(6)
where

π

−π 
eimx einx dx =



0
mn
m=n
was used.
Equations (4, 6) can be converted into real format as

f(x)
=


m=−∞ 
cm eimx
=
(…+ c−2 e−2ix+c−1 eix + c0 + c1 eix+c2 e2ix + …)
=


m=1 
cmeimx + c0+

m=1 
cmeimx
=
c0 +

m=1 
(cm eimx + cm eimx)
=
c0 +

m=1 
( (cm+cm)cos  mx + i(cmcm) sin  mx)
=
a0

2
+

m=1 
( am cos  mx + bm sin  mx),
(7)
where

a0
=
2 c0
=
1

π

π

−π 
f(x) dx.
(8)

am
=
cm + cm
=
1



π

−π 
f(x) eimx dx + 1



π

−π 
f(x) eimx dx
=
1



π

−π 
f(x)(eimx+eimx)dx
=
1

π

π

−π 
f(x) cos  mx dx.
(9)

bm
=
i (cmcm)
=
i
1



π

−π 
f(x) eimxdx 1



π

−π 
f(x) eimxdx
=
i



π

−π 
f(x)(eimxeimx) dx
=
i



π

−π 
f(x) (−2i sin  mx) dx
=
1

π

π

−π 
f(x) sin  mx dx.
(10)
Example: Square wave
squarewave.jpg

f(x) =



0
−π < x < 0
1
0 < x < π
(11)

a0
=
1

π

π

−π 
f(x) dx
=
1

π

π

0 
1 dx
=
1.
(12)
am
=
1

π

π

−π 
f(x) cos  mx dx
=
1

π

π

0 
cos  mx dx
=
1

π

sin  mx

m

x

x=0 
=
0.
(13)
bm
=
1

π

π

−π 
f(x) sin  mx dx
=
1

π

π

0 
sin  mx dx
=
1

π

cos  mx

m

x

x=0 
=
1−(−1)m

m π
.
(14)
so
f(x)
=
1

2
+

m=1 
1−(−1)m

mπ
sin  mx
=
1

2
+ 2

π
(sin  x + sin  3x

3
+ sin  5x

5
+…)
=
1

2
+ 2

π


n=1 
sin(2n−1) x

2n−1
.
(15)
Substituting x=π/2 in Eq.(15) yields

1 = 1

2
+ 2

π
(1− 1

3
+ 1

5
− …),
(16)
so

1− 1

3
+ 1

5
1

7
+… = π

4
.
(17)
Note that Eq.(17) can be also obtained by Taylor's series of arctanx, i.e.

arctanx = x x3

3
+ x5

5
+ …
(18)
Substituting x=1 in Eq.(18) yields the result of Eq.(17). Note also that Eq.(18) can be obtained by integrating geometric series of
1

1+x2
= 1−x2+x4x6 + …
(19)




File translated from TEX by TTH, version 4.03.
On 17 Oct 2023, 23:07.