Differential Equations for EngineersXYZ Homework Edition

⇩ Download ▾

4.7 One Dimensional Wave Equation

Imagine we have a tensioned guitar string of length LL. Suppose we only consider vibrations in one direction. That is, let xx denote the position along the string, let tt denote time, and let yy denote the displacement of the string from the rest position. See Figure 1\PageIndex{1}.

Diagram of a vibrating string of length L over a faint guitar outline, pulled up into a sharp triangular peak at its midpoint, with an arrow there labelled y for displacement.
Figure 1\PageIndex{1}: Vibrating string of length LL, xx is position, yy is displacement.

The equation that governs this setup is the so-called one-dimensional wave equation:

y t t = a 2 y x x , y_{tt}=a^2 y_{xx}, \nonumber

for some constant a>0a>0. The intuition is similar to the heat equation, replacing velocity with acceleration: the acceleration at a specific point is proportional to the second derivative of the shape of the string. In other words when the string is concave down then uxxu_{xx} is negative and the string wants to accelerate downwards, so uttu_{tt} should be negative. And vice versa. The wave equation is an example of a hyperbolic PDE.

Assume that the ends of the string are fixed in place:

y ( 0 , t ) = 0 and y ( L , t ) = 0 . y(0,t)=0 \quad\text{and}\quad y(L,t)=0. \nonumber

Note that we have two conditions along the xx axis as there are two derivatives in the xx direction.

There are also two derivatives along the tt direction and hence we need two further conditions here. We need to know the initial position and the initial velocity of the string. That is, for some known functions f(x)f(x) and g(x)g(x), we impose

y ( x , 0 ) = f ( x ) and y t ( x , 0 ) = g ( x ) . y(x,0)=f(x) \quad\text{and}\quad y_t(x,0)=g(x). \nonumber

As the equation is again linear, superposition works just as it did for the heat equation. And again we will use separation of variables to find enough building-block solutions to get the overall solution. There is one change however. It will be easier to solve two separate problems and add their solutions.

The two problems we will solve are

wtt=a2wxx,w(0,t)=w(L,t)=0,w(x,0)=0for 0<x<L,wt(x,0)=g(x)for 0<x<L,\label{wave:weq} \begin{array}{ll} w_{tt} = a^2 w_{xx}, & \\ w(0,t) = w(L,t) = 0, & \\ w(x,0) = 0 & \qquad \text{for } \; 0 < x < L, \\ w_t(x,0) = g(x) & \qquad \text{for } \; 0 < x < L, \end{array}

(4.7.1)
and

ztt=a2zxx,z(0,t)=z(L,t)=0,z(x,0)=f(x)for 0<x<L,zt(x,0)=0for 0<x<L.\label{wave:zeq} \begin{array}{ll} z_{tt} = a^2 z_{xx}, & \\ z(0,t) = z(L,t) = 0, & \\ z(x,0) = f(x) & \qquad \text{for } \; 0 < x < L, \\ z_t(x,0) = 0 & \qquad \text{for } \; 0 < x < L. \end{array}

(4.7.2)

The principle of superposition implies that y=w+zy=w+z solves the wave equation and furthermore y(x,0)=w(x,0)+z(x,0)=f(x)y(x,0)=w(x,0)+z(x,0)=f(x) and yt(x,0)=wt(x,0)+zt(x,0)=g(x)y_t(x,0)=w_t(x,0)+z_t(x,0)=g(x). Hence, yy is a solution to

y t t = a 2 y x x , y ( 0 , t ) = y ( L , t ) = 0 , y ( x , 0 ) = f ( x ) for  0 < x < L , y t ( x , 0 ) = g ( x ) for  0 < x < L . \label{wave:yeq} \begin{array}{ll} y_{tt} = a^2 y_{xx}, & \\ y(0,t) = y(L,t) = 0, & \\ y(x,0) = f(x) & \qquad \text{for } \; 0 < x < L, \\ y_t(x,0) = g(x) & \qquad \text{for } \; 0 < x < L. \end{array}

(4.7.3)

The reason for all this complexity is that superposition only works for homogeneous conditions such as y(0,t)=y(L,t)=0y(0,t)=y(L,t)=0, y(x,0)=0y(x,0)=0, or yt(x,0)=0y_t(x,0)=0. Therefore, we will be able to use the idea of separation of variables to find many building-block solutions solving all the homogeneous conditions. We can then use them to construct a solution solving the remaining nonhomogeneous condition.

Let us start with (4.7.1). We try a solution of the form w(x,t)=X(x)T(t)w(x,t)=X(x)T(t) again. We plug into the wave equation to obtain

X ( x ) T ( t ) = a 2 X ( x ) T ( t ) . X(x)T''(t)=a^2 X''(x)T(t). \nonumber

Rewriting we get

T ( t ) a 2 T ( t ) = X ( x ) X ( x ) . \dfrac{T''(t)}{a^2 T(t)}= \dfrac{X''(x)}{X(x)}. \nonumber

Again, left hand side depends only on tt and the right hand side depends only on xx. Therefore, both equal a constant, which we will denote by λ- \lambda.

T ( t ) a 2 T ( t ) = λ = X ( x ) X ( x ) . \dfrac{T''(t)}{a^2 T(t)}= - \lambda = \dfrac{X''(x)}{X(x)}. \nonumber

We solve to get two ordinary differential equations

X ( x ) + λ X ( x ) = 0 , T ( t ) + λ a 2 T ( t ) = 0 . \begin{align}\begin{aligned} X''(x)+ \lambda X(x) &=0, \\ T''(t)+ \lambda a^2T(t) &=0.\end{aligned}\end{align} \nonumber

The conditions 0=w(0,t)=X(0)T(t)0=w(0,t)=X(0)T(t) implies X(0)=0X(0)=0 and w(L,t)=0w(L,t)=0 implies that X(L)=0X(L)=0. Therefore, the only nontrivial solutions for the first equation are when λ=λn=n2π2L2\lambda = \lambda_n = \dfrac{n^2 \pi^2}{L^2} and they are

X n ( x ) = sin ( n π L x ) . X_n(x)= \sin \left( \dfrac{n \pi}{L}x \right). \nonumber

The general solution for TT for this particular λn\lambda_n is

T n ( t ) = A cos ( n π a L t ) + B sin ( n π a L t ) . T_n(t)= A \cos \left( \dfrac{n \pi a}{L}t \right) + B \sin \left( \dfrac{n \pi a}{L}t \right). \nonumber

We also have the condition that w(x,0)=0w(x,0)=0 or X(x)T(0)=0X(x)T(0)=0. This implies that T(0)=0T(0)=0, which in turn forces A=0A=0. It is convenient to pick B=LnπaB= \dfrac{L}{n \pi a} (you will see why in a moment) and hence

T n ( t ) = L n π a sin ( n π a L t ) . T_n(t)= \dfrac{L}{n \pi a} \sin \left( \dfrac{n \pi a}{L}t \right). \nonumber

Our building-block solutions are

w n ( x , t ) = L n π a sin ( n π L x ) sin ( n π a L t ) . w_n(x,t)= \dfrac{L}{n \pi a} \sin \left( \dfrac{n \pi }{L}x \right) \sin \left( \dfrac{n \pi a}{L}t \right). \nonumber

We differentiate in tt, that is

w n t ( x , t ) = sin ( n π L x ) cos ( n π a L t ) . \dfrac{\partial w_n}{\partial t}(x,t)= \sin \left( \dfrac{n \pi }{L}x \right) \cos \left( \dfrac{n \pi a}{L}t \right). \nonumber

Hence,

w n t ( x , 0 ) = sin ( n π L x ) . \dfrac{\partial w_n}{\partial t}(x,0)= \sin \left( \dfrac{n \pi }{L}x \right). \nonumber

We expand g(x)g(x) in terms of these sines as

g ( x ) = n = 1 b n sin ( n π L x ) . g(x)= \sum_{n=1}^{\infty} b_n \sin \left( \dfrac{n \pi}{L}x \right). \nonumber

Using superposition we can just write down the solution to (4.7.1) as a series

w ( x , t ) = n = 1 b n w n ( x , t ) = n = 1 b n L n π a sin ( n π L x ) sin ( n π a L t ) . w(x,t)= \sum_{n=1}^{\infty} b_n w_n(x,t) = \sum_{n=1}^{\infty} b_n \dfrac{L}{n \pi a} \sin \left( \dfrac{n \pi }{L}x \right) \sin \left( \dfrac{n \pi a}{L}t \right). \nonumber

Similarly we proceed to solve (4.7.2). We again try z(x,y)=X(x)T(t)z(x,y)=X(x)T(t). The procedure works exactly the same at first. We obtain

X ( x ) + λ X ( x ) = 0 , T ( t ) + λ a 2 T ( t ) = 0 . \begin{align}\begin{aligned} X''(x)+ \lambda X(x) &=0, \\ T''(t)+ \lambda a^2T(t) &=0.\end{aligned}\end{align} \nonumber

and the conditions X(0)=0X(0)=0, X(L)=0X(L)=0. So again λ=λn=n2π2L2\lambda = \lambda_n = \dfrac{n^2 \pi^2}{L^2} and

X n ( x ) = sin ( n π L x ) . X_n(x)= \sin \left( \dfrac{n \pi}{L}x \right). \nonumber

This time the condition on TT is T(0)=0T'(0)=0. Thus we get that B=0B=0 and we take

T n ( t ) = cos ( n π a L t ) . T_n(t)= \cos \left( \dfrac{n \pi a}{L}t \right). \nonumber

Our building-block solution will be

z n ( x , t ) = sin ( n π L x ) cos ( n π a L t ) . z_n(x,t)= \sin \left( \dfrac{n \pi}{L}x \right) \cos \left( \dfrac{n \pi a}{L}t \right). \nonumber

As zn(x,0)=sin(nπLx)z_{n}(x,0)=\sin\left(\frac{n\pi}{L}x\right), we expand f(x)f(x) in terms of these sines as

f ( x ) = n = 1 c n sin ( n π L x ) . f(x)= \sum_{n=1}^{\infty}c_n \sin \left( \dfrac{n \pi}{L}x \right). \nonumber

And we write down the solution to (4.7.2) as a series

z ( x , t ) = n = 1 c n z n ( x , t ) = n = 1 c n sin ( n π L x ) cos ( n π a L t ) . z(x,t)= \sum_{n=1}^{\infty}c_n z_n (x,t)= \sum_{n=1}^{\infty} c_n \sin \left( \dfrac{n \pi}{L}x \right) \cos \left( \dfrac{n \pi a}{L}t \right). \nonumber

Putting these two solutions together, let us state the result as a theorem.

One thing to take away from all this is how a guitar sounds. Notice that the (angular) frequencies that come up in the solution are nπaLn \frac{\pi a}{L}. That is, there is a certain base fundamental frequency πaL\frac{\pi a}{L}, and then we also get all the multiples of this frequency, which in music are called the overtones. Which overtones appear and with what amplitude is what musicians call the timbre of the note. Mathematicians usually call this the spectrum. Because all the frequencies are multiples of one frequency (the fundamental) we get a nice pleasing sound.

The fundamental frequency πaL\frac{\pi a}{L} increases as we decrease length LL. That is, if we place a finger on the fingerboard and then pluck a string we get a higher note. The constant aa is given by

a=Tρ,a = \sqrt{\frac{T}{\rho}}, \nonumber

where TT is tension and ρ\rho is the linear density of the string. Tightening the string (turning the tuning peg on a guitar) increases aa and hence produces a higher fundamental frequency (a higher note). On the other hand using a heavier string reduces aa and produces a lower fundamental frequency (a lower note). A bass guitar has longer thicker strings, while a ukulele has short strings made of lighter material.

Something rather interesting is the almost symmetry between space and time. In its simplest form we see this symmetry in the solutions

sin(nπLx)sin(nπaLt).\sin \left( \frac{n \pi}{L} x \right) \sin \left( \frac{n \pi a}{L} t \right). \nonumber

Except for the aa, time and space are just the same.

In general, the solution for a fixed xx is a Fourier series in tt, for a fixed tt it is a Fourier series in xx, and the coefficients are related. If the shape f(x)f(x) or the initial velocity have lots of corners, then the sound wave will have lots of corners. That is because the Fourier coefficients of the initial shape decay to zero (as nn \to \infty) at the same rate as the Fourier coefficients of the wave in time (for some fixed xx). So if you use a sharp object to pick the string, you get a sharper sound with lots of high frequency components, while if you use your thumb, you get a softer sound without so many high overtones. Similarly if you pluck close to the bridge, you are getting a pluck that looks more like the sawtooth, and you get an even sharper sound.

In fact, if you look at the formula for the solution, you see that for any fixed xx we get an almost arbitrary Fourier series in tt, everything except the constant term. You can essentially obtain any sound you want by plucking the string in just the right way. Of course we are considering an ideal string of no stiffness and no air resistance. Those variables clearly impact the sound as well.

Adapted from Differential Equations for Engineers by Jiří Lebl (https://www.jirka.org/diffyqs/), © Jiří Lebl, licensed under CC BY-SA 4.0. Changes were made. License: CC-BY-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or ADA Title II. Every page is built against an automated accessibility gate, and the published editions will meet ADA Title II requirements when they release in late September 2026. If something is unusable, please tell us.