Fourier's theorem states that any periodic function can be decomposed into a sum of sine and cosine waves at integer multiples (harmonics) of a fundamental frequency. A square wave requires only odd harmonics with amplitudes 1/n, while a sawtooth uses all harmonics at 1/n, and a triangle wave uses odd harmonics at 1/n². As you add more harmonics, the approximation sharpens — the persistent overshoot near discontinuities is the famous Gibbs phenomenon (~9% regardless of harmonic count). This principle underlies JPEG compression, audio synthesis, and quantum mechanics.