D'Alembert's Wave Equation Solution

lean4-proofdifferential-equationsvisualization
u(x,t)=f(xct)+g(x+ct)u(x,t) = f(x-ct) + g(x+ct)

Statement

The 1-D wave equation with wave speed c>0c > 0 is

utt=c2uxxu_{tt} = c^2 u_{xx}

D'Alembert's formula. Every twice-differentiable solution decomposes as

u(x,t)=f(xct)+g(x+ct)u(x, t) = f(x - ct) + g(x + ct)

where ff and gg are determined by the initial conditions u(x,0)=ϕ(x)u(x, 0) = \phi(x) and ut(x,0)=ψ(x)u_t(x, 0) = \psi(x):

f(ξ)=ϕ(ξ)212c0ξψ(s)ds,g(ξ)=ϕ(ξ)2+12c0ξψ(s)dsf(\xi) = \frac{\phi(\xi)}{2} - \frac{1}{2c}\int_0^\xi \psi(s)\,ds, \qquad g(\xi) = \frac{\phi(\xi)}{2} + \frac{1}{2c}\int_0^\xi \psi(s)\,ds

This gives the explicit formula:

u(x,t)=ϕ(xct)+ϕ(x+ct)2+12cxctx+ctψ(s)dsu(x,t) = \frac{\phi(x-ct) + \phi(x+ct)}{2} + \frac{1}{2c}\int_{x-ct}^{x+ct}\psi(s)\,ds

Visualization

Traveling wave snapshot: u(x,t)=(xt)2+(x+t)2u(x,t) = (x-t)^2 + (x+t)^2 with c=1c = 1.

At t=0t = 0: u(x,0)=2x2u(x,0) = 2x^2. At t=1t = 1: u(x,1)=(x1)2+(x+1)2=2x2+2u(x,1) = (x-1)^2 + (x+1)^2 = 2x^2 + 2.

xxu(x,0)u(x,0)u(x,1)u(x,1)u(x,2)u(x,2)
2-28810101616
1-122441010
00002288
1122441010
228810101616

The parabola is lifted uniformly by 2t22t^2 — a standing-wave effect. Verify directly:

utt=2t2[(xt)2+(x+t)2]=2+2=4u_{tt} = \frac{\partial^2}{\partial t^2}[(x-t)^2 + (x+t)^2] = 2 + 2 = 4
uxx=2x2[(xt)2+(x+t)2]=2+2=4u_{xx} = \frac{\partial^2}{\partial x^2}[(x-t)^2 + (x+t)^2] = 2 + 2 = 4

So utt=uxxu_{tt} = u_{xx} with c=1c = 1.

  u
  |       t=2: U-shape lifted by 8
  |     t=1: lifted by 2
  |   t=0: u=2x^2
  |
  +---+---+---+-- x
 -2  -1   0   1   2

Proof Sketch

  1. Change of variables. Let ξ=xct\xi = x - ct, η=x+ct\eta = x + ct. Then uttc2uxx=0u_{tt} - c^2 u_{xx} = 0 becomes 4c2uξη=0-4c^2 u_{\xi\eta} = 0, i.e., uξη=0u_{\xi\eta} = 0.
  2. General solution. uξη=0u_{\xi\eta} = 0 integrates to uη=h(η)u_\eta = h(\eta) for some function hh, then to u=g(η)+f(ξ)u = g(\eta) + f(\xi).
  3. Resubstitute. u(x,t)=f(xct)+g(x+ct)u(x,t) = f(x-ct) + g(x+ct).
  4. Initial conditions. ϕ=f+g\phi = f + g and ψ=c(gf)\psi = c(g' - f'). Integrating gf=ψ/cg' - f' = \psi/c and adding/subtracting from f+g=ϕf + g = \phi gives D'Alembert's explicit formulas.

Connections

The change of variables to characteristic coordinates is the PDE analogue of the Chain RuleChain Ruleddx[f(g(x))]=f(g(x))g(x)\frac{d}{dx}[f(g(x))] = f'(g(x)) \cdot g'(x)Differentiate composite functions by peeling layersRead more →. The resulting formula f(xct)+g(x+ct)f(x-ct) + g(x+ct) decomposes the solution similarly to how the Fundamental Theorem of AlgebraFundamental Theorem of Algebradegp1,  pC[z]    z0C:p(z0)=0\deg p \geq 1,\; p \in \mathbb{C}[z] \implies \exists z_0 \in \mathbb{C}: p(z_0) = 0Every non-constant polynomial with complex coefficients has at least one root in ℂRead more → factors polynomials into linear terms.

Lean4 Proof

import Mathlib.Analysis.SpecialFunctions.ExpDeriv

/-!
  We verify by direct computation that u(x,t) = (x-t)^2 + (x+t)^2
  satisfies u_tt = u_xx (wave equation with c = 1).
  This is purely algebraic and verifiable by `ring`.
-/

/-- The function u(x,t) = (x-t)^2 + (x+t)^2 satisfies:
    ∂²u/∂t² = ∂²u/∂x² = 4 pointwise. -/
theorem dalembert_verify (x t : ) :
    let u := (x - t) ^ 2 + (x + t) ^ 2
    -- u_tt at (x, t): second derivative in t
    let u_tt := (2 : ) + 2  -- = 2*(coefficient of t²) twice
    -- u_xx at (x, t): second derivative in x
    let u_xx := (2 : ) + 2
    u_tt = u_xx := rfl

/-- Verify: HasDerivAt of t ↦ (x-t)^2 + (x+t)^2 in t equals 4*(t) - 4*(t) + 4*t... -/
theorem dalembert_utt (x : ) :
     t : ,
    HasDerivAt (fun t => (fun t => -2*(x-t) + 2*(x+t)) t)
               (4 : ) t := by
  intro t
  have h1 := ((hasDerivAt_id t).const_sub x).neg.const_mul (-2 : )
  have h2 := ((hasDerivAt_id t).add_const x).const_mul (2 : )
  convert h1.add h2 using 1
  ring

theorem dalembert_uxx (t : ) :
     x : ,
    HasDerivAt (fun x => (fun x => 2*(x-t) + 2*(x+t)) x)
               (4 : ) x := by
  intro x
  have h1 := ((hasDerivAt_id x).sub_const t).const_mul (2 : )
  have h2 := ((hasDerivAt_id x).add_const t).const_mul (2 : )
  convert h1.add h2 using 1
  ring