Tutorials on Fourier series are presented. In the first part, an example is used to show how Fourier coefficients are calculated, and in the second part, you may use an interactive app to further explore Fourier series of the same function.
In what follows, \( C \) represents the constant of integration where applicable.
Fourier Series and Coefficients
Fourier series may be used to represent periodic functions as a linear combination of sine and cosine functions. If \( f(t) \) is a periodic function of period \( T \), then under certain conditions, its Fourier series is given by:
\[ f(t) = \frac{a_0}{2} + \sum_{n=1}^\infty \left[a_n \cos\left(\frac{2n\pi t}{T}\right) + b_n \sin\left(\frac{2n\pi t}{T}\right)\right] \]where \( n = 1, 2, 3, \ldots \) and \( T \) is the period of function \( f(t) \). \( a_n \) and \( b_n \) are called Fourier coefficients and are given by:
\[ a_0 = \frac{2}{T} \int_0^T f(t) \, dt \] \[ a_n = \frac{2}{T} \int_0^T f(t) \cos\left(\frac{2n\pi t}{T}\right) \, dt \] \[ b_n = \frac{2}{T} \int_0^T f(t) \sin\left(\frac{2n\pi t}{T}\right) \, dt \]Example 1
Find the Fourier series of the periodic function \( f(t) \) defined by:
\[ f(t) = \begin{cases} 1, & \text{for } 0 \leq t < T/2 \\ -1, & \text{for } T/2 \leq t < T \end{cases} \]
Show Solution to Example 1
Coefficient \( a_0 \) is given by:
\[ a_0 = \frac{2}{T} \int_0^{T/2} (1) \, dt + \frac{2}{T} \int_{T/2}^T (-1) \, dt \]Coefficient \( a_n \) is given by:
\[ a_n = \frac{2}{T} \int_0^{T/2} 1 \cdot \cos\left(\frac{2n\pi t}{T}\right) \, dt + \frac{2}{T} \int_{T/2}^T (-1) \cdot \cos\left(\frac{2n\pi t}{T}\right) \, dt \]Coefficient \( b_n \) is given by:
\[ b_n = \frac{2}{T} \int_0^{T/2} 1 \cdot \sin\left(\frac{2n\pi t}{T}\right) \, dt + \frac{2}{T} \int_{T/2}^T (-1) \cdot \sin\left(\frac{2n\pi t}{T}\right) \, dt \]Computing the integrals yields:
\[ a_0 = 0, \quad a_n = 0, \quad \text{and } b_n = \frac{2}{n\pi} (1 - \cos(n\pi)) \]Note that \( \cos(n\pi) = (-1)^n \), meaning \( b_n = 0 \) whenever \( n \) is even.
Thus, the Fourier series for \( f(t) \) is:
\[ f(t) = \sum_{n=1}^\infty \frac{2}{n\pi} (1 - (-1)^n) \sin\left(\frac{2n\pi t}{T}\right) \]Interactive Tutorial on Fourier Series
For numerical calculation purposes, we cannot include an infinite number of terms. We therefore define a partial sum function \( f_N(t) \) with a limited number of terms \( N \):
\[ f_N(t) = \sum_{n=1}^{N} \frac{2}{n\pi} (1 - (-1)^n) \sin\left(\frac{2n\pi t}{T}\right) \]The app below may be used to explore the Fourier series of \( f(t) \) solved in Example 1. Increase \( N \) to see how the graph of \( f_N(t) \) (in blue) converges to the graph of \( f(t) \) (in red).
The default values are \( N = 5 \) and \( T = 4 \). Change \( N \) and \( T \) and click the button to update the plot.
Hover the mouse cursor on the graph or plotted point to read coordinates.