Fourier series, explained
A Fourier series writes a periodic function as a sum of sines and cosines. The coefficients say how much of each frequency the function contains. It is the first step towards signals, vibrations and heat conduction.
Why sines and cosines
Over one period, the integral of the product of two different terms, say cos 2x and sin 5x, is zero. That is orthogonality, and it is what makes each coefficient computable on its own: multiply f by one sine or cosine, integrate, and every other term drops out.
Even and odd shortcuts
If f is odd, every a_n is zero and only sines remain. If f is even, every b_n is zero and only cosines remain. Checking symmetry first saves half the integrals, and catches mistakes when a coefficient that should vanish does not.
Jumps and the Gibbs overshoot
At a jump, the series converges to the midpoint of the two sides. Near the jump, every partial sum overshoots by about 9 per cent of the jump height. Adding terms makes the overshoot narrower, never smaller. That is the Gibbs phenomenon, and it is visible in the calculator below with x close to 0.
Worked example
A square wave of height 1 is odd, so only sines appear, and only the odd ones: b₁ = 4/π ≈ 1.273, b₃ = 4/(3π) ≈ 0.424, b₅ ≈ 0.255.
At x = π/2 the partial sums approach 1, the value of the wave there. At x = 0, the jump, every partial sum gives 0, the midpoint between −1 and 1.
Partial sum calculator
S_N(x) for a standard wave on (−π, π)
Common mistakes
- Forgetting the factor of one half on a₀, or using a definition of a₀ that already includes it twice.
- Integrating over (−π, π) when the period is 2L. Then the terms are cos(nπx/L) and sin(nπx/L).
- Spending an integral on a coefficient that symmetry already says is zero.