Fourier Series Expansions

Chapter 13, Fourier Series and Transforms

Learning objectives

  • Write the Fourier series of a 2Ο€2\pi-periodic function
  • Compute ana_n and bnb_n via integral formulas
  • Use orthogonality of {1,cos⁑(nx),sin⁑(nx)}\{1, \cos(nx), \sin(nx)\} to derive the coefficient formulas
  • Exploit even/odd symmetry to predict which coefficients vanish

Fourier Series BuilderInteractive figure, enable JavaScript to interact.

If every reasonable 2Ο€2\pi-periodic function is a sum of sines and cosines, how do you find the coefficients? The answer is one of the most elegant constructions in mathematics: the trigonometric system is orthogonal in the integral inner product, so each coefficient is recovered by a single integration. The Fourier-coefficient formula is just the inner product of ff with the basis function, divided by the basis function's norm. Once you internalize that one idea, every special-symmetry rule (odd functions have no cosines, even functions have no sines) becomes obvious.

The Fourier series

Let ff be a 2Ο€2\pi-periodic function on [βˆ’Ο€,Ο€][-\pi, \pi]. Its Fourier series is the formal sum

f(x)∼a02+βˆ‘n=1∞(ancos⁑(nx)+bnsin⁑(nx))f(x) \sim \dfrac{a_0}{2} + \displaystyle\sum_{n=1}^{\infty} \bigl(a_n \cos(nx) + b_n \sin(nx)\bigr)

where the Fourier coefficients are computed by:

an=1Ο€βˆ«βˆ’Ο€Ο€f(x)cos⁑(nx) dx,n=0,1,2,…a_n = \dfrac{1}{\pi} \displaystyle\int_{-\pi}^{\pi} f(x) \cos(nx) \, dx, \quad n = 0, 1, 2, \ldots bn=1Ο€βˆ«βˆ’Ο€Ο€f(x)sin⁑(nx) dx,n=1,2,3,…b_n = \dfrac{1}{\pi} \displaystyle\int_{-\pi}^{\pi} f(x) \sin(nx) \, dx, \quad n = 1, 2, 3, \ldots

The factor of 1/Ο€1/\pi comes from the inner-product norm, and the constant term gets a factor of a0/2a_0 / 2 for tidiness. The ∼\sim symbol (instead of ==) is a reminder that convergence of the right side to ff is a separate question, taken up in section 13.3.

Why the formula works: orthogonality

Equip the space of square-integrable functions on [βˆ’Ο€,Ο€][-\pi, \pi] with the inner product ⟨f,g⟩=βˆ«βˆ’Ο€Ο€f(x)g(x) dx\langle f, g \rangle = \int_{-\pi}^{\pi} f(x) g(x) \, dx. The system {1,cos⁑(x),sin⁑(x),cos⁑(2x),sin⁑(2x),…}\{1, \cos(x), \sin(x), \cos(2x), \sin(2x), \ldots\} is orthogonal: any two distinct basis functions integrate to zero against each other. The product-to-sum identities give

βˆ«βˆ’Ο€Ο€cos⁑(mx)cos⁑(nx) dx={0,mβ‰ nΟ€,m=nβ‰₯12Ο€,m=n=0\displaystyle\int_{-\pi}^{\pi} \cos(mx) \cos(nx) \, dx = \begin{cases} 0, & m \neq n \\ \pi, & m = n \geq 1 \\ 2\pi, & m = n = 0 \end{cases}

and analogous formulas for sine-sine and sine-cosine products. To find ama_m, multiply the Fourier series by cos⁑(mx)\cos(mx) and integrate term by term: all terms vanish except the mm-th cosine term, which contributes amβ‹…Ο€a_m \cdot \pi. Solving gives the formula am=(1/Ο€)∫fcos⁑(mx) dxa_m = (1/\pi) \int f \cos(mx) \, dx.

Ξ£ (1/2)^k converges to 2= 2S_nS_n = 1 + 1/2 + 1/4 + … + 1/2^n β†’ 2 as n β†’ ∞

The series summer lets you stack partial sums of a Fourier series. Try the square wave f(x)=sign(x)f(x) = \text{sign}(x) on [βˆ’Ο€,Ο€][-\pi, \pi], the first few odd harmonics with coefficients 4/(Ο€n)4/(\pi n) already give a recognisable square shape. The amplitude of each new term decays as 1/n1/n, so adding terms rapidly diminishes the visible error away from the jumps.

Even/odd shortcuts

The integrand f(x)cos⁑(nx)f(x) \cos(nx) is even if ff is even (even times even). Its integral over [βˆ’Ο€,Ο€][-\pi, \pi] equals twice the integral over [0,Ο€][0, \pi], you save half the work. The integrand f(x)sin⁑(nx)f(x) \sin(nx) is odd if ff is even (even times odd), so it integrates to zero: every bn=0b_n = 0 for an even ff. Symmetrically, odd ff has every an=0a_n = 0 and only sine terms appear. Always check the symmetry of ff before computing any integral.

Where this shows up
  • MP3, AAC, Opus audio: Modern audio codecs apply a windowed Fourier-like transform (modified DCT) to short frames of a recording, quantise the coefficients aggressively, and store only the perceptually significant ones. The "frequency-domain compression" the standards talk about is exactly Fourier coefficient quantisation.
  • JPEG image compression: JPEG splits an image into 8x8 pixel blocks and computes a 2D discrete cosine transform of each block. Cosine basis functions are chosen because images tend to be smooth (the highest-frequency cosine coefficient is usually tiny), and the few large coefficients suffice to reconstruct the block.
  • Heat equation solutions: When you separate variables on the heat equation ut=uxxu_t = u_{xx} on [0,L][0, L] with zero boundary, the solution is a Fourier sine series in xx with time-dependent coefficients. Section 14.4 makes this explicit.
  • Music synthesis: Additive synthesisers build a tone by summing sinusoids at integer multiples of the fundamental, each with its own amplitude envelope. This is literally constructing a sound from its Fourier coefficients in real time.

Pause and think: Suppose you compute an=0a_n = 0 for every nn. Does that force f≑0f \equiv 0? (Hint: think about what happens if ff is odd. Cosine coefficients vanish, but the function is non-zero.)

Try it

  • Compute a0a_0 for f(x)=x2f(x) = x^2 on [βˆ’Ο€,Ο€][-\pi, \pi]. Use the formula a0=(1/Ο€)βˆ«βˆ’Ο€Ο€x2 dxa_0 = (1/\pi) \int_{-\pi}^{\pi} x^2 \, dx and the symmetry of x2x^2.
  • Before integrating: which Fourier coefficients of f(x)=x3f(x) = x^3 on [βˆ’Ο€,Ο€][-\pi, \pi] vanish, and why?
  • Verify directly: βˆ«βˆ’Ο€Ο€sin⁑(2x)cos⁑(3x) dx=0\int_{-\pi}^{\pi} \sin(2x) \cos(3x) \, dx = 0. (Use the product-to-sum identity sin⁑acos⁑b=12[sin⁑(a+b)+sin⁑(aβˆ’b)]\sin a \cos b = \tfrac{1}{2}[\sin(a+b) + \sin(a-b)].)
  • On the series-summer widget, build βˆ‘n=1,3,5,…N(4/(Ο€n))sin⁑(nx)\sum_{n=1,3,5,\ldots}^{N} (4/(\pi n)) \sin(nx) for N=1,3,5,9N = 1, 3, 5, 9. Each partial sum is the Fourier series of the square wave truncated at NN terms. Sketch how the graph evolves.
  • Find the Fourier coefficients of the constant function f(x)=7f(x) = 7 on [βˆ’Ο€,Ο€][-\pi, \pi].

A trap to watch for

The constant term a0/2a_0/2 (not a0a_0) is the average value of ff over [βˆ’Ο€,Ο€][-\pi, \pi]. Students routinely write the Fourier series as a0+βˆ‘(ancos⁑nx+bnsin⁑nx)a_0 + \sum (a_n \cos nx + b_n \sin nx), dropping the factor of 1/21/2. That extra factor exists because the cosine of 0x0x is the constant 11, and the inner-product norm of 11 is 2Ο€2\pi rather than Ο€\pi, without the 1/21/2, the formula for a0a_0 would double-count the constant. The convention is annoying but universal; always include the 1/21/2.

What you now know

You can compute Fourier coefficients of a 2Ο€2\pi-periodic function, use even/odd symmetry to predict which integrals vanish, and explain why the formulas come from inner-product projection onto an orthogonal basis. The next section asks the convergence question: does the Fourier series actually reconstruct ff, and in what sense?

Mark section complete β†’

References

  • Garrity, T. (2002). All the Mathematics You Missed: But Need to Know for Graduate School. Cambridge University Press, ch. 13.
  • Stein, E. M., Shakarchi, R. (2003). Fourier Analysis: An Introduction. Princeton University Press, ch. 2.
  • Folland, G. B. (1992). Fourier Analysis and Its Applications. Wadsworth & Brooks/Cole, ch. 2.
  • Bracewell, R. N. (1999). The Fourier Transform and Its Applications (3rd ed.). McGraw-Hill, ch. 2.
  • Korner, T. W. (1989). Fourier Analysis. Cambridge University Press, ch. 2 (orthogonality and Fourier coefficients).

This page is prerendered for SEO and accessibility. The interactive widgets above hydrate on JavaScript load.