Separation of Variables for the Wave Equation

How does a guitar string, clamped at both ends, know how to vibrate? This concrete question drives everything here. Pluck a string and release it: the resulting motion looks complicated. Yet it is secretly a superposition of pure tones. These are simple standing-wave shapes, each oscillating at its own natural frequency. Separation of variables is the technique that finds these pure tones. It also assembles them into a formula for the general motion. The idea matters because it converts an intractable partial differential equation in two variables into two ordinary differential equations. Each of these is solvable by elementary methods. This is the same strategy used across mathematical physics. Heat flow, quantum wavefunctions, and electromagnetic cavities are all attacked this way. First, one finds the "normal modes" of a linear system. Then one expands an arbitrary state in that mode basis. The wave equation on a finite string is the cleanest possible testing ground for this idea. Mastering it here pays dividends everywhere else. The big picture is this: the wave equation is linear, so solutions can be added together. Suppose we can find enough special solutions of the separated form u(x,t)=X(x)T(t)u(x,t) = X(x)T(t). These must also satisfy the boundary conditions. Then a Fourier series built from these building blocks solves the full initial-boundary value problem. Its coefficients are chosen to match the initial position and velocity of the string. This is not a heuristic. It is a theorem with precise hypotheses, and we prove it in full. This article delivers the complete separation-of-variables machinery for the vibrating string. It includes the derivation of the standing-wave modes and the natural (angular) frequencies. It includes the theorem asserting that the Fourier sine series solves the problem, with a full proof. It also includes worked examples with genuinely asymmetric data. There is a counterexample showing why the boundary conditions cannot be dropped. Finally, it surveys where these ideas resurface in modern mathematics and physics.

Key takeaways
  • The wave equation utt=c2uxxu_{tt} = c^2 u_{xx} on 0≤x≤L0 \le x \le L with fixed ends has special "standing wave" solutions un(x,t)=sin⁡(nπx/L)(Ancos⁡(ωnt)+Bnsin⁡(ωnt))u_n(x,t) = \sin(n\pi x/L)\big(A_n\cos(\omega_n t) + B_n \sin(\omega_n t)\big).
  • The natural (angular) frequencies are ωn=nπc/L\omega_n = n\pi c/L, forming a discrete harmonic sequence ω1,2ω1,3ω1,…\omega_1, 2\omega_1, 3\omega_1, \dots
  • Separation of variables reduces the PDE to two linear ODEs: a spatial eigenvalue problem and a temporal oscillator equation.
  • The general solution satisfying the initial position f(x)f(x) and initial velocity g(x)g(x) is a Fourier sine series with coefficients given by explicit integral (Euler) formulas.
  • Superposition (linearity) is what allows infinitely many standing waves to be summed into one solution matching arbitrary initial data.
  • Key idea: every vibration of a clamped string is a sum of pure sinusoidal standing waves, each with its own fixed spatial shape and its own single frequency of oscillation in time.

Where this lives today

The eigenfunction-decomposition idea generalizes far beyond the single vibrating string. In musical acoustics and instrument design, the natural frequencies ωn=nπc/L\omega_n = n\pi c/L explain why plucked strings produce harmonic overtones in integer ratios, directly shaping the design of pianos, guitars, and violins. In structural engineering, the same separation technique computes the resonant frequencies of beams, bridges, and building facades, which is essential for avoiding catastrophic resonance under periodic loads such as wind or foot traffic. In quantum mechanics, the time-independent Schrödinger equation is derived by an identical separation-of-variables argument applied to the time-dependent Schrödinger equation, and the resulting discrete energy eigenvalues are the direct mathematical descendants of the λn\lambda_n found here. In numerical analysis and computer graphics, modal sound synthesis and physically based animation of cloth and strings use truncated versions of exactly this Fourier mode expansion to simulate vibration efficiently. In signal processing, the discrete Fourier transform and its fast algorithms are the computational engine that extracts the coefficients An,BnA_n, B_n from sampled data, connecting this 18th-century string problem directly to modern audio compression and spectral analysis.

Ask the tutor: How does this same separation technique change when one end of the string is free instead of fixed?

DefinitionThe Wave Equation Initial-Boundary Value Problem

Let L>0L>0 and c>0c>0 be constants. The vibrating string problem asks for a function u(x,t)u(x,t), defined for 0≤x≤L0\le x\le L and t≥0t\ge 0, satisfying:

utt(x,t)=c2 uxx(x,t),0<x<L, t>0,u_{tt}(x,t) = c^2\, u_{xx}(x,t), \qquad 0 < x < L,\ t>0,

(the wave equation), together with the boundary conditions (fixed ends)

u(0,t)=0,u(L,t)=0,t≥0,u(0,t) = 0, \qquad u(L,t) = 0, \qquad t \ge 0,

and the initial conditions

u(x,0)=f(x),ut(x,0)=g(x),0≤x≤L,u(x,0) = f(x), \qquad u_t(x,0) = g(x), \qquad 0 \le x \le L,

where f,g:[0,L]→Rf,g:[0,L]\to\mathbb{R} are given functions describing the initial shape and initial velocity of the string, with f(0)=f(L)=0f(0)=f(L)=0 for compatibility with the boundary conditions. A separated (standing-wave) solution is a nonzero solution of the wave equation of the special product form

u(x,t)=X(x) T(t),u(x,t) = X(x)\,T(t),

where XX depends only on xx and TT only on tt.

Intuition

Picture a taut string clamped at x=0x=0 and x=Lx=L. Among all its possible motions, some are especially simple: the whole string oscillates up and down while keeping the same spatial shape at every instant, only rescaled in amplitude. These are the standing waves. The shape itself must vanish at both ends (since the ends are pinned), and it turns out only very specific shapes — sine curves sin⁡(nπx/L)\sin(n\pi x/L) for a positive integer nn — are geometrically compatible with being stretched by a pure oscillation in time without changing form. Each such shape has its own drumbeat: a single frequency ωn=nπc/L\omega_n = n\pi c/L at which that particular mode rings. The separation-of-variables method is the algebraic engine that discovers this fact. We guess a product solution u=X(x)T(t)u = X(x)T(t), substitute into the PDE, and watch the two variables decouple: one side of the resulting equation depends only on xx, the other only on tt. Since xx and tt vary independently, both sides must equal one common constant — the separation constant. This single observation converts a two-variable PDE into a pair of one-variable ODEs, each of which we already know how to solve from ordinary differential equations and from the theory of Fourier series boundary value problems. The physical picture is that any actual vibration — plucked, struck, bowed — is a superposition of infinitely many of these standing waves, each vibrating at its own frequency ωn\omega_n, with amplitudes determined by how much of that mode's shape is present in the initial displacement and velocity. Fourier's insight, applied here, is that the sine functions sin⁡(nπx/L)\sin(n\pi x/L) form a complete orthogonal basis for functions vanishing at 00 and LL, so any admissible initial shape can be decomposed exactly into these modes.

Figure
The first three standing-wave modes of a string of length L, at maximum displacement
n=1 n=2 n=3 x=0 x=L ω_n = nπc/L
TheoremSeparation of Variables and Fourier Solution of the Vibrating String

Let L>0L>0, c>0c>0. Suppose f∈C2[0,L]f \in C^2[0,L] and g∈C1[0,L]g \in C^1[0,L] satisfy the compatibility conditions

f(0)=f(L)=0,g(0)=g(L)=0,f(0)=f(L)=0, \qquad g(0)=g(L)=0,

and let ff and gg have Fourier sine series on [0,L][0,L]

f(x)=∑n=1∞Ansin⁡ ⁣(nπxL),g(x)=∑n=1∞Bn′sin⁡ ⁣(nπxL),f(x) = \sum_{n=1}^{\infty} A_n \sin\!\left(\frac{n\pi x}{L}\right), \qquad g(x) = \sum_{n=1}^{\infty} B_n' \sin\!\left(\frac{n\pi x}{L}\right),

with coefficients given by the Euler formulas

An=2L∫0Lf(x)sin⁡ ⁣(nπxL)dx,Bn′=2L∫0Lg(x)sin⁡ ⁣(nπxL)dx.A_n = \frac{2}{L}\int_0^L f(x) \sin\!\left(\frac{n\pi x}{L}\right)dx, \qquad B_n' = \frac{2}{L}\int_0^L g(x) \sin\!\left(\frac{n\pi x}{L}\right)dx.

Define ωn=nπc/L\omega_n = n\pi c / L and Bn=Bn′/ωnB_n = B_n'/\omega_n. Then

u(x,t)=∑n=1∞sin⁡ ⁣(nπxL)(Ancos⁡(ωnt)+Bnsin⁡(ωnt))u(x,t) = \sum_{n=1}^{\infty} \sin\!\left(\frac{n\pi x}{L}\right)\Big(A_n \cos(\omega_n t) + B_n \sin(\omega_n t)\Big)

is, under the additional assumption that this series and its termwise second derivatives in xx and tt converge uniformly on [0,L]×[0,∞)[0,L]\times[0,\infty), the unique solution of the initial-boundary value problem of The Wave Equation and Vibrating Strings with fixed ends, initial position ff, and initial velocity gg. Moreover every separated solution of the wave equation satisfying u(0,t)=u(L,t)=0u(0,t)=u(L,t)=0 for all tt has the form

un(x,t)=sin⁡ ⁣(nπxL)(acos⁡(ωnt)+bsin⁡(ωnt))u_n(x,t) = \sin\!\left(\frac{n\pi x}{L}\right)\big(a\cos(\omega_n t) + b \sin(\omega_n t)\big)

for some integer n≥1n \ge 1 and constants a,ba,b, with ωn=nπc/L\omega_n = n\pi c/L.

Proof

We proceed in four stages: (1) derive the separated ODEs, (2) solve the spatial eigenvalue problem, (3) solve the temporal equation and assemble the modes, (4) superpose the modes via Fourier series and prove the sum solves the original problem, then (5) prove uniqueness.

Step 1: Separation. Suppose u(x,t)=X(x)T(t)u(x,t) = X(x)T(t) is a nonzero solution of utt=c2uxxu_{tt} = c^2 u_{xx} with X,TX,T twice differentiable. Substituting,

X(x)T′′(t)=c2X′′(x)T(t).X(x)T''(t) = c^2 X''(x) T(t).

Since u≢0u \not\equiv 0, there is a point (x0,t0)(x_0,t_0) with X(x0)≠0X(x_0)\ne 0 and T(t0)≠0T(t_0)\ne 0; in fact by continuity XX is not identically zero and TT is not identically zero (if X≡0X\equiv 0 or T≡0T \equiv 0 then u≡0u\equiv 0). Where X(x)T(t)≠0X(x)T(t)\ne 0, divide both sides by c2X(x)T(t)c^2 X(x)T(t):

T′′(t)c2T(t)=X′′(x)X(x).\frac{T''(t)}{c^2 T(t)} = \frac{X''(x)}{X(x)}.

The left side is a function of tt alone; the right side is a function of xx alone. They are equal on an open set of (x,t)(x,t) where both are defined, and each is continuous, so fixing any tt and varying xx shows the right side is constant, and likewise the left side is constant. Call this common constant −λ-\lambda (the sign is chosen for later convenience). Thus

X′′(x)+λX(x)=0,T′′(t)+λc2T(t)=0.X''(x) + \lambda X(x) = 0, \qquad T''(t) + \lambda c^2 T(t) = 0.

This is the decoupling promised by the method: two linear, constant-coefficient ODEs linked only by the shared constant λ\lambda.

Step 2: Spatial eigenvalue problem. The boundary conditions u(0,t)=u(L,t)=0u(0,t)=u(L,t)=0 for all tt force X(0)T(t)=0X(0)T(t) = 0 and X(L)T(t)=0X(L)T(t)=0 for all tt. Since T≢0T\not\equiv 0 (else u≡0u \equiv 0), there exists t1t_1 with T(t1)≠0T(t_1)\ne 0; evaluating at t1t_1 gives X(0)=X(L)=0X(0)=X(L)=0. So XX solves the boundary value problem

X′′+λX=0,X(0)=0, X(L)=0.X'' + \lambda X = 0, \qquad X(0)=0,\ X(L)=0.

We claim the only values of λ\lambda admitting a nontrivial solution XX are λn=(nπ/L)2\lambda_n = (n\pi/L)^2, n=1,2,3,…n=1,2,3,\dots, with corresponding Xn(x)=sin⁡(nπx/L)X_n(x) = \sin(n\pi x/L) up to scalar multiples. This is exactly the eigenvalue analysis carried out in Fourier Series Solutions of Boundary Value Problems; we repeat the argument for completeness.

  • If λ<0\lambda < 0, write λ=−μ2\lambda = -\mu^2 with μ>0\mu>0. The general solution is X(x)=c1eμx+c2e−μxX(x) = c_1 e^{\mu x} + c_2 e^{-\mu x}. The condition X(0)=0X(0)=0 gives c1+c2=0c_1 + c_2 = 0, so X(x)=c1(eμx−e−μx)=2c1sinh⁡(μx)X(x) = c_1(e^{\mu x}-e^{-\mu x}) = 2c_1 \sinh(\mu x). Then X(L)=2c1sinh⁡(μL)=0X(L) = 2c_1\sinh(\mu L) = 0. Since μL>0\mu L > 0, sinh⁡(μL)≠0\sinh(\mu L) \ne 0, forcing c1=0c_1 = 0 and hence X≡0X \equiv 0: no nontrivial solution.
  • If λ=0\lambda = 0, the general solution is X(x)=c1+c2xX(x) = c_1 + c_2 x. Then X(0)=c1=0X(0)=c_1=0 and X(L)=c2L=0X(L) = c_2 L = 0 forces c2=0c_2 = 0: again only the trivial solution.
  • If λ>0\lambda > 0, write λ=μ2\lambda = \mu^2 with μ>0\mu > 0. The general solution is X(x)=c1cos⁡(μx)+c2sin⁡(μx)X(x) = c_1\cos(\mu x) + c_2 \sin(\mu x). Then X(0)=c1=0X(0) = c_1 = 0, so X(x)=c2sin⁡(μx)X(x) = c_2 \sin(\mu x). The condition X(L)=c2sin⁡(μL)=0X(L) = c_2 \sin(\mu L) = 0 requires, for a nontrivial solution (c2≠0c_2 \ne 0), that sin⁡(μL)=0\sin(\mu L) = 0, i.e. μL=nπ\mu L = n\pi for some positive integer nn (positive since μ>0\mu>0). Hence μ=nπ/L\mu = n\pi/L and λ=λn:=(nπ/L)2\lambda = \lambda_n := (n\pi/L)^2, with Xn(x)=sin⁡(nπx/L)X_n(x) = \sin(n\pi x/L) (taking c2=1c_2=1 as a normalization).

This proves the claim: the eigenvalues are exactly λn=(nπ/L)2\lambda_n = (n\pi/L)^2 for n∈Z+n \in \mathbb{Z}^+, each with one-dimensional eigenspace spanned by sin⁡(nπx/L)\sin(n\pi x/L).

Step 3: Temporal equation and the modes. With λ=λn\lambda = \lambda_n, the temporal equation becomes

Tn′′(t)+ωn2Tn(t)=0,ωn:=λn c=nπcL.T_n''(t) + \omega_n^2 T_n(t) = 0, \qquad \omega_n := \sqrt{\lambda_n}\, c = \frac{n\pi c}{L}.

This is the simple harmonic oscillator equation; its general solution (a standard result on constant-coefficient linear ODEs) is

Tn(t)=ancos⁡(ωnt)+bnsin⁡(ωnt)T_n(t) = a_n \cos(\omega_n t) + b_n \sin(\omega_n t)

for arbitrary constants an,bna_n, b_n. Combining with XnX_n, every separated solution satisfying the boundary conditions is a constant multiple, for some nn, of

un(x,t)=sin⁡ ⁣(nπxL)(ancos⁡(ωnt)+bnsin⁡(ωnt)),u_n(x,t) = \sin\!\left(\frac{n\pi x}{L}\right)\big(a_n \cos(\omega_n t) + b_n \sin(\omega_n t)\big),

which proves the "moreover" clause of the theorem: Steps 1–3 show that every separated solution vanishing at x=0,Lx=0,L arises this way, since the derivation used no property of X,TX,T beyond separability and the boundary/nontriviality conditions.

Step 4: Superposition solves the full problem. The wave equation and the boundary conditions are linear and homogeneous, so any finite linear combination of the unu_n again solves them; we must justify passing to the infinite sum

u(x,t)=∑n=1∞un(x,t),un(x,t)=sin⁡ ⁣(nπxL)(Ancos⁡(ωnt)+Bnsin⁡(ωnt)).u(x,t) = \sum_{n=1}^\infty u_n(x,t), \qquad u_n(x,t) = \sin\!\left(\frac{n\pi x}{L}\right)\big(A_n\cos(\omega_n t) + B_n \sin(\omega_n t)\big).

By hypothesis this series, and the series obtained by differentiating it termwise twice in xx and twice in tt, converge uniformly on [0,L]×[0,∞)[0,L]\times[0,\infty). A standard theorem of analysis (termwise differentiation of uniformly convergent series of differentiable functions with uniformly convergent derivative series) then permits differentiating under the summation sign, so

utt(x,t)=∑n=1∞(un)tt(x,t)=∑n=1∞c2(un)xx(x,t)=c2uxx(x,t),u_{tt}(x,t) = \sum_{n=1}^\infty (u_n)_{tt}(x,t) = \sum_{n=1}^\infty c^2 (u_n)_{xx}(x,t) = c^2 u_{xx}(x,t),

using that each unu_n solves the wave equation exactly (Step 3). Uniform convergence also justifies evaluating boundary and initial values termwise:

u(0,t)=∑nun(0,t)=0,u(L,t)=∑nun(L,t)=0u(0,t) = \sum_n u_n(0,t) = 0, \qquad u(L,t) = \sum_n u_n(L,t) = 0

since sin⁡(0)=sin⁡(nπ)=0\sin(0)=\sin(n\pi)=0 for all nn. For the initial conditions,

u(x,0)=∑n=1∞Ansin⁡ ⁣(nπxL)=f(x)u(x,0) = \sum_{n=1}^\infty A_n \sin\!\left(\frac{n\pi x}{L}\right) = f(x)

by hypothesis (this is precisely the Fourier sine series of ff, which converges to f(x)f(x) pointwise on [0,L][0,L] under the stated smoothness of ff, by the Fourier convergence theorem established in Fourier Series Solutions of Boundary Value Problems). Differentiating termwise in tt (justified by uniform convergence of the differentiated series) and setting t=0t=0,

ut(x,0)=∑n=1∞ωnBnsin⁡ ⁣(nπxL)=∑n=1∞Bn′sin⁡ ⁣(nπxL)=g(x),u_t(x,0) = \sum_{n=1}^\infty \omega_n B_n \sin\!\left(\frac{n\pi x}{L}\right) = \sum_{n=1}^\infty B_n' \sin\!\left(\frac{n\pi x}{L}\right) = g(x),

using ωnBn=Bn′\omega_n B_n = B_n' by definition of BnB_n, and again the Fourier convergence theorem applied to gg. Thus uu satisfies the wave equation, the boundary conditions, and both initial conditions: uu solves the problem.

Step 5: Uniqueness. Suppose u1,u2u_1, u_2 both solve the initial-boundary value problem with the same f,gf,g, and suppose both possess the continuous second partial derivatives needed to justify the energy computation below. Let w=u1−u2w = u_1 - u_2. Then ww solves the wave equation with w(0,t)=w(L,t)=0w(0,t)=w(L,t)=0, w(x,0)=0w(x,0)=0, wt(x,0)=0w_t(x,0)=0. Define the energy

E(t)=12∫0L(wt(x,t)2+c2wx(x,t)2) dx.E(t) = \frac{1}{2}\int_0^L \Big( w_t(x,t)^2 + c^2 w_x(x,t)^2 \Big)\, dx.

Differentiating under the integral sign (justified since ww is C2C^2) and using the wave equation wtt=c2wxxw_{tt} = c^2 w_{xx}:

E′(t)=∫0L(wtwtt+c2wxwxt) dx=∫0L(wt⋅c2wxx+c2wxwxt) dx=c2∫0L∂∂x(wtwx) dx,E'(t) = \int_0^L \big( w_t w_{tt} + c^2 w_x w_{xt} \big)\, dx = \int_0^L \big( w_t \cdot c^2 w_{xx} + c^2 w_x w_{xt}\big)\, dx = c^2\int_0^L \frac{\partial}{\partial x}(w_t w_x)\, dx,

where the last equality is the product rule run in reverse: ∂x(wtwx)=wtxwx+wtwxx\partial_x(w_t w_x) = w_{tx}w_x + w_t w_{xx}, matching the integrand above term for term. By the Fundamental Theorem of Calculus,

E′(t)=c2[wt(L,t)wx(L,t)−wt(0,t)wx(0,t)].E'(t) = c^2 \big[ w_t(L,t) w_x(L,t) - w_t(0,t) w_x(0,t) \big].

But w(0,t)=w(L,t)=0w(0,t) = w(L,t) = 0 for all tt implies, upon differentiating these identities in tt, that wt(0,t)=wt(L,t)=0w_t(0,t) = w_t(L,t) = 0 for all tt. Hence E′(t)=0E'(t) = 0 for all t≥0t \ge 0, so EE is constant. At t=0t=0: w(x,0)=0w(x,0) = 0 for all xx implies wx(x,0)=0w_x(x,0) = 0 (differentiate in xx), and wt(x,0)=0w_t(x,0) = 0 by hypothesis, so E(0)=0E(0) = 0. Therefore E(t)≡0E(t) \equiv 0. Since the integrand wt2+c2wx2w_t^2 + c^2 w_x^2 is continuous and nonnegative and integrates to 00 over [0,L][0,L] for every tt, it must vanish identically: wt(x,t)=0w_t(x,t) = 0 and wx(x,t)=0w_x(x,t) = 0 for all x∈[0,L]x \in [0,L], t≥0t \ge 0. Thus ww is constant in both xx and tt, i.e. w≡w(0,0)=u1(0,0)−u2(0,0)=f(0)−f(0)=0w \equiv w(0,0) = u_1(0,0)-u_2(0,0) = f(0)-f(0) = 0. So u1≡u2u_1 \equiv u_2, proving uniqueness. ■\blacksquare

∎

Worked examples

Example 1 — asymmetric plucked-and-flicked string. Take L=2L=2, c=3c=3, so ωn=nπc/L=3nπ/2\omega_n = n\pi c/L = 3n\pi/2. Suppose the string starts at rest shape

f(x)=x(2−x)2,0≤x≤2,f(x) = x(2-x)^2, \qquad 0 \le x \le 2,

(note f(0)=0f(0)=0, f(2)=0f(2)=0, and ff is not symmetric about the midpoint x=1x=1, since f(0.5)=0.5(1.5)2=1.125f(0.5) = 0.5(1.5)^2 = 1.125 while f(1.5)=1.5(0.5)2=0.375f(1.5) = 1.5(0.5)^2 = 0.375), with initial velocity g(x)=0g(x) = 0. Since g≡0g \equiv 0, all Bn′=0B_n' = 0, hence all Bn=0B_n = 0. We need

An=22∫02x(2−x)2sin⁡ ⁣(nπx2)dx=∫02x(2−x)2sin⁡ ⁣(nπx2)dx.A_n = \frac{2}{2}\int_0^2 x(2-x)^2 \sin\!\left(\frac{n\pi x}{2}\right)dx = \int_0^2 x(2-x)^2\sin\!\left(\frac{n\pi x}{2}\right)dx.

Expand x(2−x)2=x(4−4x+x2)=4x−4x2+x3x(2-x)^2 = x(4 - 4x + x^2) = 4x - 4x^2 + x^3. We use the standard antiderivative reduction (integration by parts, three times, or the general formula ∫0Lxksin⁡(nπx/L)dx\int_0^L x^k \sin(n\pi x/L)dx) with L=2L=2, k0=nπ/2k_0 = n\pi/2. Rather than a generic formula, we integrate directly. Let Ik=∫02xksin⁡(k0x) dxI_k = \int_0^2 x^k \sin(k_0 x)\,dx with k0=nπ/2k_0 = n\pi/2. Using repeated integration by parts:

I1=∫02xsin⁡(k0x) dx=[−xcos⁡(k0x)k0]02+1k0∫02cos⁡(k0x) dx=−2cos⁡(2k0)k0+sin⁡(2k0)k02.I_1 = \int_0^2 x\sin(k_0 x)\,dx = \left[-\frac{x\cos(k_0x)}{k_0}\right]_0^2 + \frac{1}{k_0}\int_0^2\cos(k_0x)\,dx = -\frac{2\cos(2k_0)}{k_0} + \frac{\sin(2k_0)}{k_0^2}.

Since 2k0=nπ2k_0 = n\pi: cos⁡(2k0)=cos⁡(nπ)=(−1)n\cos(2k_0) = \cos(n\pi) = (-1)^n and sin⁡(2k0)=sin⁡(nπ)=0\sin(2k_0)=\sin(n\pi)=0. So

I1=−2(−1)nk0.I_1 = -\frac{2(-1)^n}{k_0}.
I2=∫02x2sin⁡(k0x) dx=[−x2cos⁡(k0x)k0]02+2k0∫02xcos⁡(k0x) dx.I_2 = \int_0^2 x^2\sin(k_0x)\,dx = \left[-\frac{x^2\cos(k_0x)}{k_0}\right]_0^2 + \frac{2}{k_0}\int_0^2 x\cos(k_0x)\,dx.

The boundary term is −4(−1)nk0-\dfrac{4(-1)^n}{k_0}. For J:=∫02xcos⁡(k0x) dxJ := \int_0^2 x\cos(k_0x)\,dx:

J=[xsin⁡(k0x)k0]02−1k0∫02sin⁡(k0x) dx=2sin⁡(2k0)k0+cos⁡(2k0)−1k02=0+(−1)n−1k02,J = \left[\frac{x\sin(k_0x)}{k_0}\right]_0^2 - \frac{1}{k_0}\int_0^2\sin(k_0x)\,dx = \frac{2\sin(2k_0)}{k_0} + \frac{\cos(2k_0)-1}{k_0^2} = 0 + \frac{(-1)^n - 1}{k_0^2},

using ∫02sin⁡(k0x)dx=[−cos⁡(k0x)/k0]02=1−cos⁡(2k0)k0=1−(−1)nk0\int_0^2 \sin(k_0 x)dx = \left[-\cos(k_0x)/k_0\right]_0^2 = \frac{1-\cos(2k_0)}{k_0} = \frac{1-(-1)^n}{k_0}, so −1k0⋅1−(−1)nk0=(−1)n−1k02-\frac1{k_0}\cdot\frac{1-(-1)^n}{k_0} = \frac{(-1)^n-1}{k_0^2}. Thus

I2=−4(−1)nk0+2k0⋅(−1)n−1k02=−4(−1)nk0+2(−1)n−2k03.I_2 = -\frac{4(-1)^n}{k_0} + \frac{2}{k_0}\cdot\frac{(-1)^n-1}{k_0^2} = -\frac{4(-1)^n}{k_0} + \frac{2(-1)^n - 2}{k_0^3}.
I3=∫02x3sin⁡(k0x) dx=[−x3cos⁡(k0x)k0]02+3k0∫02x2cos⁡(k0x) dx.I_3 = \int_0^2 x^3\sin(k_0x)\,dx = \left[-\frac{x^3\cos(k_0x)}{k_0}\right]_0^2 + \frac{3}{k_0}\int_0^2 x^2\cos(k_0 x)\,dx.

Boundary term: −8(−1)nk0-\dfrac{8(-1)^n}{k_0}. For K:=∫02x2cos⁡(k0x)dxK:=\int_0^2 x^2\cos(k_0x)dx:

K=[x2sin⁡(k0x)k0]02−2k0∫02xsin⁡(k0x)dx=0−2k0I1=4(−1)nk02.K = \left[\frac{x^2\sin(k_0x)}{k_0}\right]_0^2 - \frac{2}{k_0}\int_0^2 x\sin(k_0x)dx = 0 - \frac{2}{k_0}I_1 = \frac{4(-1)^n}{k_0^2}.

So I3=−8(−1)nk0+3k0⋅4(−1)nk02=−8(−1)nk0+12(−1)nk03I_3 = -\dfrac{8(-1)^n}{k_0} + \dfrac{3}{k_0}\cdot\dfrac{4(-1)^n}{k_0^2} = -\dfrac{8(-1)^n}{k_0} + \dfrac{12(-1)^n}{k_0^3}. Now assemble:

An=4I1−4I2+I3.A_n = 4I_1 - 4I_2 + I_3.
4I1=−8(−1)nk0,−4I2=16(−1)nk0−8(−1)n−8k03,I3=−8(−1)nk0+12(−1)nk03.4I_1 = -\frac{8(-1)^n}{k_0}, \qquad -4I_2 = \frac{16(-1)^n}{k_0} - \frac{8(-1)^n - 8}{k_0^3}, \qquad I_3 = -\frac{8(-1)^n}{k_0} + \frac{12(-1)^n}{k_0^3}.

Sum the 1/k01/k_0 terms: −8(−1)n+16(−1)n−8(−1)n=0-8(-1)^n + 16(-1)^n - 8(-1)^n = 0. Sum the 1/k031/k_0^3 terms: −8(−1)n+8+12(−1)n=4(−1)n+8-8(-1)^n + 8 + 12(-1)^n = 4(-1)^n + 8. Hence

An=4(−1)n+8k03,k0=nπ2.A_n = \frac{4(-1)^n + 8}{k_0^3}, \qquad k_0 = \frac{n\pi}{2}.

So

An=8(4(−1)n+8)n3π3=32((−1)n+2)n3π3.A_n = \frac{8\big(4(-1)^n + 8\big)}{n^3\pi^3} = \frac{32\big((-1)^n + 2\big)}{n^3\pi^3}.

Check n=1n=1: A1=32(1)π3=32π3≈1.0335A_1 = \dfrac{32(1)}{\pi^3} = \dfrac{32}{\pi^3} \approx 1.0335. Check n=2n=2: A2=32(3)8π3=12π3≈0.3876A_2 = \dfrac{32(3)}{8\pi^3} = \dfrac{12}{\pi^3}\approx 0.3876. These are positive and decreasing, consistent with a smooth bump-shaped ff. The solution is

u(x,t)=∑n=1∞32((−1)n+2)n3π3 sin⁡ ⁣(nπx2)cos⁡ ⁣(3nπ2t).u(x,t) = \sum_{n=1}^\infty \frac{32\big((-1)^n+2\big)}{n^3\pi^3}\,\sin\!\left(\frac{n\pi x}{2}\right)\cos\!\left(\frac{3n\pi}{2}t\right).

Every term decays like 1/n31/n^3, so the series (and its termwise xx- and tt-derivatives up to order 2, which introduce at most a factor n2n^2) converge absolutely and uniformly — consistent with the hypothesis of the theorem, because f∈C2[0,2]f \in C^2[0,2] with matching boundary values f′′(0),f′′(2)f''(0), f''(2) conditions ensuring rapid Fourier decay.

Example 2 — nonzero initial velocity, asymmetric. Keep L=2,c=3L=2, c=3, now with f≡0f\equiv 0 and initial velocity

g(x)=sin⁡(πx)+12sin⁡ ⁣(3πx2).g(x) = \sin(\pi x) + \tfrac12 \sin\!\left(\tfrac{3\pi x}{2}\right).

Here g(0)=0g(0)=0, g(2)=sin⁡(2π)+12sin⁡(3π)=0g(2) = \sin(2\pi) + \tfrac12\sin(3\pi) = 0, matching compatibility, and gg is already exhibited as a finite sine series in the eigenfunctions sin⁡(nπx/2)\sin(n\pi x/2): comparing sin⁡(πx)=sin⁡(2⋅πx/2)\sin(\pi x) = \sin(2\cdot \pi x/2) to the n=2n=2 mode, and sin⁡(3πx/2)=sin⁡(3⋅πx/2)\sin(3\pi x/2) = \sin(3\cdot\pi x/2) to the n=3n=3 mode, we read off directly

B2′=1,B3′=12,Bn′=0 otherwise.B_2' = 1, \qquad B_3' = \tfrac12, \qquad B_n' = 0 \text{ otherwise.}

(No integration is needed precisely because gg was chosen as a finite combination of eigenfunctions — a useful shortcut whenever the data is already "modal.") With ωn=3nπ/2\omega_n = 3n\pi/2: ω2=3π\omega_2 = 3\pi, ω3=9π/2\omega_3 = 9\pi/2. Then B2=B2′/ω2=1/(3π)B_2 = B_2'/\omega_2 = 1/(3\pi) and B3=B3′/ω3=12/(9π/2)=1/(9π)B_3 = B_3'/\omega_3 = \tfrac12/(9\pi/2) = 1/(9\pi). Since f≡0f\equiv 0, all An=0A_n=0. The solution is exactly

u(x,t)=13πsin⁡(πx)sin⁡(3πt)+19πsin⁡ ⁣(3πx2)sin⁡ ⁣(9π2t),u(x,t) = \frac{1}{3\pi}\sin(\pi x)\sin(3\pi t) + \frac{1}{9\pi}\sin\!\left(\frac{3\pi x}{2}\right)\sin\!\left(\frac{9\pi}{2}t\right),

a finite sum, exhibiting exactly two modes ringing simultaneously at incommensurate-looking but actually rational-ratio frequencies 3π3\pi and 4.5π4.5\pi (ratio 2:32:3), producing an audibly non-periodic-looking but genuinely periodic beat pattern with period 44 (since cos⁡\cos terms would repeat every 2π/gcd⁡2\pi/\gcd-type combination; here the overall motion is periodic in tt with period 4/3⋅2=4/3\cdot 2= the least common period of 2π/(3π)=2/32\pi/(3\pi)=2/3 and 2π/(4.5π)=4/92\pi/(4.5\pi)=4/9, namely 4/34/3).

CounterexampleWhy the boundary conditions cannot be dropped

The theorem requires the fixed-end boundary conditions u(0,t)=u(L,t)=0u(0,t)=u(L,t)=0 to force the discrete spectrum λn=(nπ/L)2\lambda_n = (n\pi/L)^2 and hence the countable set of natural frequencies ωn\omega_n. Drop this hypothesis — consider the same wave equation utt=c2uxxu_{tt} = c^2 u_{xx} on 0<x<L0<x<L but with no boundary condition imposed — and the separated spatial problem becomes merely

X′′+λX=0X'' + \lambda X = 0

with no side conditions at all. For every real λ\lambda (positive, negative, or zero), this equation has nontrivial solutions: sin⁡(λx),cos⁡(λx)\sin(\sqrt\lambda x), \cos(\sqrt\lambda x) for λ>0\lambda>0; sinh⁡,cosh⁡\sinh, \cosh for λ<0\lambda <0; and 1,x1, x for λ=0\lambda = 0. There is no quantization of λ\lambda, hence no discrete set of natural frequencies, and no orthogonal eigenfunction basis to expand ff and gg in. Concretely, u(x,t)=sin⁡(αx)cos⁡(αct)u(x,t) = \sin(\alpha x)\cos(\alpha c t) solves the wave equation for any real α>0\alpha>0, so the family of separated solutions is a continuum, not a countable ladder. The Fourier-series solution formula in the theorem — a sum over integers nn — is meaningless without the boundary conditions supplying exactly the integers nn as the admissible mode indices. This is precisely why the boundary value problem, not the bare PDE, is the object whose spectrum produces the discrete musical harmonics of a real string.

Scope, edge cases & common traps

SituationWhat happens
ff or gg merely continuous, not C2/C1C^2/C^1Fourier series may converge to f,gf,g only in L2L^2 or pointwise a.e.; termwise differentiation may fail, so uu solves the PDE only in a weak/distributional sense
f(0)≠0f(0)\ne 0 or f(L)≠0f(L) \ne 0Incompatible with fixed-end boundary conditions; no classical solution of the stated problem exists
Free or mixed boundary conditions (e.g. ux(0,t)=0u_x(0,t)=0)Eigenfunctions become cosines or mixed sine/cosine; still discrete spectrum, different ωn\omega_n
g≡0g\equiv 0All Bn=0B_n=0; motion is purely "cosine in time," i.e. the string returns to its exact initial shape periodically
f≡0f\equiv 0All An=0A_n = 0; motion is purely "sine in time," starting flat but moving
Infinite string (L=∞L=\infty)Spectrum becomes continuous; sums become Fourier integrals/transforms, not series

The mathematician behind it

Origins · 1 minJean-Baptiste Joseph Fourier and how this was discovered
JJ
Jean-Baptiste Joseph Fourier
1768–1830 · Napoleonic France, mathematical physics of heat and vibration

Fourier developed the technique of expanding arbitrary functions in trigonometric series while studying heat conduction, in his 1822 treatise Théorie analytique de la chaleur. Although d'Alembert, Euler, and Daniel Bernoulli had already debated whether an arbitrary vibrating-string shape could be represented by a sine series decades earlier, it was Fourier's systematic machinery — the integral formulas for the coefficients, and the conviction that "arbitrary" functions could be so expanded — that turned the standing-wave decomposition into the general-purpose analytic tool used throughout this article.

History
- 1747: d'Alembert derives the wave equation and its traveling-wave solution for the vibrating string.
- 1753: Daniel Bernoulli proposes that the general solution is a superposition of sinusoidal standing-wave modes, sparking the "vibrating string controversy" with Euler and d'Alembert over what functions can be so represented.
- 1807–1822: Fourier develops trigonometric series expansions for heat conduction, providing the coefficient formulas later applied rigorously to the string problem.
- 1829: Dirichlet gives the first rigorous sufficient conditions for pointwise convergence of Fourier series, settling the convergence question left open by Bernoulli's claim.
- Late 19th–20th century: the eigenfunction-expansion viewpoint is generalized to arbitrary self-adjoint boundary value problems, becoming the Sturm–Liouville theory underlying quantum mechanics and modern PDE theory.
Why does the separation constant have to be the same for both the xx-equation and the tt-equation?

Because separation of variables produces the equation T′′(t)c2T(t)=X′′(x)X(x)\frac{T''(t)}{c^2T(t)} = \frac{X''(x)}{X(x)}, valid on an open set of (x,t)(x,t) pairs where X(x)T(t)≠0X(x)T(t)\ne 0. The left side depends only on tt, the right side only on xx. If you fix t=t0t=t_0 and let xx vary, the left side is a fixed number while the right side, a continuous function of xx, must equal that fixed number for all xx in an interval — so the right side is constant. The same argument run the other way shows the left side is that same constant. There is no freedom for the two sides to differ; equality of a function of xx alone and a function of tt alone, holding on a two-dimensional region, forces both to be one shared constant.

Why must the spatial eigenvalues be positive, ruling out λ≤0\lambda \le 0?

This is not assumed but proved directly by exhausting all three cases. For λ<0\lambda<0 the general solution is built from sinh⁡\sinh and cosh⁡\cosh, which are strictly monotonic (for sinh⁡\sinh) or always positive (for cosh⁡\cosh) on (0,∞)(0,\infty) for positive argument, so requiring X(0)=0X(0)=0 and X(L)=0X(L)=0 simultaneously forces every coefficient to zero. For λ=0\lambda=0 the general solution is affine, c1+c2xc_1+c_2x, and the two zero boundary conditions again force both constants to zero. Only for λ>0\lambda>0 does the oscillatory solution sin⁡(μx)\sin(\mu x) have the freedom to return to zero at a second point x=Lx=L without being identically zero, provided μL\mu L is an integer multiple of π\pi.

What physically is the difference between the coefficients AnA_n and BnB_n?

AnA_n measures how much of the nn-th standing-wave shape is present in the initial displacement f(x)f(x); it multiplies the cos⁡(ωnt)\cos(\omega_n t) term, so a mode excited purely through initial displacement starts at its full modal amplitude and oscillates like a cosine, momentarily at rest at t=0t=0. BnB_n measures how much of the nn-th mode's shape is present in the initial velocity g(x)g(x), but it is rescaled by 1/ωn1/\omega_n (via Bn=Bn′/ωnB_n = B_n'/\omega_n) because integrating an initial velocity into a displacement amplitude for an oscillator with frequency ωn\omega_n divides by that frequency. High-frequency modes are therefore excited less efficiently by a given raw velocity Fourier coefficient than low-frequency modes.

Does this method work if the string has variable density or tension?

Not directly in the form given here, but the same strategy generalizes. If the wave equation has variable coefficients, such as ρ(x)utt=(T(x)ux)x\rho(x)u_{tt} = (T(x)u_x)_x, separation of variables still splits the PDE into a temporal harmonic oscillator and a spatial ODE, but the spatial ODE becomes a general Sturm–Liouville eigenvalue problem instead of the constant-coefficient X′′+λX=0X''+\lambda X=0 studied here. The eigenfunctions are no longer plain sines, but Sturm–Liouville theory guarantees they still form a complete orthogonal basis, so the Fourier-series expansion and superposition argument carry over essentially unchanged, foreshadowing the broader theory of Eigenfunction Expansions.

Why is uniform convergence needed in the theorem, rather than just pointwise convergence?

Pointwise convergence of a series to a function says nothing about whether the derivative of the sum equals the sum of the derivatives; differentiating a convergent series termwise can produce a divergent or wrong-limit series. To legitimately swap the operations "sum over nn" and "take ∂x2\partial_x^2 or ∂t2\partial_t^2," analysis requires that the differentiated series also converge, and uniformly, on the domain of interest. Without this, the formal computation "utt=∑(un)ttu_{tt} = \sum (u_n)_{tt}" is unjustified, and the claim that the infinite sum satisfies the PDE at all would be an unproved leap, not a proof.

What happens to the solution formula if the string is released from rest but plucked asymmetrically, as in Example 1?

Nothing special breaks; the formula applies exactly as stated, with Bn=0B_n=0 for all nn since g≡0g\equiv 0, and AnA_n computed by the Euler integral against the asymmetric shape ff. The resulting motion is a sum of standing waves each scaled by cosine in time, so the string momentarily returns to its exact original (asymmetric) shape at times tt where all the relevant cosines simultaneously realign — which happens periodically if the frequencies ωn\omega_n are commensurate, exactly as in Example 1 where all ωn=3nπ/2\omega_n = 3n\pi/2 are integer multiples of ω1\omega_1.

Is the natural frequency ωn\omega_n the same as the ordinary (cyclic) frequency you'd hear as pitch?

No; ωn\omega_n as defined here is the angular frequency, in radians per unit time, appearing inside cos⁡(ωnt)\cos(\omega_n t) and sin⁡(ωnt)\sin(\omega_n t). The ordinary frequency in cycles per unit time (hertz, if time is in seconds) is fn=ωn/(2π)=nc/(2L)f_n = \omega_n/(2\pi) = nc/(2L). It is this fnf_n, not ωn\omega_n directly, that corresponds to the pitch you would perceive, and the ratio fn/f1=nf_n/f_1 = n is exactly why the overtones of a string are integer multiples of the fundamental pitch.

Before this

Where this leads