Fourier series

f(t) ∼ a₀/2 + Σ aₙ cos(nωt) + bₙ sin(nωt)

Help

Choose a function from the dropdown. The examples follow the lectures in order, from L08a (period \(2\pi\)) through L10a (complex form), followed by some functions that fail Dirichlet's conditions.

Extension: a function given only on a finite interval \([0, L]\) starts with None: just \(f\) on \([0, L]\), with no Fourier series. Choose Periodic (\(f_p\), \(T = L\)), Even (\(f_e\), \(T = 2L\)) or Odd (\(f_o\), \(T = 2L\)) to extend \(f\) to a periodic function; the extension is drawn dashed. The Fourier series of \(f_p\) is the full-range expansion of \(f\), that of \(f_e\) is the half-range cosine expansion, and that of \(f_o\) is the half-range sine expansion. A function that is already periodic needs no extension.

Terms: the partial sum \(S_N\) includes every harmonic \(n \le N\). Use the slider, the − / + buttons, the ← / → arrow keys, or type \(N\) (up to 2000). ▶ animates \(N\) upwards and ◀ animates it downwards, skipping values of \(N\) whose term is zero; |< and >| jump to \(N = 0\) and \(N = 100\).

Uniform convergence: "ε-band" shades \(f \pm \varepsilon\) and colours \(S_N\) green where it lies inside the band and red where it jumps out.

Heat equation (heat-equation example only): with the Odd extension (ends held at 0) or the Even extension (insulated ends), "Evolve" runs the solution \(u(x,t)\) of \(u_t = u_{xx}\) forward in time from \(u(x, 0) = f(x)\), using the current \(N\) terms. Drag the time slider to move to any \(t\); "Reset" returns to \(t = 0\).

Options: f(t) shows the function; Midpoints marks the value \(\frac12\left(f(t_0^-) + f(t_0^+)\right)\) at each jump; Previous shows faded earlier partial sums; Gibbs marks the overshoot next to each jump; Zoom jump magnifies the first jump; Dirichlet annotates one period and lists the conditions; Explain and Coefficients open more detail; Mean draws the constant term \(\frac{a_0}{2}\), the mean value of \(f\) over a period.

Overview

A periodic function \(f\) with period \(T\) and angular frequency \(\omega = \frac{2\pi}{T}\) has Fourier series

\[ f(t) \sim \frac{a_0}{2} + \sum_{n \ge 1} a_n \cos(n\omega t) + b_n \sin(n\omega t) \] \[ \begin{aligned} n \ge 0 \quad a_n &= \frac{2}{T} \int_0^T f(t) \cos(n\omega t) \, dt \\ n \ge 1 \quad b_n &= \frac{2}{T} \int_0^T f(t) \sin(n\omega t) \, dt \end{aligned} \]

For period \(2\pi\) (\(\omega = 1\)) these become \(a_n = \frac{1}{\pi} \int_0^{2\pi} f(t) \cos(nt) \, dt\) and \(b_n = \frac{1}{\pi} \int_0^{2\pi} f(t) \sin(nt) \, dt\). Any interval of length \(T\) may be used.

Functions on [0, L]

A function given only on \([0, L]\) must first be extended to a periodic function. The Fourier series of the extension is an expansion of \(f\) on \([0, L]\):

\[ \begin{aligned} \text{full-range:} \quad a_n &= \tfrac{2}{T} \textstyle\int_0^T f_p(t) \cos(n\omega t) \, dt, & b_n &= \tfrac{2}{T} \textstyle\int_0^T f_p(t) \sin(n\omega t) \, dt \\[4pt] \text{cosine:} \quad a_n &= \tfrac{4}{T} \textstyle\int_0^{T/2} f_e(t) \cos(n\omega t) \, dt, & b_n &= 0 \\[4pt] \text{sine:} \quad a_n &= 0, & b_n &= \tfrac{4}{T} \textstyle\int_0^{T/2} f_o(t) \sin(n\omega t) \, dt \end{aligned} \]

Dirichlet's conditions

Theorem: If \(f\) is a bounded periodic function that has a finite number of maxima and minima and a finite number of discontinuities over any one-period interval then the Fourier series of \(f\) converges pointwise to \(f(t)\) at all points where \(f(t)\) is continuous, and to the average of the left and right limits where \(f(t)\) is discontinuous:

\[ F(t_0) = \frac{1}{2}\left( f(t_0^-) + f(t_0^+) \right) \]

If the conditions fail, Dirichlet's theorem tells you nothing: do not claim that the series diverges.

Gibbs phenomenon

Near a jump the partial sums overshoot by approximately 9 percent of the size of the jump (precisely \(0.089489872236\ldots\)). As \(N\) increases the spike moves closer to the jump but does not decrease in amplitude. This does not affect pointwise convergence, but it prevents uniform convergence on any interval that includes the discontinuity.

Uniform convergence

\(S_n \to f\) uniformly if for every \(\varepsilon > 0\) there is an \(N\) such that

\[ |S_n(t) - f(t)| < \varepsilon \quad \text{for all } t, \text{ whenever } n > N, \]

i.e. the whole graph of \(S_n\) lies inside the \(\varepsilon\)-band around \(f\). A uniform limit of continuous functions is continuous, which is why a series with a jump can never converge uniformly: next to a jump, \(S_n\) passes through the midpoint, half the jump away from \(f\).

The heat equation

\[ \frac{\partial u}{\partial t} = \alpha \frac{\partial^2 u}{\partial x^2}, \quad x \in [0, L], \qquad u(x, 0) = f(x) \]

Ends held at \(0\), \(u(0,t) = u(L,t) = 0\), go with the half-range sine expansion (odd extension); insulated ends, \(\frac{\partial u}{\partial x}(0,t) = \frac{\partial u}{\partial x}(L,t) = 0\), go with the half-range cosine expansion (even extension). Each harmonic decays at its own rate:

\[ \begin{aligned} \text{ends at } 0\text{:} \quad u(x,t) &= \sum_{n=1}^\infty b_n e^{-\alpha\left(\frac{n\pi}{L}\right)^2 t} \sin\left(\frac{n\pi x}{L}\right) \\ \text{insulated ends:} \quad u(x,t) &= \frac{a_0}{2} + \sum_{n \ge 1} a_n e^{-\alpha\left(\frac{n\pi}{L}\right)^2 t} \cos\left(\frac{n\pi x}{L}\right) \end{aligned} \]

Fourier coefficients

Dirichlet's conditions