[Notes on Diffy Qs home] [PDF version] [Buy paperback on Amazon]

[next] [prev] [prev-tail] [tail] [up]

4.4 Sine and cosine series

Note: 2 lectures, §9.3 in [EP], §10.4 in [BD]

4.4.1 Odd and even periodic functions

You may have noticed by now that an odd function has no cosine terms in the Fourier series and an even function has no sine terms in the Fourier series. This observation is not a coincidence. Let us look at even and odd periodic function in more detail.

Recall that a function f(t) is odd if f(− t) = −f (t) . A function f (t) is even if f (− t) = f(t) . For example, co s(nt) is even and sin(nt) is odd. Similarly the function k t is even if k is even and odd when k is odd.

Exercise 4.4.1: Take two functions f(t) and g(t) and define their product h(t) = f(t)g(t) . a) Suppose both are odd, is h(t) odd or even? b) Suppose one is even and one is odd, is h(t) odd or even? c) Suppose both are even, is h(t) odd or even?

If f(t) and g(t) are both odd, then f(t) + g(t) is odd. Similarly for even functions. On the other hand, if f(t) is odd and g(t) even, then we cannot say anything about the sum f(t) + g(t) . In fact, the Fourier series of any function is a sum of an odd (the sine terms) and an even (the cosine terms) function.

In this section we consider odd and even periodic functions. We have previously defined the 2L -periodic extension of a function defined on the interval [−L, L] . Sometimes we are only interested in the function on the range [0,L ] and it would be convenient to have an odd (resp. even) function. If the function is odd (resp. even), all the cosine (resp. sine) terms disappear. What we will do is take the odd (resp. even) extension of the function to [−L,L ] and then extend periodically to a 2L -periodic function.

Take a function f (t) defined on [0, L] . On (− L,L] define the functions

 (| F (t) de=f|{f (t) if 0 ≤ t ≤ L, odd ||(− f(−t) if −L < t < 0, ( def||{f (t) if 0 ≤ t ≤ L, Feven(t) = ||(f (− t) if −L < t < 0.
Extend Fodd(t) and Feven(t) to be 2L -periodic. Then Fodd(t) is called the odd periodic extension of f (t) , and Feven(t) is called the even periodic extension of f (t) .

Exercise 4.4.2: Check that Fodd(t) is odd and that Feven(t) is even.

Example 4.4.1: Take the function f (t) = t(1 − t) defined on [0,1] . Figure 4.11 shows the plots of the odd and even extensions of f (t) .


PICPIC

Figure 4.11: Odd and even 2-periodic extension of f(t) = t(1 − t) , 0 ≤ t ≤ 1 .


4.4.2 Sine and cosine series

Let f(t) be an odd 2L -periodic function. We write the Fourier series for f(t) . First, we compute the coefficients a n (including n = 0 ) and get

 1 ∫ L (n π ) an = -- f(t)cos ---t dt = 0. L −L L

That is, there are no cosine terms in the Fourier series of an odd function. The integral is zero because f(t)cos(nπLt ) is an odd function (product of an odd and an even function is odd) and the integral of an odd function over a symmetric interval is always zero. The integral of an even function over a symmetric interval [− L,L] is twice the integral of the function over the interval [0,L] . The function  (nπ ) f (t)sin L t is the product of two odd functions and hence is even.

 ∫ L ( ) ∫ L ( ) b = 1- f (t)sin nπ-t dt = 2- f(t)sin nπ-t dt. n L −L L L 0 L

We now write the Fourier series of f (t) as

 ∞ ( ) ∑ nπ- bn sin L t. n=1

Similarly, if f(t) is an even 2L -periodic function. For the same exact reasons as above, we find that bn = 0 and

 2 ∫ L (n π ) an = -- f(t)cos ---t dt. L 0 L

The formula still works for n = 0 , in which case it becomes

 ∫ 2- L a0 = L f(t) dt. 0

The Fourier series is then

 ∑∞ ( ) a0+ ancos nπt . 2 n=1 L

An interesting consequence is that the coefficients of the Fourier series of an odd (or even) function can be computed by just integrating over the half interval [0,L] . Therefore, we can compute the Fourier series of the odd (or even) extension of a function by computing certain integrals over the interval where the original function is defined.

Theorem 4.4.1. Let f (t) be a piecewise smooth function defined on [0,L ] . Then the odd extension of f (t) has the Fourier series

|--------------------------| | ∑∞ (nπ ) | |Fodd(t) = bnsin ---t , | -----------n=1--------L------

where

|----------------------------| | 2 ∫ L (nπ ) | |bn = -- f(t)sin ---t dt. | ------L---0----------L--------

The even extension of f (t) has the Fourier series

|----------------∞-------(---)---| | a0- ∑ nπ- | | Feven(t) = 2 + an cos L t , | ----------------n=1---------------

where

|--------∫--L-------(----)-----| | a = 2- f(t)cos n-πt dt. | | n L 0 L | -------------------------------

The series ∑ ( ) ∞n=1 bnsin nLπt is called the sine series of f(t) and the series  ∑ ( ) a02-+ ∞n=1an cos nπL t is called the cosine series of f (t) . We often do not actually care what happens outside of [0,L] . In this case, we pick whichever series fits our problem better.

It is not necessary to start with the full Fourier series to obtain the sine and cosine series. The sine series is really the eigenfunction expansion of f(t) using eigenfunctions of the eigenvalue problem x′′ + λx = 0 , x(0 ) = 0 , x (L ) = L . The cosine series is the eigenfunction expansion of f(t) using eigenfunctions of the eigenvalue problem x′′ + λx = 0 , x′(0) = 0 , x′(L) = L . We could have, therefore, gotten the same formulas by defining the inner product

 ∫ L ⟨f (t),g(t)⟩ = f(t)g(t) dt, 0

and following the procedure of § 4.2. This point of view is useful, as we commonly use a specific series that arose because our underlying question led to a certain eigenvalue problem. If the eigenvalue problem is not one of the three we covered so far, you can still do an eigenfunction expansion, generalizing the results of this chapter. We will deal with such a generalization in chapter 5.

Example 4.4.2: Find the Fourier series of the even periodic extension of the function  2 f(t) = t for 0 ≤ t ≤ π .

We want to write

 ∞ a0- ∑ f(t) = 2 + an cos(nt), n=1

where

 2 ∫ π 2π 2 a0 = -- t2 dt =----, π 0 3

and

 2 ∫ π 2 [ 1 ]π 4 ∫ π an = -- t2co s(nt) dt =-- t2-sin(nt) − --- tsin(nt) dt π 0 π∫ n 0 nπ 0 -4-[ ]π -4-- π 4-(−-1)n = n2π tcos(nt)0 + n2π cos(nt) dt = n 2 . 0

Note that we have “detected” the continuity of the extension since the coefficients decay as 1 n2 . That is, the even extension of t2 has no jump discontinuities. It does have corners, since the derivative, which is an odd function and a sine series, has jumps; it has a Fourier series whose coefficients decay only as 1 n .

Explicitly, the first few terms of the series are

π2 4 --− 4 cos(t) + cos(2t) − -co s(3t) + ⋅⋅⋅ 3 9

Exercise 4.4.3: a) Compute the derivative of the even extension of f(t) above and verify it has jump discontinuities. Use the actual definition of f(t) , not its cosine series! b) Why is it that the derivative of the even extension of f(t) is the odd extension of f′(t) ?

4.4.3 Application

Fourier series ties in to the boundary value problems we studied earlier. Let us see this connection in more detail.

Suppose we have the boundary value problem for 0 < t < L ,

 ′′ x (t) + λx (t) = f(t),

for the Dirichlet boundary conditions x(0) = 0 , x(L) = 0 . By using the Fredholm alternative (Theorem 4.1.2), as long as λ is not an eigenvalue of the underlying homogeneous problem, there exists a unique solution. Eigenfunctions of this eigenvalue problem are the functions  (nπ-) sin L t . Therefore, to find the solution, we first find the Fourier sine series for f (t) . We write x also as a sine series, but with unknown coefficients. We substitute the series for x into the equation and solve for the unknown coefficients. If we have the Neumann boundary conditions x′(0) = 0 , x′(L) = 0 , we do the same procedure using the cosine series.

Let us see how this method works on examples.

Example 4.4.3: Take the boundary value problem for 0 < t < 1 ,

 ′′ x (t) + 2x (t) = f(t),

where f (t) = t on 0 < t < 1 , and satisfying the Dirichlet boundary conditions x(0) = 0 , x(1) = 0 . We write f(t) as a sine series

 ∞ ∑ f(t) = cn sin(nπt), n=1

where

 ∫ 1 2(−1)n+1 cn = 2 tsin(nπt) dt =--------. 0 nπ

We write x(t) as

 ∑∞ x(t) = bn sin(nπt). n=1

We plug in to obtain

 ′′ ∑∞ 2 2 ∑∞ x (t) + 2x(t) = − bnn π sin(nπt) + 2 bnsin(nπt) n=1 n=1 ∑∞ = bn(2 − n2π2)sin (nπt) n=1 ∑∞ n+1 = f(t) = 2(−1)---sin(nπt). n=1 nπ

Therefore,

 n+1 b (2 − n2π2) = 2(−-1)--- n nπ

or

 n+1 bn = --2(−1)-----. nπ(2 − n2π2)

We have thus obtained a Fourier series for the solution

 ∞ ∑ --2(−-1)n+1-- x(t) = n π(2 − n2π2) sin(nπt). n=1

Example 4.4.4: Similarly we handle the Neumann conditions. Take the boundary value problem for 0 < t < 1 ,

 ′′ x (t) + 2x (t) = f(t),

where again f(t) = t on 0 < t < 1 , but now satisfying the Neumann boundary conditions x ′(0) = 0 , x′(1) = 0 . We write f(t) as a cosine series

 ∑∞ c0 f(t) = 2 + cncos(nπt), n=1

where

 ∫ 1 c0 = 2 t dt = 1, 0

and

 ∫ 1 ( n ) (|-−4 c = 2 tcos(n πt) dt = 2-(−-1)-−-1--= |{π2n2 if n odd, n 0 π2n2 ||(0 if n even.

We write x(t) as a cosine series

 ∑∞ x(t) = a-0+ a cos(nπt). 2 n n=1

We plug in to obtain

 ∑∞ ∞∑ x′′(t) + 2x(t) = [−a n2π 2cos(nπt)] + a + 2 [a cos(nπt)] n 0 n n=1 ∞ n=1 ∑ 2 2 = a0 + an(2 − n π ) cos(nπt) n=1 1 ∑∞ − 4 = f(t) = -+ -2-2 cos(nπt). 2 n=1 π n n odd

Therefore,  1 a 0 = 2 , an = 0 for n even (n ≥ 2 ) and for n odd we have

 2 2 -−4-- an(2 − n π ) = π2n2,

or

a = -----−-4-----. n n2π2(2 − n 2π 2)

The Fourier series for the solution x(t) is

 ∑∞ x (t) = 1-+ -----−-4------cos(n πt). 4 n=1 n2π2(2 − n2π2) n odd

4.4.4 Exercises

Exercise 4.4.4: Take f(t) = (t − 1)2 defined on 0 ≤ t ≤ 1 . a) Sketch the plot of the even periodic extension of f . b) Sketch the plot of the odd periodic extension of f .

Exercise 4.4.5: Find the Fourier series of both the odd and even periodic extension of the function f (t) = (t − 1 )2 for 0 ≤ t ≤ 1 . Can you tell which extension is continuous from the Fourier series coefficients?

Exercise 4.4.6: Find the Fourier series of both the odd and even periodic extension of the function f (t) = t for 0 ≤ t ≤ π .

Exercise 4.4.7: Find the Fourier series of the even periodic extension of the function f(t) = sin t for 0 ≤ t ≤ π .

Exercise 4.4.8: Consider

 ′′ x (t) + 4x (t) = f(t),

where f (t) = 1 on 0 < t < 1 . a) Solve for the Dirichlet conditions x(0) = 0,x(1) = 0 . b) Solve for the Neumann conditions x′(0) = 0,x′(1 ) = 0 .

Exercise 4.4.9: Consider

 ′′ x (t) + 9x (t) = f(t),

for f (t) = sin(2πt) on 0 < t < 1 . a) Solve for the Dirichlet conditions x(0 ) = 0,x(1) = 0 . b) Solve for the Neumann conditions x′(0) = 0,x′(1) = 0 .

Exercise 4.4.10: Consider

x′′(t) + 3x (t) = f(t), x (0) = 0, x(1) = 0,

where  ∑∞ f (t) = n=1bn sin(nπt) . Write the solution x(t) as a Fourier series, where the coefficients are given in terms of bn .

Exercise 4.4.11: Let  2 f (t) = t(2 − t) for 0 ≤ t ≤ 2 . Let F(t) be the odd periodic extension. Compute F (1) , F (2) , F(3) , F (−1) , F (9∕2) , F (101) , F (103) . Note: Do not compute using the sine series.

Exercise 4.4.101: Let f (t) = t∕3 on 0 ≤ t < 3 . a) Find the Fourier series of the even periodic extension. b) Find the Fourier series of the odd periodic extension.

Exercise 4.4.102: Let f(t) = cos(2t) on 0 ≤ t < π . a) Find the Fourier series of the even periodic extension. b) Find the Fourier series of the odd periodic extension.

Exercise 4.4.103: Let f (t) be defined on 0 ≤ t < 1 . Now take the average of the two extensions g(t) = Fodd(t)+Feven(t) 2 . a) What is g(t) if 0 ≤ t < 1 (Justify!) b) What is g(t) if − 1 < t < 0 (Justify!)

Exercise 4.4.104: Let f(t) = ∑ ∞n=1 12 sin (nt) n . Solve x ′′ − x = f(t) for the Dirichlet conditions x(0) = 0 and x(π) = 0 .

Exercise 4.4.105 (challenging): Let f(t) = t + ∑ ∞-1n sin(nt) n=12 . Solve x′′ + πx = f(t) for the Dirichlet conditions x(0) = 0 and x(π) = 1 . Hint: Note that -t π satisfies the given Dirichlet conditions.