---
title: The wave equation and d'Alembert's solution
heading: Shapes that travel, and the notes a string can play
eyebrow: A12 · Lesson 31 · The wave equation and d'Alembert's solution
xp: 40
---

::: hook
The wave equation, $u_{tt} = c^2u_{xx}$, governs a vibrating string, sound in a pipe, and the voltage on a lossless transmission line (C10's telegrapher's equations reduce to it). It has a solution so simple it can be written in one line: any shape moving right at speed c plus any shape moving left. On a string fixed at both ends, separation of variables gives instead a set of standing waves, the string's natural modes, with frequencies in whole-number ratios: the harmonics that make a guitar sound like a guitar. The two pictures, traveling and standing, are the same solution written two ways.
:::

::: play
- A string, released from rest with a bump in the middle, obeys $u = \frac12[f(x - ct) + f(x + ct)]$: the bump splits into two half-height copies that travel apart at speed c without changing shape.
- Advance t and watch the halves separate; change c and they move faster or slower.
- This is a long string, so they never come back; on a string fixed at its ends they'd reflect, inverted, and recombine.
:::
:::

```sim plot
view: graph
x: x = -4..4 m
y: u = -0.3..1.2
slider: t = 0..3 step 0.01 = 0.3 s
slider: c = 0.5..2 step 0.1 = 1 m/s
plot: 0.5*(exp(-(x - c*t)^2/0.1) + exp(-(x + c*t)^2/0.1)) | samples: 800 | label: u(x, t)
plot: exp(-x^2/0.1) | dashed | label: the initial bump
readout: each half's distance from the start, m = c*t
```

::: predict
## A string fixed at both ends has its fundamental at 220 Hz. What's its third harmonic?

- [ ] 330 Hz
- [x] 660 Hz
- [ ] 1980 Hz
- [ ] 440 Hz

::: reveal
660 Hz: the modes $\sin(n\pi x/L)\cos(n\pi ct/L)$ have frequencies $f_n = \frac{nc}{2L} = nf_1$, whole-number multiples of the fundamental. That's why a string's overtones sound musical; a drum's (lesson 39) aren't whole multiples, and it sounds like a thud.
:::
:::

::: nameit
## d'Alembert's solution

Every solution of $u_{tt} = c^2u_{xx}$ on the whole line has the form

$$u(x, t) = F(x - ct) + G(x + ct)$$

a shape moving right plus a shape moving left at speed c. Fitting $u(x, 0) = f(x)$ and $u_t(x, 0) = g(x)$:

$$u = \frac{f(x - ct) + f(x + ct)}{2} + \frac{1}{2c}\int_{x - ct}^{x + ct}g(s)\,ds$$

## A string with fixed ends

Separation of variables on $0 < x < L$ with $u = 0$ at both ends gives

$$u = \sum_{n=1}^{\infty}\sin\frac{n\pi x}{L}\left(a_n\cos\frac{n\pi ct}{L} + b_n\sin\frac{n\pi ct}{L}\right)$$

with $a_n$ the sine coefficients of the initial shape and $b_n$ from the initial velocity. Mode n vibrates at $f_n = nc/(2L)$.

## Speeds

| System | Wave speed |
|---|---|
| string, tension T, mass per length μ | $\sqrt{T/\mu}$ |
| lossless line, L′ and C′ per length | $1/\sqrt{L'C'}$ |
| sound in air | about 343 m/s |

## A plucked string

Pulled to height h at its center and released, it has $a_n = \frac{8h}{n^2\pi^2}\sin\frac{n\pi}{2}$: odd harmonics only, falling as $1/n^2$. Plucking near an end brings in the even ones and brightens the sound.
:::

::: example
## A guitar string is 0.65 m long, with tension 70 N and mass 0.4 g/m. What's its fundamental?

::: solution
1. **Wave speed.**
   $$\begin{aligned} c &= \sqrt{\frac{70}{4 \times 10^{-4}}}\ \text{m/s} \\ &= 418\ \text{m/s} \end{aligned}$$
2. **Fundamental.**
   $$\begin{aligned} f_1 &= \frac{c}{2L} \\ &= \frac{418}{1.3}\ \text{Hz} \\ &= 322\ \text{Hz} \end{aligned}$$

**Answer:** the fundamental is 322 Hz.
:::
:::

::: example
## A coax has L′ = 250 nH/m and C′ = 100 pF/m. How fast do signals travel, and what's the lowest resonance of a 2 m length with both ends shorted?

::: solution
1. **Signal speed.**
   $$\begin{aligned} v &= \frac{1}{\sqrt{L'C'}} \\ &= \frac{1}{\sqrt{250 \times 10^{-9} \times 100 \times 10^{-12}}} \\ &= 2.0 \times 10^8\ \text{m/s} \end{aligned}$$
2. **Lowest resonance.** Shorted ends force zero voltage there, like fixed string ends, so
   $$\begin{aligned} f_1 &= \frac{v}{2L} \\ &= 50\ \text{MHz} \end{aligned}$$

**Answer:** signals travel at $2.0 \times 10^8$ m/s, and the lowest resonance is 50 MHz.
:::
:::

::: example
## A guitar string is plucked a quarter of the way along. Which harmonics are missing, and how strong are the second and third compared with the fundamental?

::: solution
1. **Mode amplitudes.** Plucking at $x = a$ to height h gives
   $$b_n = \frac{2hL^2\sin(n\pi a/L)}{n^2\pi^2a(L - a)}$$
2. **Put in a = L/4.**
   $$b_n = \frac{32h}{3\pi^2n^2}\sin\frac{n\pi}{4}$$
3. **Missing harmonics.** $\sin(n\pi/4)$ is zero for n = 4, 8, 12, …, so those harmonics are missing: a mode with a node at the plucking point can't be excited there.
4. **The second harmonic.**
   $$\begin{aligned} \frac{b_2}{b_1} &= \frac{1/4}{\sin 45°} \\ &= 0.354 \end{aligned}$$
5. **The third harmonic.**
   $$\begin{aligned} \frac{b_3}{b_1} &= \frac{\sin 135°/9}{\sin 45°} \\ &= \frac19 \\ &= 0.111 \end{aligned}$$
6. **Other plucking points.** Plucking at the center would remove every even harmonic; plucking near the bridge keeps more high harmonics, which is why it sounds brighter.

**Answer:** harmonics 4, 8, 12, … are missing; the second is 0.354 of the fundamental and the third 0.111.
:::
:::

::: check
given: f1 = 110 | 220 | 330; n = 2 | 3 | 5
answer: n*f1
unit: Hz
tolerance: 0.5%

## A string's fundamental is {f1} Hz. What's harmonic n = {n}?

::: right
Right. {answer} Hz.
:::

::: misses
- [any] Not yet. $f_n = nf_1$.
:::
:::

::: check
given: T = 50 | 100 | 200; mu = 0.0002 | 0.001; L = 0.5 | 1
answer: sqrt(T/mu)/(2*L)
unit: Hz
tolerance: 0.5%

## A string of length {L} m, tension {T} N and mass {mu} kg/m: what's its fundamental?

::: right
Right. $\frac{1}{2L}\sqrt{T/\mu}$ = {answer} Hz.
:::

::: misses
- [sqrt(T/mu)/L] A fixed string's fundamental is half a wavelength long: divide by 2L.
- [any] Not yet. $f_1 = c/(2L)$ with $c = \sqrt{T/\mu}$.
:::
:::

::: check
given: Lp = 250 | 400; Cp = 100 | 66; len = 1 | 5
answer: 1/sqrt(Lp*1e-9*Cp*1e-12)/(2*len)/1e6
unit: MHz
tolerance: 0.5%

## A line with L′ = {Lp} nH/m and C′ = {Cp} pF/m is {len} m long and shorted at both ends. What's its lowest resonant frequency?

::: right
Right. $v/(2L)$ = {answer} MHz.
:::

::: misses
- [1/sqrt(Lp*1e-9*Cp*1e-12)/len/1e6] Shorted at both ends, the line holds half a wavelength: divide by 2L.
- [any] Not yet. $v = 1/\sqrt{L'C'}$, then $v/(2L)$.
:::
:::

::: check
given: c = 2 | 340; t = 0.5 | 2
answer: c*t
unit: m
tolerance: 0.5%

## A bump on a long string splits in two, traveling at {c} m/s. How far from the start is each half after {t} s?

::: right
Right. $ct$ = {answer} m.
:::

::: misses
- [c*t/2] Each half moves at the full speed c; only the height halves.
- [any] Not yet. Distance = ct.
:::
:::

::: check
given: h = 1 | 5 | 10; n = 1 | 3 | 5
answer: 8*h/(n^2*pi^2)*sin(n*pi/2)
unit: mm
tolerance: 0.5%

## A string plucked to height {h} mm at its center: what's the amplitude of mode n = {n}, in mm?

::: right
Right. $\frac{8h}{n^2\pi^2}\sin\frac{n\pi}{2}$ = {answer}.
:::

::: misses
- [any] Not yet. $\frac{8h}{n^2\pi^2}\sin\frac{n\pi}{2}$.
:::
:::

::: check
kind: choice

## A string plucked exactly at its center: which harmonics does it produce?

- [ ] All of them
- [x] Only the odd ones
- [ ] Only the even ones
- [ ] Only the fundamental

::: misses
- [1] The center is a node of every even mode, so plucking there can't excite them.
- [3] It's the even ones that are missing.
- [4] A triangle isn't a pure sine; it has many harmonics.
:::
:::

::: check
kind: parts
given: p = 0.2 | 0.25 | 0.4; h = 2 | 5

## A string is plucked to height {h} mm at a fraction {p} of its length from one end. Mode n has amplitude $b_n = \frac{2h\sin(n\pi p)}{n^2\pi^2p(1 - p)}$.

::: part
answer: 2*h*sin(pi*p)/(pi^2*p*(1 - p))
unit: mm
tolerance: 0.5%

### What is the fundamental's amplitude?

::: misses
- [8*h/pi^2] That's for a pluck at the center.
- [any] Put n = 1 in the formula.
:::
:::

::: part
answer: 2*h*sin(2*pi*p)/(4*pi^2*p*(1 - p))
unit: mm
tolerance: 0.5%

### What is the second harmonic's amplitude?

::: misses
- [any] Put n = 2: the $n^2$ below gives 4.
:::
:::
:::

::: check
kind: derivation
vars: x = -3..3, c = 0.5..2, t = 0..2

## A long string starts at rest with the shape $u(x, 0) = e^{-x^2}$, and waves travel at c.

::: step
answer: (exp(-(x - c*t)^2) + exp(-(x + c*t)^2))/2

### By d'Alembert's formula, what is u(x, t)?
:::

::: step
answer: exp(-(c*t)^2)

### What is u at x = 0, once the two halves have moved apart?
:::

::: right
Right. The bump splits into two half-height copies moving apart at c; the middle sees only their tails.
:::
:::

::: explain
## How can the same vibration of a fixed string be described both as two traveling waves and as a sum of standing waves?

::: model
d'Alembert's form writes the motion as a shape moving right plus one moving left; at each fixed end they reflect into each other, inverted, so the end stays still. A standing wave $\sin(kx)\cos(\omega t)$ is itself the sum of two traveling sines, $\frac12[\sin(k(x - ct)) + \sin(k(x + ct))]$, by the product-to-sum identity. So expanding the traveling shapes in sines turns them into standing modes, and adding up standing modes rebuilds the traveling shapes. Both are exact; the traveling picture shows where pulses go, and the modal picture shows which frequencies are present.
:::
:::

::: practice

::: check
given: f1 = 82 | 196; n = 4 | 6
answer: n*f1
unit: Hz
tolerance: 0.5%

## Harmonic {n} of a {f1} Hz string?

::: misses
- [any] $nf_1$.
:::
:::

::: check
given: T = 60 | 150; mu = 0.0005 | 0.002; L = 0.6 | 0.8
answer: sqrt(T/mu)/(2*L)
unit: Hz
tolerance: 0.5%

## Fundamental: {L} m, {T} N, {mu} kg/m?

::: misses
- [any] $\sqrt{T/\mu}/(2L)$.
:::
:::

::: check
given: h = 2 | 8; n = 3 | 7
answer: 8*h/(n^2*pi^2)*sin(n*pi/2)
tolerance: 0.5%

## Mode {n} amplitude for a center pluck of {h} mm?

::: misses
- [any] $\frac{8h}{n^2\pi^2}\sin\frac{n\pi}{2}$.
:::
:::
:::
