Separation of Variables

Separation of variables turns a PDE into ODEs. Learn the procedure (product solution, separation constant), eigenvalue problems from boundary conditions, superposition and Fourier series for initial conditions, and full solutions of the heat equation, wave equation (standing waves) and Laplace's equation on a rectangle — with a Python evaluation.

For simple geometries with linear PDEs and homogeneous BCs, separation of variables gives exact solutions as sums of modes — the same modes (sin nπx/L) that vibrate on a guitar string or decay in a heated rod.

An analogy

Separation of variables is like describing a chord as a sum of pure notes: each note (mode) evolves independently, and the initial chord fixes how loud each note is.

Procedure

Assume u = X(x)T(t); substitute; divide by XT; set each side equal to −λ; solve the spatial ODE with BCs (eigenvalue problem); solve the time ODE; superpose; match ICs with Fourier series.

Heat equation

Higher modes decay faster (∝ n²), so after a short time the lowest mode dominates — the basis of time-constant estimates in thermal design.

Wave equation

Each mode is a standing wave oscillating at fₙ = nc/2L: harmonics of strings, organ pipes and beams. Plucking position decides which harmonics are excited.

Extensions

Non-homogeneous BCs: subtract a steady-state solution first. Other geometries: Bessel (cylinders) and Legendre (spheres) modes. When separation fails, use numerical methods.

Formulas

Worked example: Heat equation with a square initial profile

Given: u(x, 0) = 100 on (0, L), ends at 0

Find: Bₙ.

Answer: u = Σ_odd (400/nπ) sin(nπx/L) e^(−α²(nπ/L)²t)

Worked example: String harmonics

Given: c = 264.6 m/s, L = 0.65 m

Find: First three frequencies.

Answer: 203.5, 407.0, 610.6 Hz

Evaluate the heat-equation solution (Python)

import numpy as np

# 1D heat equation u_t = a u_xx on [0, L], u = 0 at both ends
# Separation of variables: u = 100 sin(pi x / L) exp(-a (pi/L)^2 t)
a, L = 1.11e-4, 0.5            # copper diffusivity (m^2/s), rod length (m)
x = np.linspace(0, L, 5)
for t in (0, 100, 228, 600):
    u = 100 * np.sin(np.pi * x / L) * np.exp(-a * (np.pi / L) ** 2 * t)
    print(f"t = {t:4d} s  u(L/2) = {u[2]:6.2f} C  profile = {np.round(u, 1)}")
# t =    0 s  u(L/2) = 100.00 C  profile = [  0.   70.7 100.   70.7   0. ]
# t =  100 s  u(L/2) =  64.52 C  profile = [ 0.  45.6 64.5 45.6  0. ]
# t =  228 s  u(L/2) =  36.82 C  profile = [ 0.  26.  36.8 26.   0. ]
# t =  600 s  u(L/2) =   7.21 C  profile = [0.  5.1 7.2 5.1 0. ]

With a single-mode initial condition, only B₁ is non-zero. After one time constant (≈ 228 s) the mode has decayed to e⁻¹ ≈ 36.8 % — exactly as the formula predicts.

Common mistakes

Applications

Key takeaways

Going further