Mathematical Physicsundergraduate

Fourier Series

Also known as: Harmonic decomposition · Trigonometric series · Fourier expansion

Any reasonable periodic function is an infinite weighted sum of sines and cosines (or complex exponentials). The coefficients are the amounts of each pure frequency present — the function's recipe in tones.

f(x)=a02+n=1[ancosnπxL+bnsinnπxL]f(x) = \frac{a_0}{2} + \sum_{n=1}^{\infty}\left[a_n\cos\frac{n\pi x}{L} + b_n\sin\frac{n\pi x}{L}\right]
Live simulation
warming up the physics…

A square wave (faint) is approximated by a sum of odd-harmonic sines. The N slider adds harmonics; the partial sum (cyan) sharpens toward the square edges while the Gibbs overshoot lingers. The whole pattern scrolls so the motion is unmistakable.

Equivalent forms

f(x)=n=cneinπx/Lf(x) = \sum_{n=-\infty}^{\infty} c_n\, e^{i n\pi x/L}
cn=12LLLf(x)einπx/Ldxc_n = \frac{1}{2L}\int_{-L}^{L} f(x)\, e^{-i n\pi x/L}\, dx
an=1LLLf(x)cosnπxLdxa_n = \frac{1}{L}\int_{-L}^{L} f(x)\cos\frac{n\pi x}{L}\,dx
Orthogonality of sines and cosines turns a function into a discrete spectrum — and the same trick diagonalizes the heat, wave, and Schrödinger equations.