## Section 4.4 Sine and cosine series

¶### Subsection 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)\text{.}\) A function \(f(t)\) is *even* if \(f(-t) = f(t)\text{.}\) For example, \(\cos (n t)\) is even and \(\sin (n t)\) is odd. Similarly the function \(t^k\) 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)\text{.}\)

Suppose both \(f(t)\) and \(g(t)\) are odd. Is \(h(t)\) odd or even?

Suppose one is even and one is odd. Is \(h(t)\) odd or even?

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)\text{.}\) 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]\text{.}\) 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]\text{.}\) On \((-L,L]\) define the functions

Extend \(F_{\text{odd}}(t)\) and \(F_{\text{even}}(t)\) to be \(2L\)-periodic. Then \(F_{\text{odd}}(t)\) is called the *odd periodic extension* of \(f(t)\text{,}\) and \(F_{\text{even}}(t)\) is called the *even periodic extension* of \(f(t)\text{.}\) For the odd extension we generally assume that \(f(0) = f(L) = 0\text{.}\)

###### Exercise 4.4.2.

Check that \(F_{\text{odd}}(t)\) is odd and \(F_{\text{even}}(t)\) is even. For \(F_{\text{odd}}\text{,}\) assume \(f(0) = f(L) = 0\text{.}\)

###### Example 4.4.1.

Take the function \(f(t) = t\,(1-t)\) defined on \([0,1]\text{.}\) Figure 5.4.4 shows the plots of the odd and even periodic extensions of \(f(t)\text{.}\)

### Subsection 4.4.2 Sine and cosine series

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

That is, there are no cosine terms in the Fourier series of an odd function. The integral is zero because \(f(t) \cos \left( {n \pi}{L} t \right)\) 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]\text{.}\) The function \(f(t) \sin \left( \frac{n \pi}{L} t \right)\) is the product of two odd functions and hence is even.

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

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

The formula still works for \(n=0\text{,}\) in which case it becomes

The Fourier series is then

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]\text{.}\) 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]\text{.}\) Then the odd periodic extension of \(f(t)\) has the Fourier series

where

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

where

We call the series \(\sum_{n=1}^\infty b_n \sin \left( \frac{n \pi}{L} t\right)\) the *sine series* of \(f(t)\) and we call the series \(\frac{a_0}{2} + \sum_{n=1}^\infty a_n \cos \left( \frac{n \pi}{L} t
\right)\) the *cosine series* of \(f(t)\text{.}\) We often do not actually care what happens outside of \([0,L]\text{.}\) 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''+\lambda x = 0\text{,}\) \(x(0) = 0\text{,}\) \(x(L) = L\text{.}\) The cosine series is the eigenfunction expansion of \(f(t)\) using eigenfunctions of the eigenvalue problem \(x''+\lambda x = 0\text{,}\) \(x'(0) = 0\text{,}\) \(x'(L) = L\text{.}\) We could have, therefore, gotten the same formulas by defining the inner product

and following the procedure of Section 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 \(f(t) = t^2\) for \(0 \leq t \leq \pi\text{.}\)

We want to write

where

and

Note that we have “detected” the continuity of the extension since the coefficients decay as \(\frac{1}{n^2}\text{.}\) That is, the even periodic extension of \(t^2\) 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 \(\frac{1}{n}\text{.}\)

Explicitly, the first few terms of the series are

###### Exercise 4.4.3.

Compute the derivative of the even periodic extension of \(f(t)\) above and verify it has jump discontinuities. Use the actual definition of \(f(t)\text{,}\) not its cosine series!

Why is it that the derivative of the even periodic extension of \(f(t)\) is the odd periodic extension of \(f'(t)\text{?}\)

### Subsection 4.4.3 Application

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

Consider the boundary value problem for \(0 < t < L\text{,}\)

for the *Dirichlet boundary conditions* \(x(0) = 0\text{,}\) \(x(L) = 0\text{.}\) The Fredholm alternative (Theorem 4.1.2) says that as long as \(\lambda\) is not an eigenvalue of the underlying homogeneous problem, there exists a unique solution. Eigenfunctions of this eigenvalue problem are the functions \(\sin \left( \frac{n \pi}{L} t \right)\text{.}\) Therefore, to find the solution, we first find the Fourier sine series for \(f(t)\text{.}\) 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\text{,}\) \(x'(L) = 0\text{,}\) 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\text{,}\)

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

Compute

We write \(x(t)\) as

We plug in to obtain

Therefore,

or

That \(2-n^2\pi^2\) is not zero for any \(n\text{,}\) and that we can solve for \(b_n\text{,}\) is precisely because \(2\) is not an eigenvalue of the problem. We have thus obtained a Fourier series for the solution

See Figure 5.4.9 for a graph of the solution. Notice that because the eigenfunctions satisfy the boundary conditions, and \(x\) is written in terms of the boundary conditions, then \(x\) satisfies the boundary conditions.

###### Example 4.4.4.

Similarly we handle the Neumann conditions. Take the boundary value problem for \(0 < t < 1\text{,}\)

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

where

and

We write \(x(t)\) as a cosine series

We plug in to obtain

Therefore, \(a_0 = \frac{1}{2}\text{,}\) \(a_n = 0\) for \(n\) even (\(n \geq 2\)) and for \(n\) odd we have

or

The Fourier series for the solution \(x(t)\) is

### Subsection 4.4.4 Exercises

###### Exercise 4.4.4.

Take \(f(t) = {(t-1)}^2\) defined on \(0 \leq t \leq 1\text{.}\)

Sketch the plot of the even periodic extension of \(f\text{.}\)

Sketch the plot of the odd periodic extension of \(f\text{.}\)

###### 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 \leq t \leq 1\text{.}\) 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 \leq t \leq \pi\text{.}\)

###### Exercise 4.4.7.

Find the Fourier series of the even periodic extension of the function \(f(t) = \sin t\) for \(0 \leq t \leq \pi\text{.}\)

###### Exercise 4.4.8.

Consider

where \(f(t) = 1\) on \(0 < t < 1\text{.}\)

Solve for the Dirichlet conditions \(x(0)=0, x(1) = 0\text{.}\)

Solve for the Neumann conditions \(x'(0)=0, x'(1) = 0\text{.}\)

###### Exercise 4.4.9.

Consider

for \(f(t) = \sin (2\pi t)\) on \(0 < t < 1\text{.}\)

Solve for the Dirichlet conditions \(x(0)=0, x(1) = 0\text{.}\)

Solve for the Neumann conditions \(x'(0)=0, x'(1) = 0\text{.}\)

###### Exercise 4.4.10.

Consider

where \(f(t) = \sum_{n=1}^\infty b_n \sin (n \pi t)\text{.}\) Write the solution \(x(t)\) as a Fourier series, where the coefficients are given in terms of \(b_n\text{.}\)

###### Exercise 4.4.11.

Let \(f(t) = t^2(2-t)\) for \(0 \leq t \leq 2\text{.}\) Let \(F(t)\) be the odd periodic extension. Compute \(F(1)\text{,}\) \(F(2)\text{,}\) \(F(3)\text{,}\) \(F(-1)\text{,}\) \(F(\nicefrac{9}{2})\text{,}\) \(F(101)\text{,}\) \(F(103)\text{.}\) Note: Do *not* compute using the sine series.

###### Exercise 4.4.101.

Let \(f(t) = \nicefrac{t}{3}\) on \(0 \leq t < 3\text{.}\)

Find the Fourier series of the even periodic extension.

Find the Fourier series of the odd periodic extension.

a) \(\nicefrac{1}{2} + \sum\limits_{\substack{n=1\\n\text{ odd}}}^\infty \frac{-4}{\pi^2 n^2} \cos\bigl(\frac{n\pi}{3} t \bigr)\) b) \(\sum\limits_{n=1}^\infty \frac{2{(-1)}^{n+1}}{\pi n} \sin\bigl(\frac{n\pi}{3} t \bigr)\)

###### Exercise 4.4.102.

Let \(f(t) = \cos(2t)\) on \(0 \leq t < \pi\text{.}\)

Find the Fourier series of the even periodic extension.

Find the Fourier series of the odd periodic extension.

a) \(\cos(2t)\) b) \(\sum\limits_{\substack{n=1 \\n \text{ odd}}}^\infty \frac{-4n}{\pi n^2 - 4 \pi} \sin(n t)\)

###### Exercise 4.4.103.

Let \(f(t)\) be defined on \(0 \leq t < 1\text{.}\) Now take the average of the two extensions \(g(t) = \frac{F_{\text{odd}}(t)+ F_{\text{even}}(t)}{2}\text{.}\)

What is \(g(t)\) if \(0 \leq t < 1\) (Justify!)

What is \(g(t)\) if \(-1 < t < 0\) (Justify!)

a) \(f(t)\) b) \(0\)

###### Exercise 4.4.104.

Let \(f(t) = \sum_{n=1}^\infty \frac{1}{n^2} \sin(nt)\text{.}\) Solve \(x''- x = f(t)\) for the Dirichlet conditions \(x(0) = 0\) and \(x(\pi) = 0\text{.}\)

\(\sum\limits_{n=1}^\infty \frac{-1}{n^2(1+n^2)} \sin(nt)\)

###### Exercise 4.4.105.

*(challenging)* Let \(f(t) = t + \sum_{n=1}^\infty \frac{1}{2^n} \sin(nt)\text{.}\) Solve \(x'' + \pi x = f(t)\) for the Dirichlet conditions \(x(0) = 0\) and \(x(\pi) = 1\text{.}\) Hint: Note that \(\frac{t}{\pi}\) satisfies the given Dirichlet conditions.

\(\frac{t}{\pi} + \sum\limits_{n=1}^\infty \frac{1}{2^n(\pi-n^2)} \sin(nt)\)