☰ Course contents
Mathematics 🎓 University Year 1 Fourier Series: Every Wave is a Sum of Pure Tones
🎓 University Year 1 · Lesson 2 of 15

Fourier Series: Every Wave is a Sum of Pure Tones

Any repeating signal — even a jagged square wave — is a stack of smooth sines and cosines, and integration tells you exactly how much of each to use.

University Year 1Calculus II / Linear Algebra
Fourier Series: Every Wave is a Sum of Pure Tones — illustration
💡
The big idea: Where a Taylor series builds a function from powers of x, a Fourier series builds a <em>periodic</em> function from sines and cosines. Because those waves are mutually &ldquo;orthogonal,&rdquo; each one&rsquo;s amount can be measured independently with a single integral. Stacking enough harmonics reproduces any reasonable periodic signal &mdash; square waves, sawtooths, the vibration of a string &mdash; from pure tones.
🎯 By the end, you'll be able to
  • Write the Fourier series of a 2π-periodic function with its aₙ and bₙ coefficients
  • Explain how orthogonality of sines and cosines isolates each coefficient
  • Identify why odd functions need only sines and even functions only cosines
  • Describe the Gibbs overshoot near a jump discontinuity
📎 You should already know
  • Definite integrals
  • Sine and cosine as periodic functions
  • Series and partial sums

A different set of building blocks

Taylor series approximate near one point using powers of x. But a repeating signal — a musical note, an AC voltage, the shape of a plucked string — is not about one point; it is about a whole period. For that, the natural building blocks are the functions that already repeat: sines and cosines.

Joseph Fourier’s startling claim was that every reasonable periodic function, no matter how jagged, is a sum of these smooth waves at frequencies 1, 2, 3, … times the fundamental — its harmonics.

🔑 A periodic function is a stack of harmonics
For a function of period 2π, the Fourier series adds a constant (its average), plus cosine and sine waves at every whole-number frequency. The coefficients an and bn say how much of each harmonic to include.
\[ f(x)=\frac{a_0}{2}+\sum_{n=1}^{\infty}\Big(a_n\cos(nx)+b_n\sin(nx)\Big) \]
The Fourier series of a 2π-periodic function. The a₀/2 term is the function's average value.

Orthogonality: the secret that makes it work

How do you find one coefficient without solving for all of them at once? The trick is that these waves are orthogonal: over a full period, the integral of the product of two different harmonics is zero, while the integral of a harmonic times itself is not. Multiplying f by cos(nx) and integrating therefore cancels every term except the one you want — like a filter tuned to a single frequency.

\[ a_n=\frac{1}{\pi}\int_{-\pi}^{\pi} f(x)\cos(nx)\,dx \qquad b_n=\frac{1}{\pi}\int_{-\pi}^{\pi} f(x)\sin(nx)\,dx \]
Each coefficient is an integral of f against the matching harmonic over one period.
🎮 The Fourier Engine LIVE
Stack sine harmonics to build a square or sawtooth wave from pure tones.

Symmetry cuts the work in half

Symmetry immediately kills half the coefficients. If f is odd (f(−x) = −f(x)), every cosine coefficient an vanishes and only sines survive. If f is even (f(−x) = f(x)), the sines vanish and only cosines survive. A square wave, drawn as an odd function, is therefore built from sines alone — and, as it turns out, only the odd-numbered harmonics.

\[ \text{square wave}=\frac{4}{\pi}\left(\sin x+\frac{\sin 3x}{3}+\frac{\sin 5x}{5}+\cdots\right) \]
The odd square wave uses only odd harmonics, with amplitudes falling off like 1/n.
📝 Worked example: Why does the constant term of a Fourier series equal the average of f over one period?
  1. Take the aₙ formula with n = 0: \( a_0=\dfrac{1}{\pi}\int_{-\pi}^{\pi} f(x)\cos(0)\,dx=\dfrac{1}{\pi}\int_{-\pi}^{\pi} f(x)\,dx \), since cos 0 = 1.
  2. The series uses the term \( a_0/2=\dfrac{1}{2\pi}\int_{-\pi}^{\pi} f(x)\,dx \).
  3. That is exactly the integral of f divided by the length of the interval, 2π.
✓ a₀/2 is the <strong>mean value of f over one period</strong> — the horizontal line the wobbles ride on.
📝 Worked example: A signal is a pure cosine, f(x) = 5 cos(2x). What is its Fourier series?
  1. f is already a single harmonic, so orthogonality gives zero for every coefficient except the cos(2x) one.
  2. Matching \( a_2\cos(2x)=5\cos(2x) \) forces \( a_2=5 \); every other aₙ and every bₙ is 0.
  3. There is no constant offset, so a₀ = 0.
✓ The series is just <strong>a₂ = 5</strong> with all other coefficients zero — a pure tone is its own Fourier series.
⚠️ The Gibbs overshoot
Near a jump — like the vertical edge of a square wave — the partial sums overshoot by about 9% of the jump, and this ripple never disappears no matter how many harmonics you add; it only gets narrower. This is the Gibbs phenomenon. Fourier series converge to the function’s value everywhere it is continuous, and to the midpoint of the jump exactly at a discontinuity — but the overshoot beside the jump is permanent.

Check your understanding

1. What are the building blocks of a Fourier series?
A Fourier series expresses a periodic function as a sum of sines and cosines at frequencies 1, 2, 3, … times the fundamental (its harmonics).
2. The coefficient bₙ is found by integrating f(x) against which function over a period?
bₙ = (1/π)∫ f(x) sin(nx) dx. Orthogonality makes multiplying by sin(nx) and integrating pick out exactly the nth sine amplitude.
3. A square wave drawn as an odd function is built from…
For an odd function all cosine coefficients vanish, leaving only sine terms (in fact only the odd harmonics).
4. The term a₀/2 in a Fourier series represents:
Setting n = 0 gives a₀/2 = (1/2π)∫ f dx, the mean value — the level the oscillations are centred on.
5. As you add more harmonics to a square wave, the overshoot beside each jump…
This is the Gibbs phenomenon: the overshoot's height stays about 9% of the jump; more terms only squeeze it closer to the discontinuity.
✅ Key takeaways
  • A Fourier series writes a periodic function as a₀/2 plus a sum of cosine and sine harmonics.
  • Orthogonality of the harmonics lets each coefficient be recovered by a single integral against that harmonic.
  • Odd functions need only sines; even functions need only cosines — symmetry halves the work.
  • The square wave uses only odd harmonics with amplitudes ∝ 1/n; a₀/2 is always the mean value.
  • Near a jump the partial sums overshoot by ~9% (the Gibbs phenomenon), a ripple that narrows but never vanishes.