Section 6.4

The Wave Equation

Second-order in time • Two initial conditions • Oscillating solutions

1. Physical Setup and Governing Equation

The 1-D Wave 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

Why TWO Initial 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.

Full Problem Statement (Dirichlet BCs) $$\begin{cases} u_{tt} = a^2\,u_{xx},\qquad 0 < x < L,\; t > 0 \\[4pt] u(0,t) = u(L,t) = 0 \qquad \text{(fixed ends)} \\[4pt] u(x,0) = f(x),\quad u_t(x,0) = g(x) \qquad \text{(initial state)} \end{cases}$$

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).$$
Separate the Variables

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:

Spatial ODE (same as heat equation) $$P''(x) + \lambda P(x) = 0, \qquad P(0) = P(L) = 0.$$
Temporal ODE (now SECOND-order) $$Q''(t) + a^2\lambda\, Q(t) = 0.$$
Observation

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:

Case I: $\lambda < 0$

$P(x) = A\cosh(\alpha x) + B\sinh(\alpha x)$. BCs $P(0)=P(L)=0$ force $A = B = 0$. Trivial.

Case II: $\lambda = 0$

$P(x) = C_1 x + C_2$. BCs force $C_1 = C_2 = 0$. Trivial.

Case III: $\lambda > 0$ — NON-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).$$
Contrast with the Heat Equation

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:

General Solution — Wave Equation (Fixed Ends) $$\boxed{\;u(x,t) = \sum_{m=1}^{\infty}\!\left[A_m\,\cos\!\left(\frac{m\pi a}{L}\,t\right) + B_m\,\sin\!\left(\frac{m\pi a}{L}\,t\right)\right]\!\sin\!\left(\frac{m\pi x}{L}\right)\;}$$

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.\;}$$
Two ICs ⇒ Two Coefficients per Mode

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

7. Note: The d'Alembert Form

Alternative Representation

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

Example 1: $a^2 = 9$, $L=4$, $f(x) = x-1$, $g(x) = x$ — both ICs non-trivial
Problem $$\begin{cases} u_{tt} = 9\,u_{xx},\quad 0 < x < 4,\; t > 0 \\[4pt] u(0,t) = u(4,t) = 0 \\[4pt] u(x,0) = x - 1,\quad u_t(x,0) = x \end{cases}$$

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}.$$
Final Answer $$u(x,t) = \sum_{m=1}^{\infty}\!\left[-\frac{2(1+3(-1)^m)}{m\pi}\cos\!\frac{3m\pi t}{4} - \frac{32(-1)^m}{3m^2\pi^2}\sin\!\frac{3m\pi t}{4}\right]\!\sin\!\frac{m\pi x}{4}.$$

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$.

Example 2: Plucked string — $f(x) = \sin(\pi x/L)$, $g(x) = 0$
Problem $$\begin{cases} u_{tt} = a^2\,u_{xx} \\[4pt] u(0,t) = u(L,t) = 0 \\[4pt] u(x,0) = \sin(\pi x/L),\quad u_t(x,0) = 0 \end{cases}$$

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$.

Final Answer $$u(x,t) = \cos\!\left(\frac{\pi a}{L}\,t\right)\sin\!\left(\frac{\pi x}{L}\right).$$

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.

Example 3: Struck string — $f(x) = 0$, $g(x) = \sin(2\pi x/L)$
Problem $$\begin{cases} u_{tt} = a^2\,u_{xx} \\[4pt] u(0,t) = u(L,t) = 0 \\[4pt] u(x,0) = 0,\quad u_t(x,0) = \sin(2\pi x/L) \end{cases}$$

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$.

Final Answer $$u(x,t) = \frac{L}{2\pi a}\,\sin\!\left(\frac{2\pi a}{L}\,t\right)\sin\!\left(\frac{2\pi x}{L}\right).$$

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.

Practice 1: $u_{tt} = 4u_{xx}$ on $0<x<\pi$, $f(x) = 3\sin(2x)$, $g(x) = 5\sin(x)$
Problem $$\begin{cases} u_{tt} = 4\,u_{xx}, \quad 0 < x < \pi,\; t > 0 \\[4pt] u(0,t) = u(\pi,t) = 0 \\[4pt] u(x,0) = 3\sin(2x), \qquad u_t(x,0) = 5\sin(x)\end{cases}$$

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)}$$
Checks: $u(x,0) = 3\sin(2x)$ ✓. $u_t(x,0) = -12\sin(0)\sin 2x + 5\cos(0)\sin x = 5\sin x$ ✓. Both terms vanish at $x = 0,\pi$ ✓. And $u_{tt} = -48\cos(4t)\sin(2x) - 10\sin(2t)\sin(x) = 4u_{xx}$ ✓.
Practice 2 (struck string): $u_{tt} = u_{xx}$ on $0<x<1$, $f(x)=0$, $g(x) = x(1-x)$
Problem $$\begin{cases} u_{tt} = u_{xx}, \quad 0 < x < 1,\; t > 0 \\[4pt] u(0,t) = u(1,t) = 0 \\[4pt] u(x,0) = 0, \qquad u_t(x,0) = x(1-x)\end{cases}$$

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)}$$
Note the $m^{-4}$ decay. The velocity data contributes an extra factor of $1/\omega_m$ compared with displacement data, so velocity-driven series converge faster. The even modes are absent because $g$ is symmetric about $x = 1/2$, just as in the corresponding heat problem.
Practice 3: $u_{tt} = 9u_{xx}$ on $0<x<3$, $f(x) = 2\sin(\pi x)$, $g(x) = \sin(2\pi x/3)$
Problem $$\begin{cases} u_{tt} = 9\,u_{xx}, \quad 0 < x < 3,\; t > 0 \\[4pt] u(0,t) = u(3,t) = 0 \\[4pt] u(x,0) = 2\sin(\pi x), \qquad u_t(x,0) = \sin\!\left(\dfrac{2\pi x}{3}\right)\end{cases}$$

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)}$$
Watch the index bookkeeping. The displacement excites mode $m = 3$ and the velocity excites mode $m = 2$ — different modes, different frequencies, and they simply add. Each mode still satisfies the PDE on its own, so the sum does too by linearity.

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?

Q2: For $u_{tt} = 4u_{xx}$ on $0 < x < 4$ with fixed ends, what is the frequency $\omega_3$ of the third mode?

Q3: Which formula gives $B_m$ from the velocity condition $u_t(x,0) = g(x)$?

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)$?

Q5: What happens to the solution of the fixed-end wave equation as $t \to \infty$?

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)?