The Wave Equation
Second-order in time • Two initial conditions • Oscillating solutions
1. Physical Setup and Governing Equation
Consider a taut string of length $L$ fixed at both ends, lying along the $x$-axis. Let $u(x,t)$ denote the vertical displacement of the string at position $x$ and time $t$. Under small-amplitude assumptions, $u$ satisfies
$$\frac{\partial^2 u}{\partial t^2} = a^2\,\frac{\partial^2 u}{\partial x^2},\qquad 0 < x < L,\; t > 0.$$Here $a > 0$ is the wave speed, determined by the string's tension $T$ and density $\rho$ as $a = \sqrt{T/\rho}$.
Initial and Boundary Conditions
The wave equation is second-order in time, unlike the heat equation which is first-order. This means we must specify both
- the initial displacement: $u(x,0) = f(x)$, and
- the initial velocity: $\dfrac{\partial u}{\partial t}(x,0) = g(x)$.
Compare with mechanics: to predict a ball's trajectory, you need both its initial position and initial velocity — not just one. The wave equation is simply Newton's second law for a string.
2. Separation of Variables
Assume $u(x,t) = P(x)Q(t)$. Compute the partial derivatives:
$$\frac{\partial^2 u}{\partial t^2} = P(x)Q''(t), \qquad \frac{\partial^2 u}{\partial x^2} = P''(x)Q(t).$$Substitute into $u_{tt} = a^2 u_{xx}$:
$$P(x)Q''(t) = a^2\,P''(x)Q(t).$$Divide both sides by $a^2\,P(x)\,Q(t)$:
$$\frac{Q''(t)}{a^2 Q(t)} = \frac{P''(x)}{P(x)} = -\lambda.$$Same separation constant trick as in the heat equation.
The Two ODEs
We obtain two ordinary differential equations:
The spatial problem is identical to the one we solved for the heat equation. Therefore the spatial three-case analysis gives the same eigenvalues and eigenfunctions:
$$\lambda_m = \left(\frac{m\pi}{L}\right)^2, \qquad P_m(x) = \sin\!\left(\frac{m\pi x}{L}\right), \quad m = 1,2,3,\ldots$$Only the temporal behaviour differs.
3. Spatial Three-Case Analysis (Review)
We briefly recapitulate the three-case analysis for completeness, since the same spatial problem appears:
$P(x) = A\cosh(\alpha x) + B\sinh(\alpha x)$. BCs $P(0)=P(L)=0$ force $A = B = 0$. Trivial.
$P(x) = C_1 x + C_2$. BCs force $C_1 = C_2 = 0$. Trivial.
$P(x) = A\cos(\alpha x) + B\sin(\alpha x)$. $P(0) = 0 \Rightarrow A = 0$. $P(L) = B\sin(\alpha L) = 0$ with $B \neq 0$ gives
$$\alpha_m = \frac{m\pi}{L}, \qquad \lambda_m = \left(\frac{m\pi}{L}\right)^2, \qquad P_m(x) = \sin\!\left(\frac{m\pi x}{L}\right).$$4. Solving the Temporal ODE
With $\lambda = \lambda_m = (m\pi/L)^2$, the temporal ODE reads
$$Q_m''(t) + a^2\lambda_m\,Q_m(t) = 0 \implies Q_m''(t) + \left(\frac{m\pi a}{L}\right)^2 Q_m(t) = 0.$$This is a simple harmonic oscillator with angular frequency
$$\omega_m = \frac{m\pi a}{L}.$$Its general solution contains both a cosine and a sine term (because of the two arbitrary constants that come with any second-order ODE):
$$Q_m(t) = A_m\,\cos\!\left(\frac{m\pi a}{L}\,t\right) + B_m\,\sin\!\left(\frac{m\pi a}{L}\,t\right).$$Heat: $Q' + K\lambda Q = 0 \Rightarrow Q(t) = C\,e^{-K\lambda t}$ (exponential decay).
Wave: $Q'' + a^2\lambda Q = 0 \Rightarrow Q(t) = A\cos(\omega t) + B\sin(\omega t)$ (pure oscillation, no decay).
This is why the wave equation conserves energy while the heat equation dissipates it.
5. General Solution of the Wave Equation
Each product solution $u_m(x,t) = P_m(x)Q_m(t)$ is called a mode or normal mode. By linearity we can superpose:
We must determine both the $A_m$ and the $B_m$ to match the two initial conditions.
Determining the $A_m$ from $u(x,0) = f(x)$
Setting $t = 0$ in the general solution (note $\sin(0) = 0$, $\cos(0) = 1$):
$$u(x,0) = \sum_{m=1}^{\infty} A_m\,\sin\!\left(\frac{m\pi x}{L}\right) = f(x).$$This is the Fourier sine series of $f(x)$, so
$$\boxed{\;A_m = \frac{2}{L}\int_0^L f(x)\,\sin\!\left(\frac{m\pi x}{L}\right)dx.\;}$$Determining the $B_m$ from $u_t(x,0) = g(x)$
Differentiate the general solution term-by-term with respect to $t$:
$$u_t(x,t) = \sum_{m=1}^{\infty}\!\left[-A_m\frac{m\pi a}{L}\sin\!\left(\frac{m\pi a}{L}t\right) + B_m\frac{m\pi a}{L}\cos\!\left(\frac{m\pi a}{L}t\right)\right]\!\sin\!\left(\frac{m\pi x}{L}\right).$$Set $t = 0$:
$$u_t(x,0) = \sum_{m=1}^{\infty} B_m\,\frac{m\pi a}{L}\,\sin\!\left(\frac{m\pi x}{L}\right) = g(x).$$This is the Fourier sine series of $g(x)$, with coefficients $B_m(m\pi a/L)$. Solving for $B_m$:
$$\boxed{\;B_m = \frac{2}{m\pi a}\int_0^L g(x)\,\sin\!\left(\frac{m\pi x}{L}\right)dx.\;}$$For each mode $m$, the displacement IC $f$ gives $A_m$ and the velocity IC $g$ gives $B_m$. Two scalar pieces of data per mode to fix two unknown amplitudes — perfectly balanced.
6. Method Summary
- Separate variables $u = PQ$, obtaining spatial and temporal ODEs.
- Spatial three-case analysis: only $\lambda > 0$ survives, giving $\lambda_m = (m\pi/L)^2$ and $P_m = \sin(m\pi x/L)$.
- Solve the second-order temporal ODE: $Q_m = A_m\cos(\omega_m t) + B_m\sin(\omega_m t)$ where $\omega_m = m\pi a/L$.
- Superpose: $u = \sum (A_m\cos\omega_m t + B_m\sin\omega_m t)\sin(m\pi x/L)$.
- Compute $A_m$ from $u(x,0) = f(x)$ via Fourier sine coefficients.
- Compute $B_m$ from $u_t(x,0) = g(x)$ — with the $1/\omega_m$ factor because of the derivative.
7. Note: The d'Alembert Form
On the infinite line (no boundaries), the wave equation also admits the closed-form d'Alembert solution
$$u(x,t) = \frac{1}{2}\bigl[f(x + at) + f(x - at)\bigr] + \frac{1}{2a}\int_{x - at}^{x + at} g(s)\,ds.$$This makes explicit that the wave equation propagates disturbances at speed $a$ in both directions, without distortion. For the finite string with Dirichlet BCs, the Fourier-series solution above is equivalent to the d'Alembert form extended by periodic/odd reflection.
Worked Examples
Step 1 — Parameters. $a = 3$, $L = 4$, $\omega_m = 3m\pi/4$.
Step 2 — General form.
$$u(x,t) = \sum_{m=1}^{\infty}\!\left[A_m\cos\!\left(\frac{3m\pi t}{4}\right) + B_m\sin\!\left(\frac{3m\pi t}{4}\right)\right]\!\sin\!\left(\frac{m\pi x}{4}\right).$$Step 3 — Compute $A_m$ from $f(x) = x - 1$. This is the same computation as Example 3 on page 6.2:
$$A_m = \frac{2}{4}\int_0^4 (x-1)\sin\!\left(\frac{m\pi x}{4}\right)dx = -\frac{2}{m\pi}\bigl[1 + 3(-1)^m\bigr].$$Step 4 — Compute $B_m$ from $g(x) = x$. We need
$$B_m = \frac{2}{m\pi \cdot 3}\int_0^4 x\sin\!\left(\frac{m\pi x}{4}\right)dx.$$Integration by parts with $u = x$, $dv = \sin(m\pi x/4)dx$, so $du = dx$, $v = -\dfrac{4}{m\pi}\cos(m\pi x/4)$:
$$\int_0^4 x\sin\!\left(\frac{m\pi x}{4}\right)dx = \left[-\frac{4x}{m\pi}\cos\!\left(\frac{m\pi x}{4}\right)\right]_0^4 + \frac{4}{m\pi}\int_0^4 \cos\!\left(\frac{m\pi x}{4}\right)dx.$$The remaining integral is zero (as in earlier examples). Evaluating the boundary term:
$$-\frac{16}{m\pi}\cos(m\pi) - 0 = -\frac{16(-1)^m}{m\pi}.$$Therefore
$$B_m = \frac{2}{3m\pi}\cdot\left(-\frac{16(-1)^m}{m\pi}\right) = -\frac{32(-1)^m}{3 m^2 \pi^2}.$$Physical check: Energy does not decay — oscillations persist forever. The displacement is an infinite superposition of standing-wave modes, each oscillating at its own frequency $\omega_m = 3m\pi/4$.
Step 1 — $A_m$ by comparison. $f(x) = \sin(\pi x/L)$ is exactly the $m=1$ eigenfunction, so $A_1 = 1$ and all other $A_m = 0$.
Step 2 — $B_m$. Since $g(x) \equiv 0$, all $B_m = 0$.
Physical meaning: A pure sinusoidal standing wave. Every point on the string oscillates at frequency $\omega_1 = \pi a/L$, with amplitude $\sin(\pi x/L)$ depending on position. The endpoints $x=0, L$ are nodes (fixed); the midpoint $x = L/2$ is an antinode. This is the fundamental mode of the string — the lowest musical pitch it can produce.
Step 1 — $A_m$: Since $f \equiv 0$, all $A_m = 0$.
Step 2 — $B_m$: The velocity matches the $m = 2$ eigenfunction. In the Fourier-sine expansion $g(x) = \sum B_m(m\pi a/L)\sin(m\pi x/L)$ we match mode by mode:
$$B_2\,\frac{2\pi a}{L} = 1 \implies B_2 = \frac{L}{2\pi a},$$and all other $B_m = 0$.
Physical meaning: No initial displacement, but an initial velocity kick. The string responds by oscillating in the second mode (two half-wavelengths fit in $L$). The $\sin$ in time means the displacement starts at zero and grows sinusoidally — exactly what you'd expect from an initial "kick".
📝 Exam-Style Practice Problems
Wave-equation exam problems always supply two initial conditions — a displacement $f(x)$ and a velocity $g(x)$ — plus both boundary conditions. Check that all four pieces of data are present before you start. Click a problem to reveal the full solution.
Solution
Step 1: Read the parameters. $a^2 = 4 \Rightarrow a = 2$, and $L = \pi$. The eigenfunctions are $\sin(mx)$ and the frequencies are
$$\omega_m = \frac{m\pi a}{L} = \frac{m\pi\cdot 2}{\pi} = 2m.$$Step 2: General solution.
$$u(x,t) = \sum_{m=1}^{\infty}\bigl[A_m\cos(2mt) + B_m\sin(2mt)\bigr]\sin(mx).$$Step 3: Use the displacement IC for the $A_m$. Setting $t = 0$,
$$\sum_{m=1}^{\infty} A_m\sin(mx) = 3\sin(2x) \implies A_2 = 3,\quad A_m = 0 \text{ otherwise.}$$Step 4: Use the velocity IC for the $B_m$. Differentiating in $t$ and setting $t = 0$,
$$u_t(x,0) = \sum_{m=1}^{\infty} B_m\,\omega_m \sin(mx) = 5\sin(x).$$Only $m = 1$ appears, and $\omega_1 = 2$, so
$$B_1\cdot 2 = 5 \implies B_1 = \frac{5}{2}, \qquad B_m = 0 \text{ otherwise.}$$Final Solution:
$$\boxed{u(x,t) = 3\cos(4t)\sin(2x) + \frac{5}{2}\sin(2t)\sin(x)}$$Solution
Step 1: Parameters. $a = 1$, $L = 1$, so $\omega_m = m\pi$ and the eigenfunctions are $\sin(m\pi x)$.
Step 2: The $A_m$ vanish. Since $u(x,0) = 0$, every $A_m = 0$: the string starts flat.
Step 3: Compute the $B_m$ by integration.
$$B_m = \frac{2}{m\pi a}\int_0^1 x(1-x)\sin(m\pi x)\,dx = \frac{2}{m\pi}\int_0^1 (x - x^2)\sin(m\pi x)\,dx.$$Integrating by parts once (the boundary term vanishes because $x - x^2 = 0$ at both endpoints):
$$\int_0^1 (x-x^2)\sin(m\pi x)dx = \frac{1}{m\pi}\int_0^1 (1-2x)\cos(m\pi x)\,dx.$$Integrating by parts a second time (this boundary term vanishes because $\sin(m\pi) = 0$):
$$\int_0^1 (1-2x)\cos(m\pi x)\,dx = \frac{2}{m\pi}\int_0^1\sin(m\pi x)\,dx = \frac{2\bigl[1-(-1)^m\bigr]}{m^2\pi^2}.$$Step 4: Assemble.
$$B_m = \frac{2}{m\pi}\cdot\frac{1}{m\pi}\cdot\frac{2\bigl[1-(-1)^m\bigr]}{m^2\pi^2} = \frac{4\bigl[1-(-1)^m\bigr]}{m^4\pi^4}.$$So $B_m = 0$ for even $m$ and $B_m = \dfrac{8}{m^4\pi^4}$ for odd $m$.
Final Solution:
$$\boxed{u(x,t) = \sum_{\substack{m=1\\ m\ \text{odd}}}^{\infty}\frac{8}{m^4\pi^4}\,\sin(m\pi t)\,\sin(m\pi x)}$$Solution
Step 1: Parameters. $a = 3$, $L = 3$, eigenfunctions $\sin(m\pi x/3)$, frequencies
$$\omega_m = \frac{m\pi a}{L} = \frac{3m\pi}{3} = m\pi.$$Step 2: Match $f$ to a mode. $\sin(\pi x) = \sin(m\pi x/3)$ requires $m = 3$, so
$$A_3 = 2, \qquad A_m = 0 \text{ otherwise.}$$Step 3: Match $g$ to a mode. $\sin(2\pi x/3)$ is the $m = 2$ eigenfunction, and $\omega_2 = 2\pi$, so
$$B_2\cdot 2\pi = 1 \implies B_2 = \frac{1}{2\pi}, \qquad B_m = 0 \text{ otherwise.}$$Final Solution:
$$\boxed{u(x,t) = 2\cos(3\pi t)\sin(\pi x) + \frac{1}{2\pi}\sin(2\pi t)\sin\!\left(\frac{2\pi x}{3}\right)}$$Practice Problems
Test your understanding with these multiple-choice questions. Click a choice to see if you're correct.
Q1: Why does the wave equation require two initial conditions, while the heat equation requires only one?
Answer: (C). Separation gives $Q'' + a^2\lambda Q = 0$, whose general solution $A_m\cos\omega_m t + B_m\sin\omega_m t$ carries two unknowns per mode. Two initial conditions — displacement $f$ and velocity $g$ — are exactly what is needed to pin them down. The heat equation's $Q' + K\lambda Q = 0$ has only one constant.
Q2: For $u_{tt} = 4u_{xx}$ on $0 < x < 4$ with fixed ends, what is the frequency $\omega_3$ of the third mode?
Answer: (A). $a = \sqrt{4} = 2$ and $L = 4$, so $\omega_m = \dfrac{m\pi a}{L} = \dfrac{2m\pi}{4} = \dfrac{m\pi}{2}$, giving $\omega_3 = \dfrac{3\pi}{2}$. Choice (D) confuses the frequency $\omega_m$ with the eigenvalue $\lambda_m = (m\pi/L)^2$.
Q3: Which formula gives $B_m$ from the velocity condition $u_t(x,0) = g(x)$?
Answer: (D). The sine series of $g$ has coefficients $B_m\omega_m = \dfrac{2}{L}\displaystyle\int_0^L g\sin\!\left(\frac{m\pi x}{L}\right)dx$. Dividing by $\omega_m = \dfrac{m\pi a}{L}$ cancels the $L$ and leaves $\dfrac{2}{m\pi a}$. Choice (A) is the formula for $A_m$; choice (C) multiplies by $\omega_m$ instead of dividing.
Q4: A string with fixed ends satisfies $u_{tt} = a^2u_{xx}$, $u(x,0) = \sin(2\pi x/L)$ and $u_t(x,0) = 0$. What is $u(x,t)$?
Answer: (B). Released from rest means $g \equiv 0$, so all $B_m = 0$ and only the $\cos(\omega_m t)$ part survives. Comparison gives $A_2 = 1$ with $\omega_2 = 2\pi a/L$. Choice (C) is the heat-equation answer — a wave does not decay.
Q5: What happens to the solution of the fixed-end wave equation as $t \to \infty$?
Answer: (D). The temporal factors are $\cos(\omega_m t)$ and $\sin(\omega_m t)$, which are bounded and periodic, not decaying exponentials. The undamped wave equation conserves energy, so the string vibrates indefinitely. Choices (A)-(C) all describe heat-equation behaviour.
Q6: For the mode $u_3(x,t) = \bigl[A_3\cos\omega_3 t + B_3\sin\omega_3 t\bigr]\sin(3\pi x/L)$, where are the interior nodes (points that never move)?
Answer: (C). Nodes occur where the spatial factor vanishes: $\sin(3\pi x/L) = 0 \Rightarrow 3\pi x/L = \pi, 2\pi$, i.e. $x = L/3$ and $x = 2L/3$ (in addition to the fixed ends). In general mode $m$ has $m-1$ interior nodes.