Differential EquationsPartial Differential Equations4 of 6
Partial Differential Equations · 4

The Wave Equation

We want to find the height u(x,t)\disp{u(x,t)} of a stretched string of length LL at any position xx and time tt as it vibrates between two fixed posts.

1

Why Curvature Causes Acceleration

To track how the string moves, we first need to see why the wave equation links acceleration in time on the left to bending in space on the right.

Why curvature causes acceleration
x=0x = 0
x=Lx = L
u(x,t)\htmlClass{lc-blue}{u(x,t)}
∂2u∂t2=c2 ∂2u∂x2\htmlClass{lc-orange}{\dfrac{\partial^2 u}{\partial t^2}} = c^2\,\htmlClass{lc-orange}{\dfrac{\partial^2 u}{\partial x^2}}
∂2u∂t2⏟verticalacceleration\displaystyle \underbrace{\bend{\frac{\partial^2 u}{\partial t^2}}}_{\substack{\bend{\text{vertical}} \\ \bend{\text{acceleration}}}} =c2∂2u∂x2⏟curvature\displaystyle = c^2 \underbrace{\bend{\frac{\partial^2 u}{\partial x^2}}}_{\bend{\text{curvature}}}

Here the wave speed cc is a positive constant set by how tight and how heavy the string is, and the partial derivatives ∂2u∂t2\bend{\frac{\partial^2 u}{\partial t^2}} and ∂2u∂x2\bend{\frac{\partial^2 u}{\partial x^2}} measure vertical acceleration in time tt and concavity in position xx at each spot along the string.

The tension pulls at the two ends cancel on any straight tilt, and only accelerate the segment up or down when it bends.
2

Standing Waves and Allowed Spatial Shapes

Instead of guessing a complicated vibration all at once, we look first for a standing wave, which is a single spatial shape X(x)\spatial{X(x)} that scales up and down in sync over time by a factor T(t)\timefn{T(t)}, written as u(x,t)=X(x)T(t)\disp{u(x,t)} = \spatial{X(x)}\timefn{T(t)}, on a string pinned down at both ends, u(0,t)=0\disp{u(0,t)} = 0 and u(L,t)=0\disp{u(L,t)} = 0. Just as in the heat equation on a rod with ends held at zero, separating the variables turns the spatial half of the problem into X′′(x)=−k2X(x)\bend{X''(x)} = -k^2 \spatial{X(x)} with X(0)=0\spatial{X(0)} = 0 and X(L)=0\spatial{X(L)} = 0.

Standing waves and allowed spatial shapes
00
LL
∂2u∂t2=c2 ∂2u∂x2\htmlClass{lc-orange}{\dfrac{\partial^2 u}{\partial t^2}} = c^2\,\htmlClass{lc-orange}{\dfrac{\partial^2 u}{\partial x^2}}
u(x,t)=  ?\htmlClass{lc-blue}{u(x,t)} = \;?

Plugging u(x,t)=X(x)T(t)\disp{u(x,t)} = \spatial{X(x)}\timefn{T(t)} into the wave equation and dividing both sides by c2X(x)T(t)c^2 \spatial{X(x)}\timefn{T(t)} puts all the tt terms on the left and all the xx terms on the right, so both sides must equal the same negative constant −k2-k^2:

T′′(t)c2T(t)\displaystyle \frac{\bend{T''(t)}}{c^2 \timefn{T(t)}} =X′′(x)X(x)\displaystyle = \frac{\bend{X''(x)}}{\spatial{X(x)}} =−k2\displaystyle = -k^2

In the spatial solution X(x)=Acos⁡(kx)+Bsin⁡(kx)\spatial{X(x)} = A\spatial{\cos(kx)} + B\spatial{\sin(kx)}, the left post X(0)=0\spatial{X(0)} = 0 eliminates cos⁡(kx)\spatial{\cos(kx)} because cos⁡(0)=1\spatial{\cos(0)} = 1, and the right post X(L)=0\spatial{X(L)} = 0 requires sin⁡(kL)=0\spatial{\sin(kL)} = 0, which restricts kLkL to whole-number multiples of π\pi:

kn=nπL,Xn(x)=sin⁡(nπxL)⏟nth allowed spatial shape(n half-loops)(n=1,2,3,… )\displaystyle \begin{aligned} & k_n = \frac{n\pi}{L}, \\ & \underbrace{\spatial{X_n(x)} = \spatial{\sin\left(\frac{n\pi x}{L}\right)}}_{\substack{n\text{th allowed spatial shape} \\ (n\text{ half-loops})}} \quad (n = 1, 2, 3, \dots) \end{aligned}
n=1n = 1
X1(x)=sin⁡(πxL)\htmlClass{lc-blue}{X_1(x)} = \htmlClass{lc-blue}{\sin\left(\dfrac{\pi x}{L}\right)}
n=2n = 2
X2(x)=sin⁡(2πxL)\htmlClass{lc-blue}{X_2(x)} = \htmlClass{lc-blue}{\sin\left(\dfrac{2\pi x}{L}\right)}
node at\text{node at}
x=L2x = \dfrac{L}{2}
n=3n = 3
X3(x)=sin⁡(3πxL)\htmlClass{lc-blue}{X_3(x)} = \htmlClass{lc-blue}{\sin\left(\dfrac{3\pi x}{L}\right)}
node at\text{node at}
x=L3x = \dfrac{L}{3}
node at\text{node at}
x=2L3x = \dfrac{2L}{3}
00
LL

Each harmonic nn fits nn half-loops between the posts at x=0x = 0 and x=Lx = L, creating n−1n - 1 motionless interior nodes along the string where sin⁡(nπxL)=0\spatial{\sin(\tfrac{n\pi x}{L})} = 0.

3

Time Oscillation and the Harmonic Mixing Board

Now that we know which spatial shapes Xn(x)\spatial{X_n(x)} can exist on the string, we solve the time half of the separated equation to find how each harmonic Tn(t)\timefn{T_n(t)} moves as time goes on.

Time oscillation and the harmonic mixing board
00
LL
T′′(t)c2 T(t)=X′′(x)X(x)=−k2kn=nπL\dfrac{\htmlClass{lc-orange}{T''(t)}}{c^2\,\htmlClass{lc-violet}{T(t)}} = \dfrac{\htmlClass{lc-orange}{X''(x)}}{\htmlClass{lc-blue}{X(x)}} = -k^2 \qquad k_n = \dfrac{n\pi}{L}
T(t)\htmlClass{lc-violet}{T(t)}
tt

With kn=nπLk_n = \frac{n\pi}{L}, the two time derivatives in the wave equation give a simple harmonic oscillator in time that vibrates back and forth forever instead of dying out:

Tn′′(t)=−(nπcL)2Tn(t),ωn=nπcL⏟naturalfrequency\displaystyle \begin{aligned} & \bend{T_n''(t)} = -\freq{\left(\frac{n\pi c}{L}\right)^2} \timefn{T_n(t)}, \\ & \underbrace{\freq{\omega_n} = \frac{n\pi c}{L}}_{\substack{\text{natural} \\ \text{frequency}}} \end{aligned}

Multiplying each allowed spatial shape Xn(x)\spatial{X_n(x)} by its time factor Tn(t)\timefn{T_n(t)} and adding all the harmonics together gives the general solution for a vibrating string with fixed ends:

u(x,t)=∑n=1∞sin⁡(nπxL)[Ancos⁡(nπcLt)⏟from initial shapeu(x,0)=f(x)+Bnsin⁡(nπcLt)⏟from initial velocity∂u∂t(x,0)=g(x)]\displaystyle \begin{aligned} \disp{u(x,t)} &= \sum_{n=1}^{\infty} \spatial{\sin\left(\frac{n\pi x}{L}\right)} \Bigg[ \\ & \quad \underbrace{\disp{A_n} \timefn{\cos\left(\frac{n\pi c}{L}t\right)}}_{\substack{\text{from initial shape} \\ \disp{u(x,0)} = \disp{f(x)}}} \\ & \quad + \underbrace{\vel{B_n} \timefn{\sin\left(\frac{n\pi c}{L}t\right)}}_{\substack{\text{from initial velocity} \\ \vel{\frac{\partial u}{\partial t}(x,0)} = \vel{g(x)}}} \Bigg] \end{aligned}

Squeezing nn half-loop arches into the same string length LL makes each arch nn times narrower, so at the same height it bends n2n^2 times as sharply, since Xn′′(x)=−(nπL)2Xn(x)\bend{X_n''(x)} = \bend{-\left(\frac{n\pi}{L}\right)^2} \spatial{X_n(x)}. That gives n2n^2 times the acceleration per unit of height, ωn2=(nπcL)2\freq{\omega_n^2} = \left(\frac{n\pi c}{L}\right)^2, so the nnth harmonic vibrates nn times as fast as the first harmonic, at frequency ωn=nπcL\freq{\omega_n} = \frac{n\pi c}{L}.

Fitting more arches onto the string bends each one more tightly, so it pulls back harder and vibrates faster.
4

Solving an Initial Shape Problem by Inspection

When a string's starting shape is already made of a few sine harmonics and it is released from rest, we can find u(x,t)\disp{u(x,t)} directly from the coefficients without computing any integrals:

∂2u∂t2=9∂2u∂x2(0<x<π),u(0,t)=0,u(π,t)=0\displaystyle \begin{aligned} \bend{\frac{\partial^2 u}{\partial t^2}} &= 9\bend{\frac{\partial^2 u}{\partial x^2}} \quad (0 < x < \pi), \\ \disp{u(0,t)} &= 0, \\ \disp{u(\pi,t)} &= 0 \end{aligned}
u(x,0)=4sin⁡(x)−2sin⁡(5x),∂u∂t(x,0)=0\displaystyle \begin{aligned} \disp{u(x,0)} &= 4\spatial{\sin(x)} - 2\spatial{\sin(5x)}, \\ \vel{\frac{\partial u}{\partial t}(x,0)} &= 0 \end{aligned}
Solving an initial shape problem by inspection
00
L=πL = \pi
c=3u(x,0)=4 sin⁡(x)−2 sin⁡(5x)∂u∂t(x,0)=0u(x,t)=  ?\begin{aligned} c &= 3 \\[2pt] \htmlClass{lc-blue}{u(x,0)} &= 4\,\htmlClass{lc-blue}{\sin(x)} - 2\,\htmlClass{lc-blue}{\sin(5x)} \\[2pt] \htmlClass{lc-pink}{\dfrac{\partial u}{\partial t}(x,0)} &= 0 \\[8pt] \htmlClass{lc-blue}{u(x,t)} &= \;? \end{aligned}
Text solution
Plug in L=πL = \pi and c=3c = 3Reading c=3c = 3 from c2=9c^2 = 9 and L=πL = \pi from the right endpoint gives spatial shapes sin⁡(nx)\spatial{\sin(nx)} and frequencies ωn=3n\freq{\omega_n} = 3n.
u(x,t)=∑n=1∞sin⁡(nx)[Ancos⁡(3nt)+Bnsin⁡(3nt)]\displaystyle \begin{aligned} \disp{u(x,t)} &= \sum_{n=1}^{\infty} \spatial{\sin(nx)}\big[\disp{A_n} \timefn{\cos(3nt)} \\ & \qquad + \vel{B_n} \timefn{\sin(3nt)}\big] \end{aligned}
Set all velocity coefficients Bn\vel{B_n} to zeroBecause the string is released from rest with ∂u∂t(x,0)=0\vel{\frac{\partial u}{\partial t}(x,0)} = 0, none of the sin⁡(3nt)\timefn{\sin(3nt)} terms are active.
Bn\displaystyle \vel{B_n} =0for all n\displaystyle = 0 \quad \text{for all } n
Match the starting shape at t=0t = 0Evaluating u(x,t)\disp{u(x,t)} at t=0t = 0 turns every cos⁡(3nt)\timefn{\cos(3nt)} into 11, so we match the sine coefficients directly against 4sin⁡(x)−2sin⁡(5x)4\spatial{\sin(x)} - 2\spatial{\sin(5x)}.
u(x,0)=A1sin⁡(x)+A2sin⁡(2x)+⋯+A5sin⁡(5x)+…=4sin⁡(x)−2sin⁡(5x)  ⟹  A1=4,A5=−2,all other An=0\displaystyle \begin{aligned} \disp{u(x,0)} &= \disp{A_1}\spatial{\sin(x)} + \disp{A_2}\spatial{\sin(2x)} \\ & \quad + \dots + \disp{A_5}\spatial{\sin(5x)} + \dots \\ &= 4\spatial{\sin(x)} - 2\spatial{\sin(5x)} \\ &\implies \disp{A_1} = 4, \quad \disp{A_5} = -2, \\ & \qquad \text{all other } \disp{A_n} = 0 \end{aligned}
Restore the cos⁡(3nt)\timefn{\cos(3nt)} time factorsPutting back cos⁡(3t)\timefn{\cos(3t)} for n=1n = 1 and cos⁡(15t)\timefn{\cos(15t)} for n=5n = 5 gives the complete motion.
u(x,t)=4sin⁡(x)cos⁡(3t)−2sin⁡(5x)cos⁡(15t)\displaystyle \begin{aligned} \disp{u(x,t)} &= 4\spatial{\sin(x)}\timefn{\cos(3t)} \\ & \quad - 2\spatial{\sin(5x)}\timefn{\cos(15t)} \end{aligned}

So the string vibrates as the sum of its 1st harmonic oscillating at frequency 3\freq{3} and its 5th harmonic oscillating five times faster at frequency 15\freq{15}.

5

Fourier Integrals for Initial Shape and Velocity

When the initial shape u(x,0)=f(x)\disp{u(x,0)} = \disp{f(x)} or initial velocity ∂u∂t(x,0)=g(x)\vel{\frac{\partial u}{\partial t}(x,0)} = \vel{g(x)} is not already a finite sum of sines, we find each harmonic's coefficient using the orthogonality of sine waves on [0,L][0, L]. Multiplying two different harmonics and integrating from 00 to LL cancels their positive and negative areas to zero, while a harmonic multiplied by itself integrates to L2\area{\frac{L}{2}} over length LL:

∫0Lsin⁡(nπxL)sin⁡(mπxL)dx=0(n≠m),∫0Lsin⁡2(nπxL)dx=L2\displaystyle \begin{aligned} \int_0^L \spatial{\sin\left(\textstyle\frac{n\pi x}{L}\right)}\spatial{\sin\left(\textstyle\frac{m\pi x}{L}\right)} dx &= 0 \\ & \quad (n \neq m), \\ \int_0^L \spatial{\sin^2\left(\textstyle\frac{n\pi x}{L}\right)} dx &= \area{\frac{L}{2}} \end{aligned}

After finding the general integral formulas for An\disp{A_n} and Bn\vel{B_n}, we will also solve for the motion of our L=πL = \pi, c=3c = 3 string when it starts flat and is given an initial velocity:

u(x,0)=0,∂u∂t(x,0)=12sin⁡(2x)\displaystyle \begin{aligned} \disp{u(x,0)} &= 0, \\ \vel{\frac{\partial u}{\partial t}(x,0)} &= 12\spatial{\sin(2x)} \end{aligned}
Fourier integrals for initial shape and velocity
00
LL
u(x,0)=f(x)∂u∂t(x,0)=0An=  ?\begin{aligned} \htmlClass{lc-blue}{u(x,0)} &= \htmlClass{lc-blue}{f(x)} \\[2pt] \htmlClass{lc-pink}{\dfrac{\partial u}{\partial t}(x,0)} &= 0 \\[8pt] \htmlClass{lc-blue}{A_n} &= \;? \end{aligned}

Setting t=0t = 0 in u(x,t)\disp{u(x,t)} matches f(x)\disp{f(x)} directly. To match the initial velocity g(x)\vel{g(x)}, we differentiate u(x,t)\disp{u(x,t)} with respect to tt first, which pulls a chain-rule factor of the frequency ωn=nπcL\freq{\omega_n} = \frac{n\pi c}{L} out in front of Bn\vel{B_n}:

u(x,0)=∑n=1∞Ansin⁡(nπxL)=f(x)  ⟹  An=2L∫0Lf(x)sin⁡(nπxL)dx\displaystyle \begin{aligned} \disp{u(x,0)} &= \sum_{n=1}^{\infty} \disp{A_n} \spatial{\sin\left(\frac{n\pi x}{L}\right)} \\ &= \disp{f(x)} \\ \implies \disp{A_n} &= \frac{2}{L} \int_0^L \disp{f(x)} \spatial{\sin\left(\frac{n\pi x}{L}\right)} dx \end{aligned}
∂u∂t(x,t)=∑n=1∞sin⁡(nπxL)[−An(nπcL)sin⁡(nπcLt)+Bn(nπcL)cos⁡(nπcLt)]\displaystyle \begin{aligned} \vel{\frac{\partial u}{\partial t}(x,t)} &= \sum_{n=1}^{\infty} \spatial{\sin\left(\frac{n\pi x}{L}\right)} \Bigg[ \\ & \quad -\disp{A_n}\freq{\left(\frac{n\pi c}{L}\right)}\timefn{\sin\left(\frac{n\pi c}{L}t\right)} \\ & \quad + \vel{B_n}\freq{\left(\frac{n\pi c}{L}\right)}\timefn{\cos\left(\frac{n\pi c}{L}t\right)} \Bigg] \end{aligned}
∂u∂t(x,0)=∑n=1∞(nπcLBn)⏟sine coefficientof g(x)sin⁡(nπxL)=g(x)  ⟹  Bn=2nπc∫0Lg(x)sin⁡(nπxL)dx\displaystyle \begin{aligned} \vel{\frac{\partial u}{\partial t}(x,0)} &= \sum_{n=1}^{\infty} \underbrace{\left(\freq{\frac{n\pi c}{L}} \vel{B_n}\right)}_{\substack{\text{sine coefficient} \\ \text{of } \vel{g(x)}}} \spatial{\sin\left(\frac{n\pi x}{L}\right)} \\ &= \vel{g(x)} \\ \implies \vel{B_n} &= \frac{2}{\freq{n\pi c}} \int_0^L \vel{g(x)} \spatial{\sin\left(\frac{n\pi x}{L}\right)} dx \end{aligned}
Text solution
Set all position coefficients An\disp{A_n} to zeroBecause the string starts completely flat at t=0t = 0, every cosine term drops out.
An\displaystyle \disp{A_n} =0for all n\displaystyle = 0 \quad \text{for all } n
Differentiate in tt and plug in t=0t = 0With L=πL = \pi and c=3c = 3, differentiating sin⁡(3nt)\timefn{\sin(3nt)} brings down the frequency ωn=3n\freq{\omega_n} = 3n in front of Bn\vel{B_n}.
∂u∂t(x,0)=∑n=1∞(3nBn)sin⁡(nx)=12sin⁡(2x)\displaystyle \begin{aligned} \vel{\frac{\partial u}{\partial t}(x,0)} &= \sum_{n=1}^{\infty} (\freq{3n} \vel{B_n}) \spatial{\sin(nx)} \\ &= 12\spatial{\sin(2x)} \end{aligned}
Match the n=2n = 2 velocity term and divide by ω2=6\freq{\omega_2} = 6Setting the n=2n = 2 velocity coefficient 3(2)B2\freq{3(2)}\vel{B_2} equal to 1212 gives the amplitude B2\vel{B_2}.
6B2=12  ⟹  B2=2,all other Bn=0\displaystyle \begin{aligned} \freq{6}\vel{B_2} &= 12 \\ \implies \vel{B_2} &= 2, \\ \text{all other } \vel{B_n} &= 0 \end{aligned}
Restore the sin⁡(6t)\timefn{\sin(6t)} time factorPutting the n=2n = 2 spatial and time factors together gives the string's motion.
u(x,t)\displaystyle \disp{u(x,t)} =2sin⁡(2x)sin⁡(6t)\displaystyle = 2\spatial{\sin(2x)}\timefn{\sin(6t)}

So even though the string is launched with peak velocity 1212, it only reaches a peak height of B2=2\vel{B_2} = 2 because the 2nd harmonic oscillates at frequency 6\freq{6}.

For the exact same starting velocity at t=0t = 0, higher harmonics reach a much smaller peak amplitude Bn\vel{B_n} because they reverse direction so quickly, which is why finding Bn\vel{B_n} requires dividing the velocity coefficient by the frequency nπcL\freq{\frac{n\pi c}{L}}.

For the same starting velocity, higher harmonics reverse direction sooner and reach a smaller peak height.
6

A Flat String Given a Uniform Velocity Kick

Now let's use the Fourier integral to find u(x,t)\disp{u(x,t)} when a flat string of length LL receives a constant upward velocity v0\vel{v_0} across its entire length from 00 to LL:

u(x,0)=0,∂u∂t(x,0)=v0(0<x<L)\displaystyle \begin{aligned} \disp{u(x,0)} &= 0, \\ \vel{\frac{\partial u}{\partial t}(x,0)} &= \vel{v_0} \quad (0 < x < L) \end{aligned}
A flat string given a uniform velocity kick
00
LL
u(x,0)=0\htmlClass{lc-blue}{u(x,0)} = 0
g(x)=v0\htmlClass{lc-pink}{g(x)} = \htmlClass{lc-pink}{v_0}
Bn=  ?\htmlClass{lc-pink}{B_n} = \;?
Text solution
Set all position coefficients An\disp{A_n} to zeroBecause the string starts flat with u(x,0)=0\disp{u(x,0)} = 0, all An=0\disp{A_n} = 0.
An\displaystyle \disp{A_n} =0for all n\displaystyle = 0 \quad \text{for all } n
Integrate the constant velocity v0\vel{v_0}Plugging g(x)=v0\vel{g(x)} = \vel{v_0} into the Bn\vel{B_n} integral brings out a second factor of 1nπ\frac{1}{\spatial{n\pi}} when we integrate sin⁡(nπxL)\spatial{\sin(\tfrac{n\pi x}{L})}.
Bn=2nπc∫0Lv0sin⁡(nπxL)dx=2v0nπc[−Lnπcos⁡(nπxL)]0L=2Lv0n2π2c(1−cos⁡(nπ))\displaystyle \begin{aligned} \vel{B_n} &= \frac{2}{\freq{n\pi c}} \int_0^L \vel{v_0} \spatial{\sin\left(\frac{n\pi x}{L}\right)} dx \\ &= \frac{2\vel{v_0}}{\freq{n\pi c}} \left[ -\frac{L}{\spatial{n\pi}} \spatial{\cos\left(\frac{n\pi x}{L}\right)} \right]_0^L \\ &= \frac{2L\vel{v_0}}{n^2\pi^2 c}\big(1 - \cos(n\pi)\big) \end{aligned}
Separate even and odd nnBecause cos⁡(nπ)=1\cos(n\pi) = 1 for even nn and cos⁡(nπ)=−1\cos(n\pi) = -1 for odd nn, 1−cos⁡(nπ)1 - \cos(n\pi) is 00 for even harmonics and 22 for odd harmonics.
Bn={0if n=2,4,6,…4Lv0n2π2cif n=1,3,5,…\displaystyle \vel{B_n} = \begin{cases} 0 & \text{if } n = 2, 4, 6, \dots \\ \dfrac{4L\vel{v_0}}{n^2\pi^2 c} & \text{if } n = 1, 3, 5, \dots \end{cases}
Sum over the odd harmonicsPutting the odd Bn\vel{B_n} coefficients together with their spatial and time sines gives the full motion.
u(x,t)=4Lv0π2c∑n=1,3,5,…∞1n2sin⁡(nπxL)sin⁡(nπcLt)\displaystyle \begin{aligned} \disp{u(x,t)} &= \frac{4L\vel{v_0}}{\pi^2 c} \sum_{n=1,3,5,\dots}^{\infty} \frac{1}{n^2} \\ & \qquad \spatial{\sin\left(\frac{n\pi x}{L}\right)} \timefn{\sin\left(\frac{n\pi c}{L}t\right)} \end{aligned}

So only the symmetric odd harmonics are active for a symmetric upward push, and their amplitudes drop off rapidly as 1n2\frac{1}{n^2}: one nn comes from integrating the spatial sine wave and a second nn comes from dividing by the time frequency nπcL\freq{\frac{n\pi c}{L}}. You can spot right away that the even-nn coefficients from an initial shape or velocity are zero whenever that shape or velocity is symmetric across the midpoint x=L2x = \frac{L}{2}, since mirroring an even harmonic across the midpoint turns it upside down, sin⁡(nπ(L−x)L)=−sin⁡(nπxL)\spatial{\sin\left(\frac{n\pi(L - x)}{L}\right)} = -\spatial{\sin\left(\frac{n\pi x}{L}\right)}, so its integrals over the two halves cancel.

7

Putting the Four Pieces Together

Every standing-wave problem on a fixed string comes down to combining four pieces: the allowed sine shapes, their time frequencies, the initial shape coefficients An\disp{A_n}, and the initial velocity coefficients Bn\vel{B_n}.

Putting the four pieces together
x=0x = 0
x=Lx = L
∂2u∂t2=c2 ∂2u∂x2\htmlClass{lc-orange}{\dfrac{\partial^2 u}{\partial t^2}} = c^2\,\htmlClass{lc-orange}{\dfrac{\partial^2 u}{\partial x^2}}
u(x,0)=f(x)∂u∂t(x,0)=g(x)\htmlClass{lc-blue}{u(x,0)} = \htmlClass{lc-blue}{f(x)} \qquad \htmlClass{lc-pink}{\dfrac{\partial u}{\partial t}(x,0)} = \htmlClass{lc-pink}{g(x)}
u(x,t)=  ?\htmlClass{lc-blue}{u(x,t)} = \;?

Key concepts

To solve ∂2u∂t2=c2∂2u∂x2\bend{\frac{\partial^2 u}{\partial t^2}} = c^2 \bend{\frac{\partial^2 u}{\partial x^2}} on a string of length LL with fixed ends u(0,t)=0\disp{u(0,t)} = 0 and u(L,t)=0\disp{u(L,t)} = 0, start by reading the wave speed cc (the square root of the coefficient on ∂2u∂x2\bend{\frac{\partial^2 u}{\partial x^2}}, so c2=16c^2 = 16 means c=4c = 4) and the length LL to write the allowed spatial shapes Xn(x)=sin⁡(nπxL)\spatial{X_n(x)} = \spatial{\sin\left(\frac{n\pi x}{L}\right)} and their natural frequencies ωn=nπcL\freq{\omega_n} = \frac{n\pi c}{L}. These fit together in the general solution

u(x,t)=∑n=1∞sin⁡(nπxL)[Ancos⁡(ωnt)+Bnsin⁡(ωnt)]\displaystyle \begin{aligned} \disp{u(x,t)} &= \sum_{n=1}^{\infty} \spatial{\sin\left(\frac{n\pi x}{L}\right)} \Big[ \disp{A_n} \timefn{\cos(\omega_n t)} \\ & \qquad + \vel{B_n} \timefn{\sin(\omega_n t)} \Big] \end{aligned}

Before setting up any integral, check what happens at t=0t = 0: if the string is released from rest (∂u∂t(x,0)=0\vel{\frac{\partial u}{\partial t}(x,0)} = 0), every Bn=0\vel{B_n} = 0 right away; if the string starts flat (u(x,0)=0\disp{u(x,0)} = 0), every An=0\disp{A_n} = 0 right away. Next, look at the form of the nonzero initial condition:

Already a sum of sines (do not integrate)

If u(x,0)\disp{u(x,0)} or ∂u∂t(x,0)\vel{\frac{\partial u}{\partial t}(x,0)} is already made of harmonics sin⁡(nπxL)\spatial{\sin\left(\frac{n\pi x}{L}\right)}, match coefficients at t=0t = 0. For position, u(x,0)=4sin⁡(x)−2sin⁡(5x)\disp{u(x,0)} = 4\spatial{\sin(x)} - 2\spatial{\sin(5x)} on [0,π][0, \pi] gives A1=4\disp{A_1} = 4 and A5=−2\disp{A_5} = -2 directly. For velocity, differentiating sin⁡(ωnt)\timefn{\sin(\omega_n t)} brings out ωn\freq{\omega_n}, so match ωnBn\freq{\omega_n} \vel{B_n} to the given velocity coefficient and divide by ωn\freq{\omega_n}: if ∂u∂t(x,0)=12sin⁡(2x)\vel{\frac{\partial u}{\partial t}(x,0)} = 12\spatial{\sin(2x)} with ωn=3n\freq{\omega_n} = 3n, then 3(2)B2=12\freq{3(2)}\vel{B_2} = 12, giving B2=2\vel{B_2} = 2.

Any other shape or velocity (use the Fourier sine integrals)

When f(x)\disp{f(x)} or g(x)\vel{g(x)} is a triangle, a constant velocity v0\vel{v_0}, or a piecewise function, integrate against sin⁡(nπxL)\spatial{\sin\left(\frac{n\pi x}{L}\right)}, remembering that Bn\vel{B_n} has an extra ωn=nπcL\freq{\omega_n} = \frac{n\pi c}{L} in the denominator so that 2L\frac{2}{L} divided by nπcL\freq{\frac{n\pi c}{L}} becomes 2nπc\frac{2}{\freq{n\pi c}}:

An=2L∫0Lf(x)sin⁡(nπxL)dx,Bn=2nπc∫0Lg(x)sin⁡(nπxL)dx\displaystyle \begin{aligned} \disp{A_n} &= \frac{2}{L} \int_0^L \disp{f(x)} \spatial{\sin\left(\frac{n\pi x}{L}\right)} dx, \\ \vel{B_n} &= \frac{2}{\freq{n\pi c}} \int_0^L \vel{g(x)} \spatial{\sin\left(\frac{n\pi x}{L}\right)} dx \end{aligned}
8

Practice

1

A string of length L=2L = 2 with fixed ends u(0,t)=0\disp{u(0,t)} = 0 and u(2,t)=0\disp{u(2,t)} = 0 obeys ∂2u∂t2=16∂2u∂x2\bend{\frac{\partial^2 u}{\partial t^2}} = 16\bend{\frac{\partial^2 u}{\partial x^2}}. For the 3rd harmonic (n=3n = 3), find the spatial shape X3(x)\spatial{X_3(x)}, the positions of all interior nodes (motionless points), and the natural angular frequency ω3\freq{\omega_3}.

In the wave equation, the number multiplying ∂2u∂x2\bend{\frac{\partial^2 u}{\partial x^2}} is c2c^2, not cc; where inside (0,2)(0, 2) does 3πx2\frac{3\pi x}{2} equal a whole-number multiple of π\pi?

From c2=16c^2 = 16 we have c=4c = 4 (using c=16c = 16 directly without taking the square root is a common mistake here and gives the wrong frequency 24π24\pi). With L=2L = 2 and n=3n = 3, the 3rd spatial shape is X3(x)=sin⁡(3πx2)\spatial{X_3(x)} = \spatial{\sin\left(\frac{3\pi x}{2}\right)}. Its interior nodes occur where sin⁡(3πx2)=0\spatial{\sin\left(\frac{3\pi x}{2}\right)} = 0 inside (0,2)(0, 2), so 3πx2=π\frac{3\pi x}{2} = \pi and 2π2\pi, which gives x=23x = \frac{2}{3} and x=43x = \frac{4}{3}. Its natural angular frequency is ω3=3πcL=3π(4)2=6π\freq{\omega_3} = \frac{3\pi c}{L} = \frac{3\pi(4)}{2} = 6\pi.
2

Solve ∂2u∂t2=25∂2u∂x2\bend{\frac{\partial^2 u}{\partial t^2}} = 25\bend{\frac{\partial^2 u}{\partial x^2}} on 0<x<20 < x < 2 with fixed ends u(0,t)=0\disp{u(0,t)} = 0 and u(2,t)=0\disp{u(2,t)} = 0, initial shape u(x,0)=3sin⁡(πx2)−5sin⁡(3πx2)\disp{u(x,0)} = 3\spatial{\sin\left(\frac{\pi x}{2}\right)} - 5\spatial{\sin\left(\frac{3\pi x}{2}\right)}, and released from rest, ∂u∂t(x,0)=0\vel{\frac{\partial u}{\partial t}(x,0)} = 0.

Since u(x,0)\disp{u(x,0)} is already written in terms of sin⁡(nπx2)\spatial{\sin\left(\frac{n\pi x}{2}\right)}, which harmonics nn are active, and what is ωn=nπcL\freq{\omega_n} = \frac{n\pi c}{L} for each one?

Here L=2L = 2 and c=5c = 5, so ωn=5nπ2\freq{\omega_n} = \frac{5n\pi}{2}. Because the string is released from rest, every Bn=0\vel{B_n} = 0. Matching u(x,0)\disp{u(x,0)} at t=0t = 0 gives A1=3\disp{A_1} = 3, A3=−5\disp{A_3} = -5, and all other An=0\disp{A_n} = 0. Restoring the cos⁡(ωnt)\timefn{\cos(\omega_n t)} time factors for n=1n = 1 (ω1=5π2\freq{\omega_1} = \frac{5\pi}{2}) and n=3n = 3 (ω3=15π2\freq{\omega_3} = \frac{15\pi}{2}) gives u(x,t)=3sin⁡(πx2)cos⁡(5πt2)−5sin⁡(3πx2)cos⁡(15πt2)\disp{u(x,t)} = 3\spatial{\sin\left(\frac{\pi x}{2}\right)}\timefn{\cos\left(\frac{5\pi t}{2}\right)} - 5\spatial{\sin\left(\frac{3\pi x}{2}\right)}\timefn{\cos\left(\frac{15\pi t}{2}\right)}. Watch out for forgetting to multiply the second frequency by n=3n = 3 or dropping L=2L = 2, which gives cos⁡(5πt2)\cos\left(\frac{5\pi t}{2}\right) or cos⁡(15πt)\cos(15\pi t) on the second term.
3

Solve ∂2u∂t2=4∂2u∂x2\bend{\frac{\partial^2 u}{\partial t^2}} = 4\bend{\frac{\partial^2 u}{\partial x^2}} on 0<x<π0 < x < \pi with fixed ends u(0,t)=0\disp{u(0,t)} = 0 and u(π,t)=0\disp{u(\pi,t)} = 0, initial shape u(x,0)=5sin⁡(2x)\disp{u(x,0)} = 5\spatial{\sin(2x)}, and initial velocity ∂u∂t(x,0)=18sin⁡(3x)−4sin⁡(2x)\vel{\frac{\partial u}{\partial t}(x,0)} = 18\spatial{\sin(3x)} - 4\spatial{\sin(2x)}.

Both initial conditions are already sums of sin⁡(nx)\spatial{\sin(nx)}, so write out ∂u∂t(x,0)=∑ωnBnsin⁡(nx)\vel{\frac{\partial u}{\partial t}(x,0)} = \sum \freq{\omega_n} \vel{B_n} \spatial{\sin(nx)} before matching the velocity coefficients.

Here L=πL = \pi and c=2c = 2, so Xn(x)=sin⁡(nx)\spatial{X_n(x)} = \spatial{\sin(nx)} and ωn=2n\freq{\omega_n} = 2n. Matching the initial shape at t=0t = 0 gives A2=5\disp{A_2} = 5 and all other An=0\disp{A_n} = 0. For the initial velocity, matching ∑(2nBn)sin⁡(nx)=−4sin⁡(2x)+18sin⁡(3x)\sum (\freq{2n} \vel{B_n})\spatial{\sin(nx)} = -4\spatial{\sin(2x)} + 18\spatial{\sin(3x)} gives 4B2=−4\freq{4}\vel{B_2} = -4 (so B2=−1\vel{B_2} = -1), 6B3=18\freq{6}\vel{B_3} = 18 (so B3=3\vel{B_3} = 3), and all other Bn=0\vel{B_n} = 0 (reading B2=−4B_2 = -4 and B3=18B_3 = 18 straight off the given velocity without dividing by ω2=4\freq{\omega_2} = 4 and ω3=6\freq{\omega_3} = 6 is the likeliest mistake and gives 5sin⁡(2x)cos⁡(4t)−4sin⁡(2x)sin⁡(4t)+18sin⁡(3x)sin⁡(6t)5\sin(2x)\cos(4t) - 4\sin(2x)\sin(4t) + 18\sin(3x)\sin(6t)). Putting the harmonics together gives u(x,t)=sin⁡(2x)[5cos⁡(4t)−sin⁡(4t)]+3sin⁡(3x)sin⁡(6t)\disp{u(x,t)} = \spatial{\sin(2x)}\big[5\timefn{\cos(4t)} - \timefn{\sin(4t)}\big] + 3\spatial{\sin(3x)}\timefn{\sin(6t)}.
4

A string of length LL with wave speed cc and fixed ends at x=0x = 0 and x=Lx = L is plucked at its midpoint to height hh, forming the triangular shape u(x,0)=2hLx\disp{u(x,0)} = \frac{2h}{L}x for 0≤x≤L20 \le x \le \frac{L}{2} and u(x,0)=2hL(L−x)\disp{u(x,0)} = \frac{2h}{L}(L - x) for L2≤x≤L\frac{L}{2} \le x \le L, and is released from rest (∂u∂t(x,0)=0\vel{\frac{\partial u}{\partial t}(x,0)} = 0). Find the series solution u(x,t)\disp{u(x,t)}.

Split the Fourier sine integral for An\disp{A_n} at x=L2x = \frac{L}{2} and integrate by parts.

Because the string is released from rest, all Bn=0\vel{B_n} = 0. Using the Fourier sine integral An=2L∫0Lu(x,0)sin⁡(nπxL)dx\disp{A_n} = \frac{2}{L} \int_0^L \disp{u(x,0)}\spatial{\sin\left(\frac{n\pi x}{L}\right)} dx across the two halves and integrating by parts gives An=8hn2π2sin⁡(nπ2)\disp{A_n} = \frac{8h}{n^2\pi^2}\sin\left(\frac{n\pi}{2}\right), which is 00 for even nn and equals 8hn2π2(−1)(n−1)/2\frac{8h}{n^2\pi^2}(-1)^{(n-1)/2} for odd nn (be careful not to replace sin⁡(nπ2)\sin\left(\frac{n\pi}{2}\right) with +1+1 for every odd nn, which misses the alternating sign (−1)(n−1)/2(-1)^{(n-1)/2} on n=3,7,…n = 3, 7, \dots). Restoring the cosine time factors gives u(x,t)=8hπ2∑n=1,3,5,…∞(−1)(n−1)/2n2sin⁡(nπxL)cos⁡(nπcLt)\disp{u(x,t)} = \frac{8h}{\pi^2} \sum_{n=1,3,5,\dots}^{\infty} \frac{(-1)^{(n-1)/2}}{n^2} \spatial{\sin\left(\frac{n\pi x}{L}\right)} \timefn{\cos\left(\frac{n\pi c}{L}t\right)}.
5

A flat string of length LL (u(x,0)=0\disp{u(x,0)} = 0) with wave speed cc and fixed ends at x=0x = 0 and x=Lx = L receives an upward velocity kick on only its left half: ∂u∂t(x,0)=v0\vel{\frac{\partial u}{\partial t}(x,0)} = \vel{v_0} for 0<x<L20 < x < \frac{L}{2} and ∂u∂t(x,0)=0\vel{\frac{\partial u}{\partial t}(x,0)} = 0 for L2<x<L\frac{L}{2} < x < L. Find u(x,t)\disp{u(x,t)} and explain why even harmonics such as n=2n = 2 are active here when they were zero for a full-string uniform kick.

Integrate v0sin⁡(nπxL)\vel{v_0} \spatial{\sin\left(\frac{n\pi x}{L}\right)} only from 00 to L2\frac{L}{2} where the velocity is nonzero, and evaluate cos⁡(nπxL)\spatial{\cos\left(\frac{n\pi x}{L}\right)} at the upper bound x=L2x = \frac{L}{2}.

Because the string starts flat, all An=0\disp{A_n} = 0. For the velocity coefficients, integrating from 00 to L2\frac{L}{2} gives Bn=2nπc∫0L/2v0sin⁡(nπxL)dx=2Lv0n2π2c(1−cos⁡(nπ2))\vel{B_n} = \frac{2}{\freq{n\pi c}} \int_0^{L/2} \vel{v_0} \spatial{\sin\left(\frac{n\pi x}{L}\right)} dx = \frac{2L\vel{v_0}}{n^2\pi^2 c}\left(1 - \cos\left(\frac{n\pi}{2}\right)\right) (using 2L\frac{2}{L} in front of the integral instead of 2nπc\frac{2}{\freq{n\pi c}} is the main mistake and leaves out dividing by the frequency, giving 2v0nπ(1−cos⁡(nπ2))\frac{2v_0}{n\pi}\left(1 - \cos\left(\frac{n\pi}{2}\right)\right) with only a single nn in the denominator). Unlike a uniform push across the entire string, a push on only the left half is not symmetric across the midpoint x=L2x = \frac{L}{2}, so it pushes the left half up relative to the right half and activates even harmonics such as n=2n = 2, where 1−cos⁡(π)=2≠01 - \cos(\pi) = 2 \neq 0. Putting the harmonics together gives u(x,t)=2Lv0π2c∑n=1∞1−cos⁡(nπ2)n2sin⁡(nπxL)sin⁡(nπcLt)\disp{u(x,t)} = \frac{2L\vel{v_0}}{\pi^2 c} \sum_{n=1}^{\infty} \frac{1 - \cos(\tfrac{n\pi}{2})}{n^2} \spatial{\sin\left(\frac{n\pi x}{L}\right)} \timefn{\sin\left(\frac{n\pi c}{L}t\right)}.