Kreyszig, Chapters 11–12

Fourier Series & PDEs

Decompose any signal into pure frequencies. Solve the heat, wave, and Laplace equations with separation of variables.

Prerequisites: Calculus (integration, series), ODEs (second-order linear).
10
Chapters
6+
Simulations
10
Quizzes

Chapter 0: Why Fourier Analysis?

A violin and a flute can play the same note — the same pitch — yet they sound completely different. Why? Because each instrument produces a different mix of harmonics: pure sine waves at integer multiples of the fundamental frequency. Your ear hears the blend. Fourier analysis is the mathematics of pulling those harmonics apart.

Joseph Fourier made a stunning claim in 1807: any periodic function, no matter how jagged or discontinuous, can be written as a sum of sines and cosines. Mathematicians were skeptical. It took over a century to make his ideas rigorous. But the claim turned out to be essentially correct, and it revolutionized mathematics, physics, and engineering.

The core idea: Any periodic function f(x) with period 2L can be decomposed into a sum of sines and cosines: f(x) = a0/2 + Σ [an cos(nπx/L) + bn sin(nπx/L)]. The coefficients an and bn tell you "how much" of each harmonic is present — they are the frequency spectrum of the signal.

This idea connects directly to partial differential equations. The heat equation, wave equation, and Laplace equation all become solvable once we express initial conditions as Fourier series. Separation of variables + Fourier series = a universal PDE-solving machine.

What did Fourier claim about periodic functions?

Chapter 1: Fourier Series

Given a periodic function f(x) with period 2L, its Fourier series is:

f(x) = a0/2 + Σn=1 [an cos(nπx/L) + bn sin(nπx/L)]

The coefficients are found by exploiting orthogonality. Sines and cosines of different frequencies are orthogonal over a full period — their inner product (integral of the product) is zero:

−LL cos(mπx/L) cos(nπx/L) dx = 0   if m ≠ n

This orthogonality lets us isolate each coefficient by multiplying both sides by the corresponding basis function and integrating:

an = (1/L) ∫−LL f(x) cos(nπx/L) dx
bn = (1/L) ∫−LL f(x) sin(nπx/L) dx
Key insight: Orthogonality is the Fourier series secret weapon. It works exactly like projecting a vector onto coordinate axes. Each coefficient an or bn is the "projection" of f onto that harmonic — how much of that frequency is in the signal.

Example: The square wave f(x) = 1 for 0 < x < π, f(x) = −1 for −π < x < 0, with period 2π. All the an are zero (the function is odd), and bn = 2/(nπ) for odd n, zero for even n. So:

f(x) = (4/π) [sin(x) + sin(3x)/3 + sin(5x)/5 + ...]
Fourier Series Builder

Orange: target function. Teal: Fourier partial sum with N terms. Add more terms and watch the approximation improve. Choose different target functions.

N = 5 terms
Why does multiplying f(x) by cos(nπx/L) and integrating isolate the coefficient an?

Chapter 2: Convergence

Does the Fourier series actually converge to f(x)? The answer is surprisingly subtle.

Pointwise convergence (Dirichlet conditions): If f(x) is piecewise smooth (finitely many jumps, bounded derivative between jumps), the Fourier series converges to f(x) at every point where f is continuous. At a jump discontinuity, it converges to the average of the left and right limits: [f(x+) + f(x)]/2.

Gibbs phenomenon: Near a jump discontinuity, the Fourier partial sums always overshoot by about 9% of the jump height — no matter how many terms you take. Adding more terms makes the overshoot narrower but never shorter. This is the Gibbs phenomenon, discovered by Wilbraham (1848) and rediscovered by Gibbs (1899).

Mean-square convergence: Even stronger: the partial sums minimize the integrated squared error. Parseval's theorem says the total "energy" is preserved:

(1/L) ∫−LL |f(x)|2 dx = a02/2 + Σn=1 (an2 + bn2)

This says the energy in the time domain equals the energy in the frequency domain. It is the mathematical foundation of signal processing.

Analogy: Parseval's theorem is the Pythagorean theorem for function spaces. Just as |v|2 = v12 + v22 + ... for a vector, the "length squared" of a function equals the sum of squares of its Fourier coefficients.
At a jump discontinuity, what does the Fourier series converge to?

Chapter 3: Even & Odd Extensions

If f(x) is even (f(−x) = f(x)), all the bn vanish and the Fourier series is a pure cosine series:

f(x) = a0/2 + Σn=1 an cos(nπx/L)

If f(x) is odd (f(−x) = −f(x)), all the an vanish and we get a pure sine series:

f(x) = Σn=1 bn sin(nπx/L)
Half-range expansions: If f(x) is defined only on [0, L], you can extend it to be even (getting a cosine series) or odd (getting a sine series) on [−L, L]. This is a choice, not a fact about f. Different extensions give different series, both valid on [0, L]. The choice matters for PDEs: sine series match zero boundary conditions; cosine series match zero-derivative (insulated) boundary conditions.

Example: f(x) = x on [0, π]. The sine series is bn = 2(−1)n+1/n, giving x = 2[sin(x) − sin(2x)/2 + sin(3x)/3 − ...]. The cosine series has a0 = π and an = −4/(πn2) for odd n.

Sturm-Liouville problems generalize Fourier series. Instead of sines and cosines, the eigenfunctions of a Sturm-Liouville equation form a complete orthogonal set. Any "nice" function can be expanded in these eigenfunctions, with coefficients found by the same orthogonality trick.

When solving a PDE with f(0) = f(L) = 0 boundary conditions, which Fourier expansion should you use?

Chapter 4: The Fourier Transform

Fourier series handle periodic functions. But what about a single pulse, a transient signal, a function that never repeats? The Fourier transform extends Fourier analysis to non-periodic functions by letting the period go to infinity.

F(ω) = ∫−∞ f(t) e−iωt dt
f(t) = (1/2π) ∫−∞ F(ω) eiωt

F(ω) is the frequency spectrum of f(t). It tells you the amplitude and phase of each frequency ω present in the signal. The first integral decomposes; the second reconstructs.

The duality: Fourier series gives a discrete spectrum (frequencies nω0). The Fourier transform gives a continuous spectrum (all frequencies ω). A periodic signal has energy at discrete frequencies; a non-periodic signal spreads its energy across a continuum.

Key properties that make the transform powerful:

PropertyTime domainFrequency domain
Linearityaf + bgaF + bG
Time shiftf(t − t0)e−iωt0 F(ω)
Freq. shifte0t f(t)F(ω − ω0)
Convolutionf * gF · G
Derivativef'(t)iω F(ω)

The convolution theorem is perhaps the most important: convolution in the time domain becomes multiplication in the frequency domain. This is why filtering, blurring, and signal processing are all done in the frequency domain — multiplication is much faster than convolution.

The Discrete Fourier Transform (DFT) and the Fast Fourier Transform (FFT) are the computational versions, turning N samples into N frequency coefficients in O(N log N) time. The FFT is one of the most important algorithms ever invented.

What does the convolution theorem say?

Chapter 5: The Heat Equation

A metal bar is heated unevenly and then left alone. How does the temperature u(x, t) evolve over time? The governing equation is the heat equation (or diffusion equation):

∂u/∂t = c22u/∂x2

Here c2 is the thermal diffusivity (how fast heat spreads). The equation says: the rate of temperature change at a point is proportional to the concavity of the temperature profile there. Hot spots surrounded by cooler regions lose heat; cool spots surrounded by warmer regions gain heat.

Separation of variables: Assume u(x, t) = X(x) T(t). Substitute into the PDE and separate: T'/T = c2X''/X = −λ. Each side depends on a different variable, so both must equal a constant −λ. This gives two ODEs: X'' + λX = 0 and T' + c2λT = 0.

With boundary conditions u(0, t) = u(L, t) = 0 (ends held at zero):

• The X equation gives eigenfunctions Xn(x) = sin(nπx/L) with eigenvalues λn = (nπ/L)2.

• The T equation gives Tn(t) = e−c2(nπ/L)2t, which decays exponentially.

• The general solution is a sum: u(x, t) = Σ bn sin(nπx/L) e−c2(nπ/L)2t.

• The coefficients bn come from the Fourier sine series of the initial condition u(x, 0).

Physical insight: Each harmonic decays at a rate proportional to n2. High-frequency wiggles die out fast; low-frequency features persist. This is why heat diffusion smooths things out — it is a low-pass filter in the spatial domain.
Heat Equation Simulator

Temperature u(x, t) on a bar with ends held at zero. Orange = hot, teal = cold. Watch heat diffuse over time. Choose initial conditions.

t = 0.00
Why do high-frequency components of the temperature decay faster than low-frequency ones?

Chapter 6: The Wave Equation

A guitar string is plucked and released. How does the displacement u(x, t) evolve? The wave equation is:

2u/∂t2 = c22u/∂x2

Here c is the wave speed (determined by tension and density). Unlike the heat equation (first-order in t), the wave equation is second-order in t, so we need both initial displacement u(x, 0) = f(x) and initial velocity ut(x, 0) = g(x).

Separation of variables with u(0, t) = u(L, t) = 0 gives:

u(x, t) = Σn=1 sin(nπx/L) [An cos(nπct/L) + Bn sin(nπct/L)]

Each term is a standing wave: a fixed spatial pattern sin(nπx/L) oscillating in time. The frequency of the n-th mode is ωn = nπc/L. These are the harmonics of the string.

D'Alembert's solution: The wave equation also has a beautiful traveling-wave solution: u(x, t) = φ(x − ct) + ψ(x + ct). Any solution decomposes into a rightward-moving wave and a leftward-moving wave, each traveling at speed c without changing shape. This is fundamentally different from heat diffusion, which smooths things out.
Heat vs. wave: Heat equation: first-order in t, solutions decay, information lost, irreversible. Wave equation: second-order in t, solutions oscillate, information preserved, reversible. This reflects deep physics: diffusion increases entropy; waves conserve energy.
Vibrating String Simulator

A string fixed at both ends. Orange curve shows displacement u(x, t). Watch the standing wave patterns. Choose initial shapes.

t = 0.00
What is the fundamental difference between heat and wave equation solutions?

Chapter 7: Laplace's Equation

The Laplace equation describes steady-state phenomena — temperature distributions that no longer change, electrostatic potentials, gravitational fields:

2u = ∂2u/∂x2 + ∂2u/∂y2 = 0

There is no time derivative. The solution u(x, y) is determined entirely by boundary conditions. Functions satisfying Laplace's equation are called harmonic functions, and they have remarkable properties.

Maximum principle: A harmonic function cannot have a maximum or minimum in the interior of its domain — extremes occur only on the boundary. This means: the steady-state temperature inside a region is always between the hottest and coldest boundary values. There are no "hot spots" in the interior that are hotter than the boundary.

Mean value property: The value of a harmonic function at any point equals its average over any circle centered at that point. Harmonic functions are the ultimate "smooth averagers."

Solving on a rectangle: On a rectangle 0 ≤ x ≤ a, 0 ≤ y ≤ b with u specified on the boundary, separation of variables gives u(x, y) = Σ cn sin(nπx/a) sinh(nπy/a). The sinh (hyperbolic sine) handles the y-direction since there is no oscillation in steady state — only exponential-like behavior.

Connection to complex analysis: The real and imaginary parts of any analytic function f(z) = u(x,y) + iv(x,y) are harmonic. This connects Laplace's equation directly to complex analysis (Chapter 7 of this series). Conformal mapping transforms one Laplace problem into another.
What does the maximum principle say about harmonic functions?

Chapter 8: Fourier & PDE Lab

Two interactive demonstrations that bring together the ideas of this lesson.

Spectrum Analyzer

Draw any periodic function and see its Fourier coefficients computed in real time. The bar chart shows the amplitude of each harmonic.

Interactive Spectrum Analyzer

Top: the waveform (orange). Bottom: its Fourier coefficients (teal bars). Choose a waveform or drag to draw your own.

2D Heat Diffusion

Watch heat spread on a 2D plate. Click to place heat sources. The temperature evolves according to the 2D heat equation.

2D Heat Equation

Click anywhere to place a heat source. Watch the heat diffuse outward in all directions. Orange = hot, dark = cold.

The PDE-solving recipe: (1) Write the PDE and boundary conditions. (2) Assume u = X(x)T(t) and separate. (3) Solve each ODE. (4) Apply boundary conditions to get eigenfunctions. (5) Superpose and match initial conditions using Fourier coefficients. This recipe works for heat, wave, and Laplace equations on simple geometries.

Chapter 9: Connections

This lessonWhere it leads
Fourier seriesSignal processing, audio/image compression (JPEG, MP3)
Convergence & GibbsSampling theory (Nyquist), windowing in DSP
Fourier transformSpectral analysis, quantum mechanics (ψ ↔ φ), MRI
Heat equationDiffusion processes, Brownian motion, financial math (Black-Scholes)
Wave equationAcoustics, electromagnetics, seismology
Laplace equationElectrostatics, fluid flow, complex analysis (Ch 7)
Separation of variablesQuantum mechanics (Schrödinger eq), Bessel functions, spherical harmonics
The deep unity: Fourier analysis is really the theory of eigenfunction expansions for linear operators. The Laplacian ∇2 has sines and cosines as eigenfunctions. Every linear PDE with constant coefficients can be solved by expanding in the eigenfunctions of the spatial operator. This idea generalizes far beyond sines and cosines — to Bessel functions, Legendre polynomials, spherical harmonics, and wavelets.

"Fourier's theorem is not only one of the most beautiful results of modern analysis, but it may be said to furnish an indispensable instrument in the treatment of nearly every recondite question in modern physics." — Lord Kelvin

What is the unifying idea behind solving heat, wave, and Laplace equations by separation of variables?