Wave Equation
The wave equation uₜₜ = c²uₓₓ describes the motion of a vibrating string. With both ends fixed, separation of variables gives u(x, t) = Σ [aₙ cos(nπct/L) + bₙ sin(nπct/L)] sin(nπx/L). The aₙ come from the starting shape, the bₙ from the starting velocity, and nothing decays: the string keeps vibrating.
Before this lesson: Heat Equation, Fourier Sine and Cosine Series and Partial Derivatives
What the wave equation says
Picture a guitar string stretched from x = 0 to x = L. Let u(x, t) be the string’s vertical displacement at position x and time t. For small vibrations, the wave equation is:
u_{tt} = c^2\,u_{xx},\qquad 0 \lt x \lt L,\quad t \gt 0The left side uₜₜ is the acceleration of a point on the string. The right side uses uₓₓ, the second partial derivative in x, which measures how curved the string is there. A bent part of the string is pulled back toward straight, so it accelerates in the direction of its concavity.
The constant c is the wave speed. For a string with tension T and mass per unit length ρ, c² = T/ρ. Watch the square: in uₜₜ = 9uₓₓ, the wave speed is c = 3, not 9.
Boundary and initial conditions
Fixed ends give the boundary conditions u(0, t) = 0 and u(L, t) = 0. The equation is second order in time, so it needs two initial conditions: the starting shape u(x, 0) = f(x) and the starting velocity uₜ(x, 0) = g(x). A plucked string starts with a shape and zero velocity; a struck string starts flat with a velocity.
Solving the wave equation by separation of variables
Look for solutions u = X(x)T(t). Substituting gives XT″ = c²X″T, and dividing by c²XT separates the variables:
\frac{T''}{c^2T} = \frac{X''}{X} = -\lambda- X″ + λX = 0 with X(0) = X(L) = 0. As in boundary value problems, λₙ = (nπ/L)² and Xₙ = sin(nπx/L).
- T″ + c²λₙT = 0. This is the equation of simple harmonic motion, so Tₙ = aₙ cos ωₙt + bₙ sin ωₙt with ωₙ = nπc/L.
- Add all the products XₙTₙ, then choose aₙ and bₙ to match both initial conditions.
u(x,t) = \sum_{n=1}^{\infty}\left(a_n\cos\frac{n\pi ct}{L} + b_n\sin\frac{n\pi ct}{L}\right)\sin\frac{n\pi x}{L}Setting t = 0 leaves Σ aₙ sin(nπx/L) = f(x), so the aₙ are the Fourier sine series coefficients of f. Differentiating in t and setting t = 0 leaves Σ bₙωₙ sin(nπx/L) = g(x), so bₙωₙ is the sine coefficient of g:
a_n = \frac{2}{L}\int_0^L f(x)\sin\frac{n\pi x}{L}\,dx,\qquad b_n = \frac{2}{n\pi c}\int_0^L g(x)\sin\frac{n\pi x}{L}\,dxNormal modes and frequencies
Each term of the series is a normal mode: a standing wave with n − 1 fixed points between the ends, oscillating at angular frequency ωₙ = nπc/L. Its frequency in cycles per second (hertz) is fₙ = ωₙ/(2π) = nc/(2L).
The lowest frequency f₁ = c/(2L) is the fundamental, and the others are whole-number multiples of it, called harmonics. That is why a string sounds like one musical note.
| Feature | Heat equation | Wave equation |
|---|---|---|
| Equation | u_t = k\,u_{xx} | u_{tt} = c^2u_{xx} |
| Initial conditions | one: u(x,0) | two: u(x,0) and u_t(x,0) |
| Time factor | e^{-k(n\pi/L)^2t}, decays | \cos\frac{n\pi ct}{L} and \sin\frac{n\pi ct}{L}, oscillates |
| Long-run behavior | settles to a steady state | keeps vibrating forever (no damping) |
Wave equation examples
Example 1: One normal mode
Solve uₜₜ = 4uₓₓ for 0 < x < π, with u(0, t) = u(π, t) = 0, u(x, 0) = 3 sin 2x and uₜ(x, 0) = 0.
c^2 = 4 \Rightarrow c = 2
Read the wave speed; c² is the coefficient.
L = \pi \Rightarrow \omega_n = \frac{n\pi c}{L} = 2nAngular frequencies for this string.
a_2 = 3,\quad a_n = 0 \text{ for } n \ne 2f(x) = 3 sin 2x is already a sine series.
b_n = 0
The starting velocity is 0.
u(x,t) = 3\cos 4t\,\sin 2x
ω₂ = 4.
u_{tt} = -48\cos 4t\,\sin 2xCheck: differentiate twice in t.
4u_{xx} = 4(-12\cos 4t\,\sin 2x) = -48\cos 4t\,\sin 2xDifferentiate twice in x and multiply by 4; the sides match.
Answer: u(x, t) = 3 cos 4t sin 2x. The string keeps the shape of sin 2x, and its height swings between 3 and −3 with period 2π/4 = π/2.
Example 2: A string struck from rest
Solve uₜₜ = 9uₓₓ for 0 < x < π with fixed ends, u(x, 0) = 0 and uₜ(x, 0) = 6 sin x + 12 sin 4x.
c = 3,\quad \omega_n = 3n
c² = 9 and L = π.
a_n = 0
The starting shape is flat.
b_1\omega_1 = 6 \Rightarrow 3b_1 = 6
Match the sin x term of g.
b_1 = 2
Divide both sides by 3.
b_4\omega_4 = 12 \Rightarrow 12b_4 = 12
Match the sin 4x term; ω₄ = 12.
b_4 = 1
Divide both sides by 12.
u(x,t) = 2\sin 3t\,\sin x + \sin 12t\,\sin 4x
Assemble the series.
u_t(x,0) = 6\cos 0\,\sin x + 12\cos 0\,\sin 4x = 6\sin x + 12\sin 4x
Check the starting velocity.
Answer: u(x, t) = 2 sin 3t sin x + sin 12t sin 4x. A common slip is to set b₁ = 6; the coefficient of g must be divided by ωₙ.
Example 3: A plucked string
A string of length π with c = 1 is pulled up at its middle into a triangle and released from rest: u(x, 0) = x for 0 ≤ x ≤ π/2, u(x, 0) = π − x for π/2 ≤ x ≤ π, and uₜ(x, 0) = 0. Find u(x, t).
a_n = \frac{2}{\pi}\left[\int_0^{\pi/2} x\sin nx\,dx + \int_{\pi/2}^{\pi}(\pi - x)\sin nx\,dx\right]Sine coefficient of f, split where the formula changes.
\int_0^{\pi/2} x\sin nx\,dx = -\frac{\pi}{2n}\cos\frac{n\pi}{2} + \frac{1}{n^2}\sin\frac{n\pi}{2}Use integration by parts with u = x, dv = sin nx dx.
\int_{\pi/2}^{\pi}(\pi - x)\sin nx\,dx = \frac{\pi}{2n}\cos\frac{n\pi}{2} + \frac{1}{n^2}\sin\frac{n\pi}{2}Integration by parts with u = π − x; the value at x = π is 0.
a_n = \frac{2}{\pi}\cdot\frac{2}{n^2}\sin\frac{n\pi}{2} = \frac{4}{\pi n^2}\sin\frac{n\pi}{2}Add: the cosine terms cancel.
\sin\frac{n\pi}{2} = 1, 0, -1, 0, 1, \ldotsValues for n = 1, 2, 3, 4, 5, …; even terms drop out.
b_n = 0,\quad \omega_n = n
Released from rest; c = 1 and L = π.
u(x,t) = \frac{4}{\pi}\left(\cos t\,\sin x - \frac{\cos 3t\,\sin 3x}{9} + \frac{\cos 5t\,\sin 5x}{25} - \cdots\right)Assemble the series.
Answer: u(x, t) = (4/π) Σ sin(nπ/2) cos nt sin nx / n². The coefficients shrink like 1/n², so the fundamental dominates. The graph shows the string at four times: the corner splits into two corners that travel apart, the string is flat at t = π/2, and it is an upside-down triangle at t = π.
Example 4: Starting shape and starting velocity
Solve uₜₜ = 9uₓₓ for 0 < x < 2 with fixed ends, u(x, 0) = 4 sin(πx/2) and uₜ(x, 0) = 3π sin πx. Then find the period of the motion.
c = 3,\quad L = 2 \Rightarrow \omega_n = \frac{3n\pi}{2}ωₙ = nπc/L.
a_1 = 4
f is the n = 1 mode, sin(πx/2).
\sin \pi x = \sin\frac{2\pi x}{2} \Rightarrow n = 2,\quad \omega_2 = 3\pig is the n = 2 mode.
3\pi\,b_2 = 3\pi
Match the coefficient of g.
b_2 = 1
Divide both sides by 3π.
u(x,t) = 4\cos\frac{3\pi t}{2}\sin\frac{\pi x}{2} + \sin 3\pi t\,\sin \pi xAssemble the two modes.
\frac{2\pi}{\omega_1} = \frac{2\pi}{3\pi/2} = \frac{4}{3},\qquad \frac{2\pi}{\omega_2} = \frac{2\pi}{3\pi} = \frac{2}{3}Period of each mode.
Answer: u(x, t) = 4 cos(3πt/2) sin(πx/2) + sin 3πt sin πx. The second mode repeats twice in 4/3 time units, so the whole motion repeats every 4/3 time units, the period of the fundamental.
Example 5: Tuning a guitar string (word problem)
A guitar string is 0.65 m long between its fixed ends, has mass per unit length ρ = 0.0004 kg/m, and is under tension T = 73.6 N. Find the wave speed, the fundamental frequency and the next two harmonics. Then find the new fundamental if the tension is raised by 21%.
c = \sqrt{\frac{T}{\rho}} = \sqrt{\frac{73.6}{0.0004}}Wave speed from tension and density.
= \sqrt{184000} \approx 428.9573.6 ÷ 0.0004 = 184,000; the speed is in m/s.
f_1 = \frac{c}{2L} \approx \frac{428.95}{1.3} \approx 329.96Fundamental frequency in Hz; 2L = 1.3 m.
f_2 = 2f_1 \approx 659.93,\quad f_3 = 3f_1 \approx 989.89
Harmonics are whole-number multiples of f₁.
f_1 \propto \sqrt{T} \Rightarrow f_{\text{new}} = \sqrt{1.21}\,f_1c = √(T/ρ), so f₁ grows like √T.
= 1.1 \cdot 329.96 \approx 362.96
√1.21 = 1.1.
Answer: c ≈ 429 m/s, f₁ ≈ 330 Hz (close to the note E), with harmonics near 660 Hz and 990 Hz. Raising the tension by 21% raises the pitch by 10%, to about 363 Hz.
Common mistakes
| Mistake | Example of the error | Fix |
|---|---|---|
| Using c² as the wave speed | Writing ωₙ = 9n for uₜₜ = 9uₓₓ on (0, π) | c = √9 = 3, so ωₙ = 3n. |
| Forgetting to divide by ωₙ | Setting b₁ = 6 in Example 2 | The sine coefficient of g equals bₙωₙ, so b₁ = 6/3 = 2. |
| Using only one initial condition | Ignoring uₜ(x, 0) and keeping only cosine terms | The equation is second order in t; match both f and g. |
| Expecting the vibration to decay | Writing e^(−4t) sin 2x in Example 1 | The time factors are cosines and sines; this model has no damping. |
| Mixing up angular frequency and hertz | Saying the string in Example 5 vibrates at 2073 Hz | Hertz is ωₙ/(2π) = nc/(2L). |
| Forgetting the cosine terms cancel in a symmetric pluck | Keeping the cos(nπ/2) parts in Example 3 | Add the two integrals before simplifying. |
Related ideas
D’Alembert’s solution
For a string with no ends (or before waves reach the ends), the solution can be written as two traveling waves:
u(x,t) = \frac{f(x - ct) + f(x + ct)}{2} + \frac{1}{2c}\int_{x-ct}^{x+ct} g(s)\,dsWith g = 0, the starting shape splits into two half-size copies, one moving right and one moving left at speed c. That is exactly the traveling corners in Example 3.
Each mode is simple harmonic motion
The time factor of each mode solves T″ + ωₙ²T = 0, the same equation as an undamped spring-mass system. A string is like infinitely many springs, one for each mode. In two dimensions, steady states satisfy Laplace’s Equation, the next lesson.
Practice problems
- Solve uₜₜ = 16uₓₓ for 0 < x < π with fixed ends, u(x, 0) = 5 sin 3x and uₜ(x, 0) = 0.
- Solve uₜₜ = uₓₓ for 0 < x < π with fixed ends, u(x, 0) = 0 and uₜ(x, 0) = 4 sin 2x.
- Solve uₜₜ = 4uₓₓ for 0 < x < 1 with fixed ends, u(x, 0) = sin πx and uₜ(x, 0) = 6π sin 3πx.
- Show that u = cos 5t sin 5x solves uₜₜ = uₓₓ.
- A string 0.5 m long has wave speed 200 m/s. Find its first three frequencies in hertz.
- The string in Example 5 is pressed down so that its vibrating length is 2/3 of the original. Find the new fundamental frequency.
- What is the period of the motion in Example 1?
- Use the first three nonzero terms of Example 3 to estimate u(π/2, 0), and compare with the exact value π/2.
- Solve uₜₜ = 9uₓₓ for 0 < x < π with fixed ends, u(x, 0) = 0 and uₜ(x, 0) = 1.
- Use d’Alembert’s solution to solve uₜₜ = 4uₓₓ on the whole line with u(x, 0) = e^(−x²) and uₜ(x, 0) = 0. Find u(2, 1).
Show answers
1.
c = 4,\quad \omega_3 = 3 \cdot 4 = 12
c² = 16 and L = π, so ωₙ = 4n.
u(x,t) = 5\cos 12t\,\sin 3x
a₃ = 5 and all bₙ = 0.
Answer: u(x, t) = 5 cos 12t sin 3x
2.
c = 1,\quad \omega_2 = 2
ωₙ = n.
2b_2 = 4
Match the sin 2x term of g.
b_2 = 2
Divide both sides by 2.
Answer: u(x, t) = 2 sin 2t sin 2x
3.
c = 2,\quad L = 1 \Rightarrow \omega_n = 2n\pi
ωₙ = nπc/L.
a_1 = 1
f is the n = 1 mode.
6\pi\,b_3 = 6\pi
g is the n = 3 mode and ω₃ = 6π.
b_3 = 1
Divide both sides by 6π.
Answer: u(x, t) = cos 2πt sin πx + sin 6πt sin 3πx
4.
u_{tt} = -25\cos 5t\,\sin 5xDifferentiate twice in t.
u_{xx} = -25\cos 5t\,\sin 5xDifferentiate twice in x.
Answer: uₜₜ = uₓₓ, so the function is a solution
5.
f_1 = \frac{c}{2L} = \frac{200}{1} = 2002L = 1 m.
f_2 = 400,\quad f_3 = 600
Multiply f₁ by 2 and 3.
Answer: 200 Hz, 400 Hz and 600 Hz
6.
f_{\text{new}} = \frac{c}{2(2L/3)} = \frac{3}{2}f_1Same c, length multiplied by 2/3.
\approx 1.5 \cdot 329.96 \approx 494.94
Use f₁ from Example 5.
Answer: about 495 Hz (close to the note B)
7.
\frac{2\pi}{\omega_2} = \frac{2\pi}{4} = \frac{\pi}{2}The only mode has ω₂ = 4.
Answer: π/2 time units
8.
u\left(\frac{\pi}{2},0\right) \approx \frac{4}{\pi}\left(1 + \frac{1}{9} + \frac{1}{25}\right)At x = π/2, each sin(nπ/2) sin(nπ/2) = 1 for odd n.
\approx 1.27324 \cdot 1.15111 \approx 1.4656
4/π ≈ 1.27324.
Answer: about 1.466, compared with π/2 ≈ 1.571; more terms close the gap
9.
b_n\omega_n = \frac{2}{\pi}\int_0^{\pi}\sin nx\,dx = \frac{4}{n\pi} \text{ (n odd)},\ 0 \text{ (n even)}Sine coefficients of g = 1.
\omega_n = 3n \Rightarrow b_n = \frac{4}{3\pi n^2} \text{ (n odd)}Divide by ωₙ = 3n.
Answer: u(x, t) = (4/(3π)) Σ over odd n of sin 3nt sin nx / n²
10.
u(x,t) = \frac{e^{-(x-2t)^2} + e^{-(x+2t)^2}}{2}c = 2 and g = 0 in d’Alembert’s formula.
u(2,1) = \frac{e^{0} + e^{-16}}{2}x − 2t = 0 and x + 2t = 4.
\approx \frac{1 + 0.0000001}{2} \approx 0.5e^(−16) ≈ 1.1 × 10⁻⁷.
Answer: about 0.5; the right-moving half of the bump is centered at x = 2 when t = 1
Wave equation FAQ
What is the wave equation?
It is the partial differential equation uₜₜ = c²uₓₓ. It says the acceleration of each point is proportional to how curved the string is there, and it models vibrating strings, sound waves and other waves.
How do you solve the wave equation with separation of variables?
Write u = X(x)T(t), solve the eigenvalue problem for X from the boundary conditions, and solve T″ + c²λT = 0 to get cosines and sines in time. Then match the starting shape and starting velocity with Fourier sine series.
What does c mean in the wave equation?
c is the speed at which waves travel along the string. For a string, c = √(T/ρ), so a tighter or lighter string carries waves faster and sounds higher.
What is the difference between the heat equation and the wave equation?
The heat equation has a first derivative in time, so its solutions decay to a steady state. The wave equation has a second derivative in time, so its solutions oscillate and need both a starting shape and a starting velocity.
Summary
- The wave equation uₜₜ = c²uₓₓ models a vibrating string with wave speed c.
- It needs two initial conditions: the starting shape f and the starting velocity g.
- With fixed ends, u = Σ (aₙ cos ωₙt + bₙ sin ωₙt) sin(nπx/L) with ωₙ = nπc/L.
- aₙ is the sine coefficient of f; bₙ is the sine coefficient of g divided by ωₙ.
- Each normal mode has frequency nc/(2L) hertz, and the motion never decays.
Previous lesson: Heat Equation
Next lesson: Laplace’s Equation
Back to the Differential Equations Index