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,… 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 3 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 f be a function with period 2π (so f(x+2π)=f(x) for all x), integrable on [−π,π]. Its Fourier series is f(x)∼2a0+∑n=1∞(ancosnx+bnsinnx), and the partial sumSNf(x)=2a0+∑n=1N(ancosnx+bnsinnx) is the best approximation to f built from only the first N harmonics. The symbol ∼ is deliberate: whether the series actually converges back to f(x) is a separate question, addressed further down.
These formulas are not pulled out of thin air. The functions 1,cosx,sinx,cos2x,sin2x,… are orthogonal on [−π,π]: the integral of the product of two different ones is 0, while ∫−ππcos2nxdx=∫−ππsin2nxdx=π for n≥1. Multiplying the series for f by cosmx and integrating term by term makes every term vanish except the one matching m, which isolates am — exactly the trick used to find coordinates with respect to an orthonormal basis in a vector space, except the "vectors" here are functions.
Find the Fourier series of the 2π-periodic square wave f(x)=1 for 0<x<π and f(x)=−1 for −π<x<0.
Solution
Since f is odd, an=0 for all n. For bn: bn=π1∫−ππf(x)sinnxdx=π2∫0πsinnxdx=nπ2(1−cosnπ). This is 0 when n is even, and nπ4 when n is odd. So f(x)∼π4∑k=0∞2k+1sin((2k+1)x)=π4(sinx+3sin3x+5sin5x+⋯).
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 25 harmonics. The approximation is much sharper, but right next to the jump it still overshoots the target value by about 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 f has Fourier coefficients an,bn, then π1∫−ππ∣f(x)∣2dx=2a02+∑n=1∞(an2+bn2).
Why is it true?
This is exactly the Pythagorean theorem in the infinite-dimensional space of periodic functions: since 1,cosnx,sinnx are orthogonal, the "squared length" ∫∣f∣2 of f 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 using the series for f and integrate term by term over [−π,π]. By orthogonality, ∫cosnxcosmx=∫sinnxsinmx=0 for n=m and ∫cosnxsinmx=0 always, so only the "diagonal" terms an2∫cos2nx=an2π, bn2∫sin2nx=bn2π, and (a0/2)2∫1=a02π/2 survive; dividing by π gives the stated formula.
Example: The Basel problem from Parseval's identity
Apply Parseval's identity to the sawtooth wave f(x)=x on (−π,π], extended periodically, to evaluate ∑n=1∞n21 — the [Basel problem](/problems/basel-problem).
Solution
Since f is odd, an=0; a short computation gives bn=π2∫0πxsinnxdx=n2(−1)n+1. Parseval's identity reads π1∫−ππx2dx=∑n=1∞bn2. The left side is π1⋅32π3=32π2, and the right side is ∑n=1∞n24=4∑n=1∞n21. Equating and solving gives ∑n=1∞n21=6π2 — the value Leonhard Euler first announced in 1735 by a completely different, more delicate argument using the infinite product for sinx; this Fourier-analytic derivation came later, once the theory was made rigorous.
AdvancedDoes the series actually converge back to f?
In the sense of Parseval's identity — convergence in average squared error, called L2 convergence — the answer is always yes, for any f with ∫∣f∣2<∞. Pointwise convergence, at a specific x, is far more delicate. Dirichlet proved in 1829 that SNf(x)→f(x) whenever f 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(−π,π), then SNf(x)→f(x) for almost every x (Hunt extended this in 1968 to every f∈Lp with p>1).
Why is it true?
Kolmogorov's counterexample lives in L1, the largest space where the Fourier coefficients still make sense; Carleson's theorem (1966) shows the trouble genuinely disappears as soon as f has finite energy (L2). The proof does not exhibit convergence directly — it controls the maximal partial sum supN∣SNf(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π, the Fourier coefficient a0 is defined as
If f is an odd function (that is, f(−x)=−f(x)), which Fourier coefficients automatically vanish?
The Gibbs phenomenon says that near a jump discontinuity, the partial sums SNf
Using Parseval's identity on the Fourier series of f(x)=x on (−π,π], the sum ∑n=1∞n21 equals