Even andOdd Functions - tkiryl.com Differential Equations and Linear Algebra...EXAMPLE: Expand the...

6

Click here to load reader

Transcript of Even andOdd Functions - tkiryl.com Differential Equations and Linear Algebra...EXAMPLE: Expand the...

Page 1: Even andOdd Functions - tkiryl.com Differential Equations and Linear Algebra...EXAMPLE: Expand the function f(x) = 1 in a pure sine series on the interval 0 < x < π. Solution: By

Even and Odd Functions

There are certain special cases when the Fourier series of a function f reduces to a pure cosine or a puresine series. These special cases occur when f is even or odd.

DEFINITION: A function f that satisfies

f(−x) = f(x)

for every number x in its domain is called an even function. A function f that satisfies

f(−x) = −f(x)

for every number x in its domain is called an odd function.

REMARK: Any function is either even, or odd, or neither.

PROPERTY: Graphs of even functions are symmetric with respect to the y-axis. Graphs of odd functionsare symmetric with respect to the origin.

EXAMPLES:

1. Functions f(x) = x2, x4, x8, x4 − x2, x2 + 1, |x|, cos x, etc. are even. In fact,

• if f(x) = x2, then f(−x) = (−x)2 = x2 = f(x)

• if f(x) = x4, then f(−x) = (−x)4 = x4 = f(x)

• if f(x) = x8, then f(−x) = (−x)8 = x8 = f(x)

• if f(x) = x4 − x2, then f(−x) = (−x)4 − (−x)2 = x4 − x2 = f(x)

• if f(x) = x2 + 1, then f(−x) = (−x)2 + 1 = x2 + 1 = f(x)

• if f(x) = |x|, then f(−x) = | − x| = |x| = f(x)

• if f(x) = cos x, then f(−x) = cos(−x) = cos x = f(x)

One can see that graphs of all these functions are symmetric with respect to the y-axis.

2. Functions f(x) = x, x3, x5, x3 − x7, sin x, etc. are odd. In fact,

• if f(x) = x, then f(−x) = −x = −f(x)

• if f(x) = x3, then f(−x) = (−x)3 = −x3 = −f(x)

• if f(x) = x5, then f(−x) = (−x)5 = −x5 = −f(x)

• if f(x) = x3 − x7, then f(−x) = (−x)3 − (−x)7 = −x3 + x7 = −(x3 − x7) = −f(x)

• if f(x) = sin x, then f(−x) = sin(−x) = − sin x = −f(x)

One can see that graphs of all these functions are symmetric with respect to the origin.

3. Functions f(x) = x+ 1, x3 + x2, x5 − 2, |x− 2| etc. are neither even nor odd. In fact,

• if f(x) = x+ 1, then f(−1) = −1 + 1 = 0, f(1) = 1 + 1 = 2, therefore f(−1) 6= ±f(1)

• if f(x) = x3 + x2, then f(−1) = (−1)3 + (−1)2 = −1 + 1 = 0, f(1) = 13 + 12 = 2, thereforef(−1) 6= ±f(1)

• if f(x) = x5 − 2, then f(−1) = (−1)5 − 2 = −1 − 2 = −3, f(1) = 15 − 2 = 1 − 2 = −1, thereforef(−1) 6= ±f(1)

• if f(x) = |x − 2|, then f(−1) = | − 1 − 2| = | − 3| = 3, f(1) = |1 − 2| = | − 1| = 1, thereforef(−1) 6= ±f(1)

1

Page 2: Even andOdd Functions - tkiryl.com Differential Equations and Linear Algebra...EXAMPLE: Expand the function f(x) = 1 in a pure sine series on the interval 0 < x < π. Solution: By

Even and odd functions satisfy the following elementary properties.

1. The product of two even functions is even.

2. The product of two odd functions is even.

3. The product of an odd function with an even function is odd.

4. The integral of an odd function f over a symmetric interval [−l, l] is zero; that is,

l∫

−l

f(x)dx = 0 if f is odd

5. The integral of an even function f over the interval [−l, l] is twice the integral of f over the interval[0, l]; that is,

l∫

−l

f(x)dx = 2

l∫

0

f(x)dx if f is even

LEMMA 1:

(a) The Fourier series for an even function is a pure cosine series; that is, it contains no terms of theform sinnπx/l.

(b) The Fourier series for an odd function is a pure sine series; that is, it contains no terms of the formcosnπx/l.

THEOREM 3: Let f and f ′ be piecewise continuous on the interval 0 ≤ x ≤ l. Then, on this interval,f(x) can be expanded in either a pure cosine series

a02

+∞∑

n=1

an cos(nπx

l

)

or a pure sine series∞∑

n=1

bn sin(nπx

l

)

In the former case, the coefficients an are given by the formula

an =2

l

l∫

0

f(x) cos(nπx

l

)

dx, n = 0, 1, 2, . . . (1)

while in the latter case, the coefficients bn are given by the formula

bn =2

l

l∫

0

f(x) sin(nπx

l

)

dx, n = 0, 1, 2, . . . (2)

2

Page 3: Even andOdd Functions - tkiryl.com Differential Equations and Linear Algebra...EXAMPLE: Expand the function f(x) = 1 in a pure sine series on the interval 0 < x < π. Solution: By

EXAMPLE: Let f(x) = 1.

(a) Expand f in a pure sine series on the interval 0 < x < π.

Solution: By Theorem 3,

f(x) =∞∑

n=1

bn sin(nπx

l

)

=∞∑

n=1

bn sin(nπx

π

)

=∞∑

n=1

bn sinnx

where

bn =2

l

l∫

0

f(x) sin(nπx

l

)

dx =2

π

π∫

0

1 sin(nπx

π

)

dx =2

π

π∫

0

sinnxdx

=2

π

(

−cosnx

n

)∣

π

0

=2

(

− cosn(π) + cosn(0))

=2

nπ(1− cosnπ)

=

2

nπ(1− 1) = 0, n even

2

nπ(1− (−1)) =

4

nπ, n odd

Hence,

1 =4

π

[

sin x

1+

sin 3x

3+

sin 5x

5+ . . .

]

, 0 < x < π

(b) Expand f in a pure cosine series on the interval 0 < x < π.

Solution: Puttinga0 = 2, a1 = a2 = . . . = 0

we get

1 =2

2+

∞∑

n=1

0 cos(nπx

l

)

Note that Theorem 3 gives the same result, since

a0 =2

l

l∫

0

f(x)dx =2

π

π∫

0

1dx =2

π(π − 0) = 2

and

an =2

l

l∫

0

f(x) cos(nπx

l

)

dx =2

π

π∫

0

1 cos(nπx

π

)

dx =2

π

π∫

0

cosnxdx =2

π

(

sinnx

n

)∣

π

0

=2

(

sinn(π)− sinn(0))

=2

nπ(0− 0)

= 0

3

Page 4: Even andOdd Functions - tkiryl.com Differential Equations and Linear Algebra...EXAMPLE: Expand the function f(x) = 1 in a pure sine series on the interval 0 < x < π. Solution: By

EXAMPLE: Expand the function f(x) = ex in a pure cosine series on the interval 0 ≤ x ≤ 1.

Solution: By Theorem 3,

f(x) =a02

+∞∑

n=1

an cos(nπx

l

)

=a02

+∞∑

n=1

an cos(nπx

1

)

=a02

+∞∑

n=1

an cosnπx

where

a0 =2

l

l∫

0

f(x)dx = 2

1∫

0

exdx = 2ex

1

0

= 2(e1 − e0) = 2(e− 1)

and

an =2

l

l∫

0

f(x) cos(nπx

l

)

dx =2

1

1∫

0

ex cos(nπx

1

)

dx

= 2

1∫

0

ex cosnπxdx

= 2Re

1∫

0

exeinπxdx

= 2Re

1∫

0

e(1+inπ)xdx

= 2Re

{

e(1+inπ)x

1 + inπ

1

0

}

= 2Re

{

e(1+inπ)(1) − e(1+inπ)(0)

1 + inπ

}

= 2Re

{

e1+inπ − 1

1 + inπ

}

One can show (see Appendix I) that

2Re

{

e1+inπ − 1

1 + inπ

}

=2(e cosnπ − 1)

1 + n2π2

Hence,

ex = e− 1 + 2∞∑

n=1

(e cosnπ − 1)

1 + n2π2cosnπx, 0 ≤ x ≤ 1

REMARK: Another way to find

1∫

0

ex cosnπxdx is shown in Appendix II.

4

Page 5: Even andOdd Functions - tkiryl.com Differential Equations and Linear Algebra...EXAMPLE: Expand the function f(x) = 1 in a pure sine series on the interval 0 < x < π. Solution: By

Appendix I

Here we show that

Re

{

e1+inπ − 1

1 + inπ

}

=e cosnπ − 1

1 + n2π2(3)

To this end, we first note that

e1+inπ − 1

1 + inπ=

e · einπ − 1

1 + inπ=

e(cosnπ + i sinnπ)− 1

1 + inπ=

e(cosnπ + i · 0)− 1

1 + inπ

=e cosnπ − 1

1 + inπ

=(e cosnπ − 1)(1− inπ)

(1 + inπ)(1− inπ)

=(e cosnπ − 1)(1− inπ)

12 − (inπ)2

=(e cosnπ − 1)(1− inπ)

1 + n2π2

so

Re

{

e1+inπ − 1

1 + inπ

}

= Re

{

(e cosnπ − 1)(1− inπ)

1 + n2π2

}

(4)

But(e cosnπ − 1)(1− inπ) = (1)(e cosnπ − 1)− (inπ)(e cosnπ − 1)

thereforeRe {(e cosnπ − 1)(1− inπ)} = e cosnπ − 1

This and (4) give (3).

5

Page 6: Even andOdd Functions - tkiryl.com Differential Equations and Linear Algebra...EXAMPLE: Expand the function f(x) = 1 in a pure sine series on the interval 0 < x < π. Solution: By

Appendix II

Here we show that1

0

ex cosnπxdx =e cosnπ − 1

1 + n2π2

By the integration by parts formula∫

udv = uv −

vdu

we get

ex cosnπxdx =

ex = u cosnπxdx = dv

exdx = du1

nπsinnπx = v

= ex ·1

nπsinnπx−

1

nπsinnπx · exdx

=1

nπex sinnπx−

1

ex sinnπxdx =

ex = u sinnπxdx = dv

exdx = du −1

nπcosnπx = v

=1

nπex sinnπx−

1

(

−ex ·1

nπcosnπx+

1

nπcosnπx · exdx

)

=1

nπex sinnπx−

1

(

−ex ·1

nπcosnπx+

1

ex cosnπxdx

)

=1

nπex sinnπx+

1

n2π2ex cosnπx−

1

n2π2

ex cosnπxdx

so∫

ex cosnπxdx =1

nπex sinnπx+

1

n2π2ex cosnπx−

1

n2π2

ex cosnπxdx

hence

n2π2

ex cosnπxdx = nπex sinnπx+ ex cosnπx−

ex cosnπxdx

ex cosnπxdx+ n2π2

ex cosnπxdx = nπex sinnπx+ ex cosnπx+ C1

(1 + n2π2)

ex cosnπxdx = nπex sinnπx+ ex cosnπx+ C1

ex cosnπxdx =1

1 + n2π2(nπex sinnπx+ ex cosnπx) + C

Therefore1

0

ex cosnπxdx =1

1 + n2π2(nπex sinnπx+ ex cosnπx)

1

0

=1

1 + n2π2

[(

nπe1 sinnπ(1) + e1 cosnπ(1))

−(

nπe0 sinnπ(0) + e0 cosnπ(0))]

=1

1 + n2π2[(nπe sinnπ + e cosnπ)− (nπ sin 0 + cos 0)]

=1

1 + n2π2[(0 + e cosnπ)− (0 + 1)]

=e cosnπ − 1

1 + n2π2

6