MATH-336 · Lesson 8 of 12 · 25 min

The wave equation: d'Alembert's solution and standing waves

The wave equation \(u_{tt} = c^2u_{xx}\) has two complementary exact solutions. One, found by d'Alembert in 1747, writes every solution as a sum of two travelling waves and makes the finite speed of propagation visible. The other, the method of Daniel Bernoulli and later Fourier, writes the motion of a string with fixed ends as a superposition of standing waves, the vibration modes whose frequencies we hear as a musical note and its overtones. This lesson develops both, shows that they agree, and proves that the wave equation conserves energy, the property that sets it apart from the heat equation.

d'Alembert's formula

Lesson 3 reduced the wave equation, in the characteristic variables \(\xi = x + ct\) and \(\eta = x - ct\), to \(u_{\xi\eta} = 0\), whose general solution is \(u = F(x + ct) + G(x - ct)\). On the whole line, with initial displacement \(f\) and initial velocity \(g\), the conditions are

\[F(x) + G(x) = f(x), \qquad c\,F'(x) - c\,G'(x) = g(x)\]

Integrating the second, \(F(x) - G(x) = \frac1c\int_0^x g(s)\,ds + K\) for a constant \(K\). Solving the two linear equations for \(F\) and \(G\) and substituting gives d'Alembert's formula

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

The constant \(K\) cancels. The formula shows existence and uniqueness at once, and continuous dependence too: if the data change by at most \(\varepsilon\) in \(f\) and \(\delta\) in \(g\), the solution changes by at most \(\varepsilon + \delta t\). If \(f\) is twice differentiable and \(g\) once, \(u\) is a classical solution. If \(f\) has corners, the formula still makes sense and describes corners travelling along the characteristics, the generalized solutions Euler insisted on in 1748 against d'Alembert's objections.

Four stacked snapshots of a string on 0 to 1 at times 0, 0.1, 0.25 and 0.4. At time 0 there is a single triangular bump of height 1 at the centre. At time 0.1 it has begun to split into two overlapping halves. At 0.25 and 0.4 there are two separate triangular bumps of height one half moving apart to the left and right.
A triangular displacement released from rest splits into two half-height copies travelling at speed \(c = 1\) in opposite directions, as \(\frac12 f(x - ct) + \frac12 f(x + ct)\) predicts

Domains of dependence and influence

d'Alembert's formula shows that \(u(x_0, t_0)\) depends only on the initial data in the interval \([x_0 - ct_0, x_0 + ct_0]\), the domain of dependence, bounded by the two characteristics through \((x_0, t_0)\). Conversely, initial data at a point \(x_1\) can only affect the solution in the wedge \(|x - x_1| \le ct\), the domain of influence. Signals travel at exactly speed \(c\), no faster. This is the sharpest difference from the heat equation, where data at any point affect the solution everywhere immediately. In one dimension the integral of \(g\) means that an initial velocity impulse leaves a permanent displacement behind the wave fronts; in three dimensions, by contrast, Huygens' principle holds and a sharp signal passes cleanly, which is why we hear speech as distinct sounds rather than a lingering smear.

Worked problem

A struck string

An infinite string at rest is struck so that \(f = 0\) and \(g(x) = 1\) for \(|x| < 1\), zero otherwise. Describe \(u(0, t)\) and \(u(3, t)\) with \(c = 1\).

Show solution
  1. \(u(x, t) = \frac12\times\) length of \([x - t, x + t] \cap [-1, 1]\).
  2. At \(x = 0\): for \(t \le 1\) the overlap is \(2t\), so \(u = t\); for \(t \ge 1\) it is 2, so \(u = 1\).
  3. At \(x = 3\): the interval \([3 - t, 3 + t]\) first meets \([-1, 1]\) at \(t = 2\); the overlap is \(t - 2\) for \(2 \le t \le 4\) and 2 after.

Answer: The centre rises linearly to 1 and stays there. The point \(x = 3\) stays at rest until \(t = 2\), the time for a signal to travel from the edge of the struck region, then rises to 1. The permanent displacement is the one-dimensional failure of Huygens' principle.

The finite string and reflections

For a string of length \(L\) fixed at both ends, \(u(0, t) = u(L, t) = 0\). Extend \(f\) and \(g\) to the whole line as odd functions about 0 and \(2L\)-periodic. Then d'Alembert's formula, applied to the extended data, automatically satisfies the boundary conditions: at \(x = 0\), \(f(-ct) + f(ct) = 0\) by oddness and the integral of an odd function over \([-ct, ct]\) is zero. Physically, a wave arriving at a fixed end reflects upside down, and the reflected wave is the contribution of the image data. The motion is periodic in time with period \(2L/c\), the time for a disturbance to travel to the far end and back twice reflected.

Separation of variables and standing waves

Now apply the method of lesson 7. Writing \(u = X(x)T(t)\) in \(u_{tt} = c^2u_{xx}\) gives \(T''/(c^2T) = X''/X = -\lambda\). The spatial problem \(X'' + \lambda X = 0\), \(X(0) = X(L) = 0\) is exactly the one solved before, with eigenvalues \(\lambda_n = (n\pi/L)^2\) and eigenfunctions \(\sin(n\pi x/L)\). The time equation is now second order, \(T'' + c^2\lambda_nT = 0\), with oscillating solutions. Writing \(\omega_n = n\pi c/L\),

\[u(x, t) = \sum_{n=1}^\infty\big(A_n\cos\omega_nt + B_n\sin\omega_nt\big)\sin\frac{n\pi x}{L}, \qquad A_n = \frac2L\int_0^L f\sin\frac{n\pi x}{L}\,dx, \quad B_n = \frac{2}{\omega_nL}\int_0^L g\sin\frac{n\pi x}{L}\,dx\]

The coefficients follow from \(u(x, 0) = \sum A_n\sin(n\pi x/L)\) and \(u_t(x, 0) = \sum \omega_nB_n\sin(n\pi x/L)\). Each term is a standing wave: a fixed shape \(\sin(n\pi x/L)\) whose amplitude oscillates in time with angular frequency \(\omega_n\). Mode \(n\) has \(n - 1\) interior nodes, points that never move, at \(x = kL/n\). The product-to-sum identity \(\sin a\cos b = \frac12[\sin(a + b) + \sin(a - b)]\) writes each standing wave as two travelling waves moving in opposite directions, which is how the series and d'Alembert's formula agree.

Three panels showing modes 1, 2 and 3 of a string fixed at both ends. Each panel shows the mode shape at three moments in its oscillation, as solid, dashed and dotted curves of decreasing amplitude. Mode 1 is a single arch; mode 2 has one red node dot at the centre; mode 3 has two red node dots at one third and two thirds.
The first three standing waves \(\sin(n\pi x/L)\cos\omega_nt\), shown at three phases; the red dots are nodes, which stay at rest

Music and the harmonic series

The frequencies \(\nu_n = \omega_n/(2\pi) = nc/(2L)\) are whole-number multiples of the fundamental \(\nu_1 = c/(2L) = \frac{1}{2L}\sqrt{T/\rho}\). This formula contains Mersenne's laws of 1636: the pitch of a string is inversely proportional to its length, proportional to the square root of its tension, and inversely proportional to the square root of its density. A guitar's open A string, 0.65 m long, sounds at 110 Hz, so \(c = 2L\nu_1 = 143\) m/s. Pressing a fret halves the vibrating length at the twelfth fret and doubles the frequency, an octave. Because the overtones are integer multiples of the fundamental, a string's sound is periodic and has a clear pitch, unlike a drum, whose overtones (lesson 10) are not integer multiples.

Where the string is plucked determines the mix of overtones. A string plucked at a distance \(a\) from one end into a triangle of height \(h\) has

\[A_n = \frac{2hL^2}{n^2\pi^2a(L - a)}\sin\frac{n\pi a}{L}\]

so every mode with a node at the plucking point is missing. Plucking at the centre removes all even harmonics, giving a hollow tone; plucking near the bridge, as guitarists do for a bright sound, keeps many high harmonics. The \(1/n^2\) decay reflects the corner at the plucking point; a hammer blow, as in a piano, gives initial velocity and coefficients that decay more slowly.

Energy conservation

The kinetic energy of a string is \(\frac12\int \rho u_t^2\,dx\), and its potential energy, the work done stretching it against tension, is \(\frac12\int Tu_x^2\,dx\) to leading order. Dividing by \(\rho\), define

\[E(t) = \frac12\int_0^L \big(u_t^2 + c^2u_x^2\big)\,dx\]

Differentiate and use the PDE: \(E'(t) = \int_0^L (u_tu_{tt} + c^2u_xu_{xt})\,dx = c^2\int_0^L (u_tu_{xx} + u_xu_{xt})\,dx = c^2\int_0^L (u_tu_x)_x\,dx = c^2\big[u_tu_x\big]_0^L\). At a fixed end \(u = 0\) for all time, so \(u_t = 0\) there and the boundary term vanishes. The same holds at a free end, where \(u_x = 0\). So \(E(t) = E(0)\): energy is conserved. In terms of the modes, orthogonality gives \(E = \frac L4\sum \omega_n^2(A_n^2 + B_n^2)\), constant because each mode keeps its own energy forever. Energy conservation also proves uniqueness, by the argument of lesson 1: the difference of two solutions with the same data has zero energy at all times, so it is constant, and hence zero.

Real strings lose energy to air resistance and to the instrument's body, which is what makes the sound audible. With damping, \(u_{tt} + \gamma u_t = c^2u_{xx}\), the same calculation gives \(E' = -\gamma\int u_t^2\,dx \le 0\), and each mode decays like \(e^{-\gamma t/2}\) while oscillating at a slightly reduced frequency.

Worked problem

Energy of a plucked string

A string with \(L = 1\), \(c = 1\) is plucked at its centre to height \(h\) and released from rest. Compute its energy directly and from the modes.

Show solution
  1. Directly at \(t = 0\): \(u_t = 0\) and \(u_x = \pm 2h\), so \(E = \frac12\int_0^1 4h^2\,dx = 2h^2\).
  2. From the modes: \(A_n = \frac{8h}{n^2\pi^2}\sin\frac{n\pi}{2}\) and \(\omega_n = n\pi\), so \(E = \frac14\sum_{n \text{ odd}} n^2\pi^2\cdot\frac{64h^2}{n^4\pi^4} = \frac{16h^2}{\pi^2}\sum_{n \text{ odd}}\frac1{n^2}\).
  3. With \(\sum_{n \text{ odd}} 1/n^2 = \pi^2/8\), this is \(2h^2\).

Answer: Both give \(2h^2\). The fundamental carries \(16/\pi^2 \div 2 \approx 81\) hundredths of the energy, the third harmonic 9 hundredths and the fifth about 3 hundredths.

Comparing the two solutions numerically

The program evaluates the plucked string at several times by d'Alembert's formula, using the odd periodic extension, and by the standing wave series, then tracks the energy computed by finite differences from the d'Alembert solution.

The plucked string by d'Alembert's formula with reflections and by the standing wave series agree; the energy stays fixed as kinetic and potential energy trade places
import math

L, c, h, a = 1.0, 1.0, 0.02, 0.25          # plucked at a quarter of the length

def f0(x):                                 # triangle on [0, L]
    return h * x / a if x <= a else h * (L - x) / (L - a)
def f(x):                                  # odd, 2L-periodic extension
    x = (x + L) % (2 * L) - L
    return f0(x) if x >= 0 else -f0(-x)

def dalembert(x, t):
    return 0.5 * (f(x - c * t) + f(x + c * t))

def A(n):
    return 2 * h * L * L / (n * n * math.pi ** 2 * a * (L - a)) * math.sin(n * math.pi * a / L)
def series(x, t, N=2000):
    return sum(A(n) * math.cos(n * math.pi * c * t / L) * math.sin(n * math.pi * x / L) for n in range(1, N + 1))

print("A_1..A_8 (x1000):", " ".join(f"{1000 * A(n) + 0.0:+.3f}" for n in range(1, 9)), " (A_4 = A_8 = 0: node at x = a)")
for t in (0.0, 0.3, 0.75, 1.0, 2.0):
    xs = (0.1, 0.25, 0.5, 0.9)
    d = [dalembert(x, t) for x in xs]
    s = [series(x, t) for x in xs]
    print(f"t = {t:4.2f}: d'Alembert " + " ".join(f"{v:+.5f}" for v in d) + " | series " + " ".join(f"{v:+.5f}" for v in s))

def energy(t, M=4000, dx=1e-6, dt=1e-6):
    tot = 0.0
    for j in range(M):
        x = (j + 0.5) * L / M
        ut = (dalembert(x, t + dt) - dalembert(x, t - dt)) / (2 * dt)
        ux = (dalembert(x + dx, t) - dalembert(x - dx, t)) / (2 * dx)
        tot += 0.5 * (ut * ut + c * c * ux * ux) * L / M
    return tot
exact = 0.5 * c * c * (h * h / a + h * h / (L - a))
for t in (0.0, 0.13, 0.5, 1.37):
    print(f"energy at t = {t:4.2f}: {energy(t):.6e}   (exact {exact:.6e})")
print(f"period 2L/c = {2 * L / c}: u(0.1, 2.0) equals u(0.1, 0) = {f0(0.1):.5f}")
Output
A_1..A_8 (x1000): +15.284 +5.404 +1.698 +0.000 -0.611 -0.600 -0.312 -0.000  (A_4 = A_8 = 0: node at x = a)
t = 0.00: d'Alembert +0.00800 +0.02000 +0.01333 +0.00267 | series +0.00800 +0.01999 +0.01333 +0.00267
t = 0.30: d'Alembert +0.00000 +0.00400 +0.01067 +0.00267 | series +0.00000 +0.00400 +0.01067 +0.00267
t = 0.75: d'Alembert -0.00267 -0.00667 -0.01333 -0.00267 | series -0.00267 -0.00667 -0.01333 -0.00267
t = 1.00: d'Alembert -0.00267 -0.00667 -0.01333 -0.00800 | series -0.00267 -0.00667 -0.01333 -0.00800
t = 2.00: d'Alembert +0.00800 +0.02000 +0.01333 +0.00267 | series +0.00800 +0.01999 +0.01333 +0.00267
energy at t = 0.00: 1.066667e-03   (exact 1.066667e-03)
energy at t = 0.13: 1.066667e-03   (exact 1.066667e-03)
energy at t = 0.50: 1.066667e-03   (exact 1.066667e-03)
energy at t = 1.37: 1.066667e-03   (exact 1.066667e-03)
period 2L/c = 2.0: u(0.1, 2.0) equals u(0.1, 0) = 0.00800

The two solutions agree to about five decimal places (the series is truncated at 2,000 terms), the missing fourth and eighth harmonics confirm the node rule, and the energy is the same at every time sampled. At \(t = 1 = L/c\) the shape is turned upside down and reflected end to end, \(u(x, 1) = -f(L - x)\), and at \(t = 2\) it has returned exactly to its starting position.

Common mistakes

  • MistakeForgetting the factor \(\frac1{2c}\) in front of the velocity integral.

    InsteadFrom \(F - G = \frac1c\int g\), the velocity term is \(\frac{1}{2c}\int_{x - ct}^{x + ct} g\).

  • MistakeUsing an even extension for fixed ends.

    InsteadFixed ends need the odd extension, which reflects waves upside down; free ends use the even extension.

  • MistakeWriting \(B_n\) without the factor \(1/\omega_n\).

    InsteadThe velocity series is \(\sum\omega_nB_n\sin(n\pi x/L)\), so \(B_n\) is the sine coefficient of \(g\) divided by \(\omega_n\).

  • MistakeExpecting energy to decay as for heat.

    InsteadThe wave equation conserves \(\frac12\int(u_t^2 + c^2u_x^2)\); only damping removes energy.

  • MistakeThinking a 1D struck string returns to rest after the wave passes.

    InsteadAn initial velocity leaves a permanent displacement in one dimension; Huygens' principle holds only in odd dimensions of three or more.

Summary and key terms

  • d'Alembert: \(u = \frac12(f(x - ct) + f(x + ct)) + \frac{1}{2c}\int_{x-ct}^{x+ct}g\), a sum of left- and right-moving waves.
  • Signals travel at speed \(c\): the domain of dependence of \((x, t)\) is \([x - ct, x + ct]\).
  • Fixed ends correspond to odd periodic extension; waves reflect inverted and the motion has period \(2L/c\).
  • Separation gives standing waves \(\sin(n\pi x/L)\) with frequencies \(nc/(2L)\), the harmonic series of musical strings.
  • Energy \(\frac12\int(u_t^2 + c^2u_x^2)\,dx\) is conserved with fixed or free ends.
d'Alembert's formula
The explicit solution of the wave equation on the line in terms of initial displacement and velocity.
domain of dependence
The part of the initial line whose data determine the solution at a given point.
standing wave
A solution whose shape is fixed and whose amplitude oscillates in time.
node
A point of a standing wave that does not move.
fundamental frequency
The lowest frequency \(c/(2L)\) of a string fixed at both ends.
energy
\(\frac12\int(u_t^2 + c^2u_x^2)\,dx\), the conserved sum of kinetic and potential energy.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. Solve \(u_{tt} = 4u_{xx}\) on the line with \(u(x, 0) = e^{-x^2}\), \(u_t(x, 0) = 0\).

    Show answer

    \(u = \frac12(e^{-(x - 2t)^2} + e^{-(x + 2t)^2})\).

  2. Solve \(u_{tt} = u_{xx}\) on the line with \(f = 0\), \(g = \cos x\).

    Show answer

    \(u = \frac12\int_{x - t}^{x + t}\cos s\,ds = \cos x\sin t\), a standing wave.

  3. Solve \(u_{tt} = u_{xx}\) on \(0 < x < \pi\) with fixed ends, \(u(x, 0) = \sin 2x\), \(u_t(x, 0) = \sin x\).

    Show answer

    \(u = \cos 2t\sin 2x + \sin t\sin x\).

  4. A string 0.65 m long has fundamental 196 Hz. What is the wave speed, and what is the frequency of the third harmonic?

    Show answer

    \(c = 2 \times 0.65 \times 196 \approx 255\) m/s; the third harmonic is 588 Hz.

  5. Which harmonics are missing when a string is plucked at one third of its length?

    Show answer

    Those with \(\sin(n\pi/3) = 0\): \(n = 3, 6, 9, \ldots\)

  6. Show that for a string with a free end, \(u_x(L, t) = 0\), the energy is still conserved.

    Show answer

    The boundary term is \(c^2[u_tu_x]_0^L\); at \(x = L\), \(u_x = 0\), and at a fixed end \(u_t = 0\). So \(E' = 0\).

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz