MA 30300: Differential Equations

9.1-9.2. Fourier Series (theory)

Goal: Understand how a periodic function can be expressed as a sum of sine and cosine functions. Learn where the Fourier coefficient formulas come from and how Fourier series work for even and odd functions. Explore the convergence theorem and use Fourier series to prove mathematical identities.


Motivation: Why Fourier Series?

Many functions in science and engineering are periodic, meaning: \[ f(x + 2L) = f(x) \]

The key idea of Fourier series is: Any reasonable periodic function can be built from sine and cosine waves.

Fourier Series Formula

\[ f(x) \sim \frac{a_0}{2} + \sum_{n=1}^{\infty} \left[ a_n \cos\left(\frac{n\pi x}{L}\right) + b_n \sin\left(\frac{n\pi x}{L}\right) \right] \]

This represents \( f(x) \) as an infinite sum of waves with different frequencies.

\[ a_0 = \frac{1}{L} \int_{-L}^{L} f(x)\,dx \]
\[ a_n = \frac{1}{L} \int_{-L}^{L} f(x)\cos\left(\frac{n\pi x}{L}\right)\,dx \]
\[ b_n = \frac{1}{L} \int_{-L}^{L} f(x)\sin\left(\frac{n\pi x}{L}\right)\,dx \]

These integrals measure how much of each sine and cosine wave is present in \( f(x) \).

Interpretation

Each term in the Fourier series represents a wave:

  • Low \( n \): slow oscillations
  • High \( n \): rapid oscillations

Adding more terms improves the approximation of \( f(x) \).

Where Do These Formulas Come From?

The Fourier series formula for a \(2L\)-periodic function comes from two key ideas: periodicity and orthogonality of sine and cosine functions.

1. Why period \(2L\)?

If a function satisfies

\[ f(x + 2L) = f(x), \]

then its building blocks should also have the same period.

The functions

\[ \cos\left(\frac{n\pi x}{L}\right), \quad \sin\left(\frac{n\pi x}{L}\right) \]

have period \(2L\), because:

\[ \cos\left(\frac{n\pi(x+2L)}{L}\right) = \cos\left(\frac{n\pi x}{L} + 2n\pi\right) = \cos\left(\frac{n\pi x}{L}\right). \]

So these are the natural “building blocks” for \(2L\)-periodic functions.

2. Orthogonality and Length of Sine and Cosine Functions (Key Property)

The functions \( \{ 1, \cos(\frac{n\pi x}{L}), \sin(\frac{n\pi x}{L}) \} \) form a pairwise orthogonal set on the interval \( [-L, L] \).

Orthogonality relations:

\[ \int_{-L}^{L} \cos\left(\frac{n\pi x}{L}\right) \cos\left(\frac{m\pi x}{L}\right) dx = 0, \quad n \ne m \]
\[ \int_{-L}^{L} \sin\left(\frac{n\pi x}{L}\right) \sin\left(\frac{m\pi x}{L}\right) dx = 0, \quad n \ne m \]
\[ \int_{-L}^{L} \sin\left(\frac{n\pi x}{L}\right) \cos\left(\frac{m\pi x}{L}\right) dx = 0 \]

Norms (lengths) of the functions:

\[ \int_{-L}^{L} \cos^2\left(\frac{n\pi x}{L}\right) dx = L, \quad \int_{-L}^{L} \sin^2\left(\frac{n\pi x}{L}\right) dx = L, \quad \int_{-L}^{L} 1^2 dx = 2L \]

3. Extracting Coefficients (Core Idea)

Multiply both sides of the Fourier series by \( \cos\left(\frac{m\pi x}{L}\right) \) and integrate over \( [-L, L] \).

By orthogonality, almost all terms vanish, leaving:

\[ \int_{-L}^{L} f(x)\cos\left(\frac{m\pi x}{L}\right)\,dx = a_m \cdot L \]

So we obtain:

\[ a_m = \frac{1}{L} \int_{-L}^{L} f(x)\cos\left(\frac{m\pi x}{L}\right)\,dx \]

Similarly:

\[ b_m = \frac{1}{L} \int_{-L}^{L} f(x)\sin\left(\frac{m\pi x}{L}\right)\,dx \]
\[ a_0 = \frac{1}{L} \int_{-L}^{L} f(x)\,dx \]

Conclusion: The Fourier coefficients come from projecting \( f(x) \) onto sine and cosine functions, just like taking dot products in linear algebra.

Important Observations: Even and Odd Functions

If \( f(x) \) is even:

\[ b_n = 0 \]

If \( f(x) \) is odd:

\[ a_n = 0 \]

This simplifies calculations significantly.

In practice, it is not possible to use infinitely many terms of a Fourier series. For example, a device that processes a periodic signal may compute its Fourier series, modify the sinusoidal components, and then reconstruct the signal. Such a device can only use a finite number of terms.

When the signal has a jump discontinuity, an important effect called Gibbs phenomenon occurs. Near the discontinuity, the partial sums of the Fourier series exhibit oscillations that produce an overshoot. This overshoot does not disappear as more terms are added; instead, it approaches approximately \(9\%\) of the size of the jump.

Example

Let \( f(x) \) be the \(2\pi\)-periodic function defined by

\[ f(x) = \begin{cases} 1, & 0 < x < \pi, \\ -1, & -\pi < x < 0. \end{cases} \]

Its Fourier series is given by

\[ f(x) \sim \frac{4}{\pi} \sum_{n=1,3,5,\dots}^{\infty} \frac{1}{n} \sin(nx). \]
Graph of a partial sum of the Fourier series of the square-wave function.
Graph of a partial sum of the Fourier series of the square-wave function. Check out this desmos graph.

The partial sums \(S_N(x)\) of this series approximate \( f(x) \). Note that as \(x\) approaches a discontinuity of \( f(x) \) from either side, the value of \(S_N(x)\) tends to overshoot the limiting value of \( f(x) \)— either 1 or −1 in this case. This behavior of a Fourier series near a point of discontinuity of its function is typical and is known as Gibbs phenomenon.

If \( f(x) \) is periodic and piecewise smooth, its Fourier series converges to:

  1. \( f(x) \) at points where \( f \) is continuous.
  2. and at a point of discontinuity \( x_0\):
    \[ \frac{f(x_0^+) + f(x_0^-)}{2}. \]

Example

Let \(f(t)\) be the \(2\pi\)-periodic function defined over one period by

\[ f(t) = \begin{cases} 0, & -\pi < t \le 0, \\ t, & 0 < t \le \pi. \end{cases} \]

Let \(\mathcal{F}(t)\) denote the Fourier series of \(f(t)\). Compute

\[ \mathcal{F}(0) + \mathcal{F}(\pi). \]

Solution:

We use the Fourier series convergence theorem.

Step 1: Evaluate at \(t=0\)

\(f\) is continuous at \(0\):

\[ \mathcal{F}(0) = f(0) = 0 \]

Step 2: Evaluate at \(t=\pi\)

\(f\) is discontinuous at \(\pi\) (jump):

\[ f(\pi^-) = \pi, \quad f(\pi^+) = f(-\pi^+) = 0 \implies \mathcal{F}(\pi) = \frac{\pi + 0}{2} = \frac{\pi}{2} \]

Step 3: Sum the values

\[ \mathcal{F}(0) + \mathcal{F}(\pi) = 0 + \frac{\pi}{2} = \frac{\pi}{2} \]

Answer:

\[ \mathcal{F}(0) + \mathcal{F}(\pi) = \frac{\pi}{2} \]

Example

Let \( f(x) = |x| \) defined on \( (-\pi, \pi) \) and extended periodically with period \( 2\pi \). Use its Fourier series to compute the sum:

\[ \sum_{n=1,3,5,\dots}^{\infty} \frac{1}{n^2}. \]

Step 1: Recognize function type

\(f(x) = |x|\) is even, so its Fourier series contains only cosines:

\[ f(x) \sim \frac{a_0}{2} + \sum_{n=1}^{\infty} a_n \cos(nx), \quad a_0 = \frac{1}{\pi} \int_{-\pi}^{\pi} |x| dx, \quad a_n = \frac{1}{\pi} \int_{-\pi}^{\pi} |x| \cos(nx) dx \]

Step 2: Compute \(a_0\)

\[ a_0 = \frac{1}{\pi} \left( \int_{-\pi}^{0} -x dx + \int_{0}^{\pi} x dx \right) = \frac{1}{\pi} (\frac{\pi^2}{2} + \frac{\pi^2}{2}) = \pi \]

Step 3: Compute \(a_n\)

Use symmetry: \(|x|\) is even, so double the integral from 0 to \(\pi\):

\[ a_n = \frac{2}{\pi} \int_0^\pi x \cos(nx) dx \]

Integration by parts:

\[ \int_0^\pi x \cos(nx) dx = \frac{x \sin(nx)}{n} \Big|_0^\pi - \frac{1}{n} \int_0^\pi \sin(nx) dx = - \frac{1 - (-1)^n}{n^2} \]
\[ a_n = \frac{2}{\pi} \cdot \left(- \frac{1 - (-1)^n}{n^2}\right) = -\frac{2}{\pi} \cdot \frac{1 - (-1)^n}{n^2} \]

Step 4: Simplify for odd \(n\)

For odd \(n\), \((-1)^n = -1\), so:

\[ a_n = -\frac{4}{\pi n^2}, \quad n = 1,3,5,\dots \]

Step 5: Evaluate series at \(x = 0\)

Fourier series at \(x=0\):

\[ f(0) = 0 = \frac{a_0}{2} + \sum_{n=1,3,5,\dots} a_n \cos(0) = \frac{\pi}{2} + \sum_{n=1,3,5,\dots} \left(-\frac{4}{\pi n^2}\right) \]

Step 6: Solve for the sum

\[ 0 = \frac{\pi}{2} - \frac{4}{\pi} \sum_{n=1,3,5,\dots}^{\infty} \frac{1}{n^2} \quad \Rightarrow \quad \sum_{n=1,3,5,\dots}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{8} \]

Answer:

\[ \boxed{\sum_{n=1,3,5,\dots}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{8}} \]