TExcelTAD
Home › Differential Equations › D'Alembert's Solution of the Wave Equation

D'Alembert's Solution of the Wave Equation

The Fourier series solution of the wave equation hides a much simpler picture: two shapes travelling in opposite directions at speed cc. D'Alembert's formula makes this explicit and works on the whole line, without any series.

Travelling waves

For any twice-differentiable functions FF and GG,

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

solves utt=c2uxxu_{tt} = c^2u_{xx}: each term contributes c2F′′c^2F'' to both sides. F(x−ct)F(x - ct) is the shape FF moving right at speed cc; G(x+ct)G(x + ct) moves left. Conversely, the change of variables ξ=x−ct\xi = x - ct, η=x+ct\eta = x + ct turns the equation into uξη=0u_{\xi\eta} = 0, whose general solution is exactly F(ξ)+G(η)F(\xi) + G(\eta).

The formula

On the whole line with u(x,0)=f(x)u(x, 0) = f(x) and ut(x,0)=g(x)u_t(x, 0) = g(x):

u(x,t)=f(x−ct)+f(x+ct)2+12c∫x−ctx+ctg(s) ds.u(x, t) = \frac{f(x - ct) + f(x + ct)}{2} + \frac{1}{2c}\int_{x - ct}^{x + ct} g(s)\,ds.

With zero initial velocity, the initial shape splits into two half-height copies moving apart.

python · try it yourself
import numpy as np

c = 1.0
f = lambda x: np.exp(-20 * x**2)                    # a bump at the origin, released from rest
u = lambda x, t: 0.5 * (f(x - c * t) + f(x + c * t))
xs = np.linspace(-3, 3, 13)
for t in (0.0, 1.0, 2.0):
    print(f"t = {t}:", np.round(u(xs, t), 2))
t = 0.0: [0.   0.   0.   0.   0.   0.01 1.   0.01 0.   0.   0.   0.   0.  ]
t = 1.0: [0.  0.  0.  0.  0.5 0.  0.  0.  0.5 0.  0.  0.  0. ]
t = 2.0: [0.  0.  0.5 0.  0.  0.  0.  0.  0.  0.  0.5 0.  0. ]

The bump splits into two bumps of height 0.5 centred at ±t\pm t.

Domain of dependence

The formula shows that u(x0,t0)u(x_0, t_0) depends only on initial data in the interval [x0−ct0,x0+ct0][x_0 - ct_0, x_0 + ct_0]. Information travels at finite speed cc: a disturbance far away cannot affect x0x_0 before the wave arrives. (The heat equation is different: a change anywhere is felt everywhere immediately, though very faintly.) This fact is the continuous version of the CFL condition that limits the time step of numerical wave solvers (The Wave Equation and the CFL Condition).

Strings with fixed ends: reflections

For a string on [0,L][0, L] with fixed ends, extend ff and gg to odd, 2L2L-periodic functions and use d'Alembert's formula. The odd extension makes u(0,t)=0u(0, t) = 0 automatically: a wave hitting a fixed end comes back upside down. This gives the same answer as the Fourier series.

python · try it yourself
import numpy as np

L, c = 1.0, 1.0
def f_ext(x):                               # odd, 2L-periodic extension of a plucked triangle
    x = np.mod(x + L, 2 * L) - L            # into [-L, L)
    s = np.sign(x); x = np.abs(x)
    return s * np.where(x < 0.5, 0.02 * x, 0.02 * (1 - x))

u_dalembert = lambda x, t: 0.5 * (f_ext(x - c * t) + f_ext(x + c * t))
n = np.arange(1, 2000)
A = 8 * 0.01 / (n * np.pi)**2 * np.sin(n * np.pi / 2)
u_series = lambda x, t: np.sum(A * np.cos(n * np.pi * c * t) * np.sin(n * np.pi * x))
for x, t in ((0.5, 0.3), (0.2, 0.7), (0.9, 1.4)):
    print(f"u({x}, {t}): d'Alembert {u_dalembert(x, t): .6f}, series {u_series(x, t): .6f}")
u(0.5, 0.3): d'Alembert  0.004000, series  0.004000
u(0.2, 0.7): d'Alembert -0.004000, series -0.003999
u(0.9, 1.4): d'Alembert -0.002000, series -0.001999

In software

  • The digital waveguide method of sound synthesis stores two delay lines, one for the right-moving and one for the left-moving wave, and inverts the signal at the ends: d'Alembert's formula as a data structure.
  • Ray tracing and signal-timing calculations (radar, sonar, GPS) rely on finite propagation speed.

Exercises

Exercise 1: Identify the waves

Write u=sin⁡(x−3t)+(x+3t)2u = \sin(x - 3t) + (x + 3t)^2 as F(x−ct)+G(x+ct)F(x - ct) + G(x + ct). What is cc, and which part moves left?

Answer

c=3c = 3; (x+3t)2(x + 3t)^2 moves left.

Solution

F(ξ)=sin⁡ξF(\xi) = \sin\xi with ξ=x−3t\xi = x - 3t (moves right), G(η)=η2G(\eta) = \eta^2 with η=x+3t\eta = x + 3t (moves left).

Exercise 2: Initial velocity only

Use d'Alembert's formula for f=0f = 0, g(x)=cos⁡xg(x) = \cos x, c=2c = 2.

Answer

u=12cos⁡xsin⁡2tu = \frac{1}{2}\cos x\sin 2t.

Solution

14∫x−2tx+2tcos⁡s ds=14(sin⁡(x+2t)−sin⁡(x−2t))=12cos⁡xsin⁡2t\frac{1}{4}\int_{x-2t}^{x+2t}\cos s\,ds = \frac{1}{4}\big(\sin(x + 2t) - \sin(x - 2t)\big) = \frac{1}{2}\cos x\sin 2t.

Exercise 3: When does the signal arrive? (code)

A bump centred at x=0x = 0 is released from rest with c=340c = 340 (sound in air, metres and seconds). When does the peak of the disturbance reach x=17x = 17, and how high is it there?

Answer

At t=0.05t = 0.05 s, with half the original height.

Solution

The right-moving half 12f(x−ct)\frac{1}{2}f(x - ct) peaks when x−ct=0x - ct = 0, i.e. t=17340t = \frac{17}{340}.

python · try it yourself
import numpy as np
f = lambda x: np.exp(-x**2)
t = np.linspace(0, 0.1, 10001)
u = 0.5 * (f(17 - 340 * t) + f(17 + 340 * t))
print(round(t[np.argmax(u)], 4), round(u.max(), 3))
0.05 0.5

Test yourself

F(x−ct)F(x - ct) describes a shape that…

  1. moves left at speed cc
  2. moves right at speed cc
  3. stands still
  4. decays

A bump released from rest on an infinite string…

  1. stays in place
  2. splits into two half-height bumps moving apart
  3. spreads out and flattens like heat
  4. moves right only

At a fixed end, a wave pulse is reflected…

  1. upside down
  2. the same way up
  3. not at all
  4. with double height