MathLabs

Analysis

Fourier series

Almost any periodic wave, however jagged, can be built by adding up pure sine and cosine tones of increasing frequency. The subtle part is not the construction — it is knowing in what sense the infinite sum comes back to the original wave.

IntuitionBuilding a wave out of pure tones

A musical tone from a tuning fork is a pure sine wave. A tone from a violin, with the same pitch, sounds completely different — because it is really a sum of the fundamental frequency plus quieter harmonics at 2,3,4,…2, 3, 4, \dots times that frequency, in proportions that give the violin its timbre. Joseph Fourier's radical idea (1807) was that this is not special to musical instruments: almost any periodic signal, including one with sharp corners or jumps like a square wave, can be written as a sum of sines and cosines whose frequencies are whole-number multiples of a single base frequency.

Graph of a square wave together with the sum of its first three odd sine harmonics, which already traces a rough approximation of the square shape.
A square wave approximated by just 33 sine harmonics. Each added harmonic bends the wiggly curve a little closer to the sharp corners of the square wave.

UndergraduateFourier coefficients: finding the amplitudes

Definition: Fourier series

Let ff be a function with period 2π2\pi (so f(x+2π)=f(x)f(x+2\pi)=f(x) for all xx), integrable on [−π,π][-\pi,\pi]. Its Fourier series is f(x)∼a02+∑n=1∞(ancos⁡nx+bnsin⁡nx)f(x) \sim \frac{a_0}{2} + \sum_{n=1}^{\infty}\left(a_n\cos nx + b_n\sin nx\right), and the partial sum SNf(x)=a02+∑n=1N(ancos⁡nx+bnsin⁡nx)S_N f(x) = \frac{a_0}{2} + \sum_{n=1}^{N}\left(a_n\cos nx + b_n\sin nx\right) is the best approximation to ff built from only the first NN harmonics. The symbol ∼\sim is deliberate: whether the series actually converges back to f(x)f(x) is a separate question, addressed further down.

an=1π∫−ππf(x)cos⁡nx dx (n≥0),bn=1π∫−ππf(x)sin⁡nx dx (n≥1)a_n = \frac{1}{\pi}\int_{-\pi}^{\pi} f(x)\cos nx\,dx\ (n\ge 0), \qquad b_n = \frac{1}{\pi}\int_{-\pi}^{\pi} f(x)\sin nx\,dx\ (n\ge 1)

These formulas are not pulled out of thin air. The functions 1,cos⁡x,sin⁡x,cos⁡2x,sin⁡2x,…1,\cos x,\sin x,\cos 2x,\sin 2x,\dots are orthogonal on [−π,π][-\pi,\pi]: the integral of the product of two different ones is 00, while ∫−ππcos⁡2nx dx=∫−ππsin⁡2nx dx=π\int_{-\pi}^{\pi}\cos^2 nx\,dx = \int_{-\pi}^{\pi}\sin^2 nx\,dx = \pi for n≥1n\ge1. Multiplying the series for ff by cos⁡mx\cos mx and integrating term by term makes every term vanish except the one matching mm, which isolates ama_m — exactly the trick used to find coordinates with respect to an orthonormal basis in a vector space, except the "vectors" here are functions.

f(x)∼∑n=−∞∞f^(n) einx,f^(n)=12π∫−ππf(x) e−inx dxf(x) \sim \sum_{n=-\infty}^{\infty} \hat f(n)\, e^{inx}, \qquad \hat f(n) = \frac{1}{2\pi}\int_{-\pi}^{\pi} f(x)\, e^{-inx}\, dx

Example: The Fourier series of a square wave

Find the Fourier series of the 2π2\pi-periodic square wave f(x)=1f(x) = 1 for 0<x<π0 < x < \pi and f(x)=−1f(x) = -1 for −π<x<0-\pi < x < 0.

Solution

Since ff is odd, an=0a_n=0 for all nn. For bnb_n: bn=1π∫−ππf(x)sin⁡nx dx=2π∫0πsin⁡nx dx=2nπ(1−cos⁡nπ)b_n = \frac{1}{\pi}\int_{-\pi}^{\pi} f(x)\sin nx\,dx = \frac{2}{\pi}\int_0^\pi \sin nx\,dx = \frac{2}{n\pi}\left(1-\cos n\pi\right). This is 00 when nn is even, and 4nπ\frac{4}{n\pi} when nn is odd. So f(x)∼4π∑k=0∞sin⁡((2k+1)x)2k+1=4π(sin⁡x+sin⁡3x3+sin⁡5x5+⋯ )f(x) \sim \frac{4}{\pi}\sum_{k=0}^{\infty} \frac{\sin\left((2k+1)x\right)}{2k+1} = \frac{4}{\pi}\left(\sin x + \frac{\sin 3x}{3} + \frac{\sin 5x}{5} + \cdots\right).

Graph of a square wave and its 25-harmonic Fourier approximation, showing fine ripples throughout and a persistent overshoot spike just past each jump discontinuity.
The same square wave with 2525 harmonics. The approximation is much sharper, but right next to the jump it still overshoots the target value by about 9%9\% of the jump's height — no matter how many harmonics are added. This persistent overshoot is the Gibbs phenomenon.

UndergraduateParseval's identity: conservation of energy

If ff has Fourier coefficients an,bna_n, b_n, then 1π∫−ππ∣f(x)∣2 dx=a022+∑n=1∞(an2+bn2)\frac{1}{\pi}\int_{-\pi}^{\pi} |f(x)|^2\,dx = \frac{a_0^2}{2} + \sum_{n=1}^{\infty}\left(a_n^2 + b_n^2\right).

Why is it true?

This is exactly the Pythagorean theorem in the infinite-dimensional space of periodic functions: since 1,cos⁡nx,sin⁡nx1,\cos nx,\sin nx are orthogonal, the "squared length" ∫∣f∣2\int |f|^2 of ff splits into the sum of the squared lengths of its components along each direction, with no cross terms surviving the integration.

Proof

Expand ∣f(x)∣2|f(x)|^2 using the series for ff and integrate term by term over [−π,π][-\pi,\pi]. By orthogonality, ∫cos⁡nxcos⁡mx=∫sin⁡nxsin⁡mx=0\int \cos nx\cos mx = \int \sin nx\sin mx = 0 for n≠mn\ne m and ∫cos⁡nxsin⁡mx=0\int \cos nx\sin mx = 0 always, so only the "diagonal" terms an2∫cos⁡2nx=an2πa_n^2\int\cos^2 nx = a_n^2\pi, bn2∫sin⁡2nx=bn2πb_n^2\int\sin^2 nx = b_n^2\pi, and (a0/2)2∫1=a02π/2(a_0/2)^2\int 1 = a_0^2\pi/2 survive; dividing by π\pi gives the stated formula.

Example: The Basel problem from Parseval's identity

Apply Parseval's identity to the sawtooth wave f(x)=xf(x) = x on (−π,π](-\pi, \pi], extended periodically, to evaluate ∑n=1∞1n2\sum_{n=1}^{\infty} \frac{1}{n^2} — the [Basel problem](/problems/basel-problem).

Solution

Since ff is odd, an=0a_n=0; a short computation gives bn=2π∫0πxsin⁡nx dx=2(−1)n+1nb_n = \frac{2}{\pi}\int_0^\pi x\sin nx\,dx = \frac{2(-1)^{n+1}}{n}. Parseval's identity reads 1π∫−ππx2 dx=∑n=1∞bn2\frac{1}{\pi}\int_{-\pi}^{\pi} x^2\,dx = \sum_{n=1}^{\infty} b_n^2. The left side is 1π⋅2π33=2π23\frac{1}{\pi}\cdot\frac{2\pi^3}{3} = \frac{2\pi^2}{3}, and the right side is ∑n=1∞4n2=4∑n=1∞1n2\sum_{n=1}^{\infty} \frac{4}{n^2} = 4\sum_{n=1}^{\infty}\frac{1}{n^2}. Equating and solving gives ∑n=1∞1n2=π26\sum_{n=1}^{\infty} \frac{1}{n^2} = \frac{\pi^2}{6} — the value Leonhard Euler first announced in 1735 by a completely different, more delicate argument using the infinite product for sin⁡x\sin x; this Fourier-analytic derivation came later, once the theory was made rigorous.

AdvancedDoes the series actually converge back to ff?

In the sense of Parseval's identity — convergence in average squared error, called L2L^2 convergence — the answer is always yes, for any ff with ∫∣f∣2<∞\int |f|^2 < \infty. Pointwise convergence, at a specific xx, is far more delicate. Dirichlet proved in 1829 that SNf(x)→f(x)S_N f(x) \to f(x) whenever ff is piecewise smooth (and at a jump, the series converges to the average of the left and right limits). It was widely believed this should extend to every continuous function, until du Bois-Reymond constructed a continuous function whose Fourier series diverges at a single point (1873). Kolmogorov went further in 1923, building an integrable function whose Fourier series diverges everywhere.

If f∈L2(−π,π)f \in L^2(-\pi,\pi), then SNf(x)→f(x)S_N f(x) \to f(x) for almost every xx (Hunt extended this in 1968 to every f∈Lpf \in L^p with p>1p > 1).

Why is it true?

Kolmogorov's counterexample lives in L1L^1, the largest space where the Fourier coefficients still make sense; Carleson's theorem (1966) shows the trouble genuinely disappears as soon as ff has finite energy (L2L^2). The proof does not exhibit convergence directly — it controls the maximal partial sum sup⁡N∣SNf(x)∣\sup_N |S_N f(x)| using a delicate time-frequency decomposition of the function into localized wave packets.

Proof

The full argument is considered one of the hardest proofs in twentieth-century analysis and is well beyond this page; Charles Fefferman gave a more transparent (though still technical) version in 1973 using a combinatorial argument on time-frequency "tiles". The topic [Harmonic analysis](/giai-tich-dieu-hoa) sketches the underlying picture.

For a function of period 2π2\pi, the Fourier coefficient a0a_0 is defined as

If ff is an odd function (that is, f(−x)=−f(x)f(-x)=-f(x)), which Fourier coefficients automatically vanish?

The Gibbs phenomenon says that near a jump discontinuity, the partial sums SNfS_N f

Using Parseval's identity on the Fourier series of f(x)=xf(x)=x on (−π,π](-\pi,\pi], the sum ∑n=1∞1n2\sum_{n=1}^{\infty} \frac{1}{n^2} equals

References

  1. Joseph Fourier (1822). Théorie analytique de la chaleur · DOI:10.1017/cbo9780511693229
  2. Elias M. Stein, Rami Shakarchi (2003). Fourier Analysis: An Introduction
  3. T. W. Körner (1988). Fourier Analysis
  4. Lennart Carleson (1966). On convergence and growth of partial sums of Fourier series