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, \(\cos{(nt)}\) is even and \(\sin{(nt)}\) is odd. Similarly the function \(t^k\) is even if \(k\) is even and odd when \(k\) is odd.
Exercise \(\PageIndex{1}\)
Take two functions \(f(t)\) and \(g(t)\) and define their product \(h(t) =f(t)\,g(t)\).
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 oreven?
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 will 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
Extend \(F_{odd}(t)\) and \(F_{even}(t)\) to be \(2L\)-periodic. Then \(F_{odd}(t)\) is called the odd periodic extension of \(f(t)\), and \(F_{even}(t)\) is called the even periodic extension of \(f(t)\). For the odd extension we generally assume that \(f(0)=f(L)=0\).
Exercise \(\PageIndex{2}\)
Check that \(F_{odd}(t)\) is odd and that \(F_{even}(t)\) is even. For \(F_{odd}\), assume \(f(0)=f(L)=0\).
Example \(\PageIndex{1}\)
Take the function \(f(t) = t(1-t)\) defined on \([0,1]\). Figure \(\PageIndex{1}\) shows the plots of the odd and even extensions of \(f(t)\).
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
That is, there are no cosine terms in the Fourier series of an odd function. The integral is zero because \( f(t) \cos{(\frac{n\pi}{L}t)}\) 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 \(f(t) \sin{(\frac{n\pi}{L}t)}\) is the product of two odd functions and hence is even.
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 \(\PageIndex{1}\)
Let \(f(t)\) be a piecewise smooth function defined on \([0,L]\). Then the odd periodic extension of \(f(t)\) has the Fourier series
The series \( \sum_{n=1}^{\infty} b_n \sin{\left(\dfrac{n\pi}{L}t\right)}\) is called the sine series of \(f(t)\) and the series \( \dfrac{a_0}{2} + \sum_{n=1}^{\infty} a_n \cos{\left(\dfrac{n\pi}{L}t\right)}\) 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''+\lambda 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''+\lambda x=0\), \(x'(0)=0\), \(x'(L)=L\). We could have, therefore, gotten the same formulas by defining the inner produ
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 \(\PageIndex{2}\)
Find the Fourier series of the even periodic extension of the function \( f(t)= t^2\) for \( 0 \leq t \leq \pi\).
Solution
We want to write \[ f(t) = \frac{a_0}{2} + \sum_{n=1}^{\infty} a_n \cos(nt), \nonumber \] where \[ a_0= \frac{2}{\pi} \int_0^{\pi}t^2dt= \frac{2 \pi^2}{3}, \nonumber \] and
Note that we have “detected” the continuity of the extension since the coefficients decay as \(\frac{1}{n^2}\). That is, the even 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}\).
Compute the derivative of the even extension of \(f(t)\) above and verify it hasjump discontinuities. Use the actual definition of \(f(t)\), not its cosine series!
Why is it that thederivative of the even extension of \(f(t)\) is the odd extension of \(f'(t)\)?
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) + \lambda x(t) = f(t), \nonumber \]
for the Dirichlet boundary conditions \(x(0) = 0, x(L)=0\). By using the Fredholm alternative (Theorem 4.1.2) we note that as long as \(\lambda\) is not an eigenvalue of the underlying homogeneous problem, there exists a unique solution. Note that the eigenfunctions of this eigenvalue problem are the functions \(\sin{\left(\frac{n\pi}{L}t\right)}\). 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\) and \(x'(L)=0\), we do the same procedure using the cosine series.
Let us see how this method works on examples.
Example \(\PageIndex{3}\)
Take the boundary value problem for \(0<t<1\),
\[x''(t) + 2x(t) = f(t), \nonumber \]
where \(f(t)=t\) on \(0<t<1\), and satisfying the Dirichlet boundary conditions \(x(0) = 0\) and \(x(1)=0\). We write \(f(t)\) as a sine series
That \(2-n^{2}\pi ^{2}\) is not zero for any \(n\), and that we can solve for \(b_{n}\), is precisely because \(2\) is not an eigenvale of the problem. We have thus obtained a Fourier series for the solution
See Figure \(\PageIndex{2}\) 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 \(\PageIndex{4}\)
Similarly we handle the Neumann conditions. Take the boundary value problem for \(0<t<1\),
\[x''(t) + 2x(t) = f(t), \nonumber \]
where again \(f(t)=t\) on \(0<t<1\), but now satisfying the Neumann boundary conditions \(x'(0) = 0\) and \(x'(1)=0\). We write \(f(t)\) as a cosine series