$$\newcommand{\id}{\mathrm{id}}$$ $$\newcommand{\Span}{\mathrm{span}}$$ $$\newcommand{\kernel}{\mathrm{null}\,}$$ $$\newcommand{\range}{\mathrm{range}\,}$$ $$\newcommand{\RealPart}{\mathrm{Re}}$$ $$\newcommand{\ImaginaryPart}{\mathrm{Im}}$$ $$\newcommand{\Argument}{\mathrm{Arg}}$$ $$\newcommand{\norm}[1]{\| #1 \|}$$ $$\newcommand{\inner}[2]{\langle #1, #2 \rangle}$$ $$\newcommand{\Span}{\mathrm{span}}$$

# 4.7: One dimensional wave equation

Imagine we have a tensioned guitar string of length $$L$$. Suppose we only consider vibrations in one direction. That is, let $$x$$ denote the position along the string, let $$t$$ denote time, and let $$y$$ denote the displacement of the string from the rest position. See Figure 4.18.

Figure 4.18: Vibrating string.

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

$y_{tt}=a^2 y_{xx},$

for some constant $$a>0$$. Assume that the ends of the string are fixed in place:

$y(0,t)=0 ~~~~ {\rm{and}}~~~~ y(L,t)=0.$

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

There are also two derivatives along the $$t$$ 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,

$y(x,0)=f(x) ~~~~ {\rm{and}}~~~~ y_t(x,0)=g(x).$

for some known functions $$f(x)$$ and $$g(x)$$.

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

$w_{tt}=a^2 w_{xx}, \\ w(0,t)=w(L,t)=0, \\ w(x,0)=0 ~~~~~~~~~~~~~~~ {\rm{for}}~0<x<L, \\ w_t(x,0)=g(x) ~~~~~~~~~~ {\rm{for}}~0<x<L.$

and

$z_{tt}=a^2 z_{xx}, \\ z(0,t)=z(L,t)=0, \\ z(x,0)=f(x)~~~~~~~~~ {\rm{for}}~0<x<L, \\ z_t(x,0)=0 ~~~~~~~~~~~~ {\rm{for}}~0<x<L.$

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

$y_{tt}=a^2 y_{xx}, \\ y(0,t)=y(L,t)=0, \\ y(x,0)=f(x)~~~~~~~~~ {\rm{for}}~0<x<L, \\ y_t(x,0)=g(x) ~~~~~~~~~~~~ {\rm{for}}~0<x<L.$

The reason for all this complexity is that superposition only works for homogeneous conditions such as $$y(0,t)=y(L,t)=0$$, $$y(x,0)=0$$, or $$y_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.4). We try a solution of the form $$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).$

Rewriting we get

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

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

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

We solve to get two ordinary differential equations

$X''(x)+ \lambda X(x)=0, \\ T''(t)+ \lambda a^2T(t)=0.$

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

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

The general solution for $$T$$ for this particular $$\lambda_n$$ is

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

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

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

Our building-block solutions are

$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).$

We differentiate in $$x$$, that is

$\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).$

Hence,

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

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

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

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

$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).$

Exercise $$\PageIndex{1}$$:

Check that $$w(x,0)=0$$ and $$w_t(x,0)=g(x)$$.

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

$X''(x)+ \lambda X(x)=0, \\ T''(t)+ \lambda a^2T(t)=0.$

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

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

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

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

Our building-block solution will be

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

We expand $$f(x)$$ in terms of these sines as

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

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

$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).$

Exercise $$\PageIndex{2}$$:

Fill in the details in the derivation of the solution of (4.11). Check that the solution satisfies all the side conditions.

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

Theorem 4.7.1. Take the equation

$y_{tt}=a^2 y_{xx}, \\ y(0,t)=y(L,t)=0, \\ y(x,0)=f(x)~~~~~~~~~ {\rm{for}}~0<x<L, \\ y_t(x,0)=g(x) ~~~~~~~~~~~~ {\rm{for}}~0<x<L.$

where

$f(x)= \sum_{n=1}^{\infty} c_n \sin \left( \dfrac{n \pi}{L}x \right),$

and

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

Then the solution $$y(x,t)$$ can be written as a sum of the solutions of (4.7.4) and (4.7.5). In other words,

$y(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) + c_n \sin \left( \dfrac{n \pi}{L}x \right) \cos \left( \dfrac{n \pi a}{L}t \right) \\ = \sum_{n=1}^{\infty} \sin \left( \dfrac{n \pi}{L}x \right) \left[ b_n \dfrac{L}{n \pi a} \sin \left( \dfrac{n \pi a}{L}t \right) +c_n \cos \left( \dfrac{n \pi a}{L}t \right) \right].$

Example $$\PageIndex{1}$$

Let us try a simple example of a plucked string. Suppose that a string of length 2 is plucked in the middle such that it has the initial shape given in Figure 4.19. That is

$f(x)= \left\{ \begin{array}{cc} 0.1x & {\rm{if}}~ 0 \leq x \leq 1, \\ 0.1(2-x) & {\rm{if}}~ 1 < x \leq 2 \end{array} \right. .$

The string starts at rest ($$g(x)=0$$). Suppose that $$a=1$$ in the wave equation for simplicity.

Figure 4.19: Plucked string.

We leave it to the reader to compute the sine series of $$f(x)$$. The series will be

$f(x)= \sum_{n=1}^{\infty} \dfrac{0.8}{n^2 \pi^2} \sin \left( \dfrac{n \pi}{2} \right) \sin \left( \dfrac{n \pi}{2} x \right).$

Note that $$\sin \left( \dfrac{n \pi}{2} \right)$$ is the sequence $$1,0,-1,0,1,0,-1, \ldots$$ for $$n=1,2,3,4, \ldots$$. Therefore,

$f(x)= \dfrac{0.8}{ \pi^2} \sin \left( \dfrac{\pi}{2}x \right) - \dfrac{0.8}{9 \pi^2} \sin \left( \dfrac{3 \pi}{2}x \right) + \dfrac{0.8}{25 \pi^2} \sin \left( \dfrac{5 \pi}{2}x \right) - \cdots$

The solution $$y(x,t)$$ is given by

$y(x,t)= \sum_{n=1}^{\infty} \dfrac{0.8}{n^2 \pi^2} \sin \left( \dfrac{n \pi}{2} \right) \sin \left( \dfrac{n \pi}{2} x \right) \cos \left( \dfrac{n \pi}{2} t \right) \\ = \sum_{n=1}^{\infty} \dfrac{0.8(-1)^{m+1}}{(2m-1)^2 \pi^2} \sin \left( \dfrac{(2m-1) \pi}{2}x \right) \cos \left( \dfrac{(2m-1) \pi}{2} t \right) \\ = \dfrac{0.8}{ \pi^2} \sin \left( \dfrac{\pi}{2}x \right) \cos \left( \dfrac{\pi}{2}t \right) - \dfrac{0.8}{9 \pi^2} \sin \left( \dfrac{3 \pi}{2}x \right) \cos \left( \dfrac{3 \pi}{2}t \right) + \dfrac{0.8}{25 \pi^2} \sin \left( \dfrac{5 \pi}{2}x \right) \cos \left( \dfrac{5 \pi}{2}t \right) - \cdots$

Figure 4.20: Shape of the plucked string for $$0<t<3$$.

A plot for $$0<t<3$$ is given in Figure 4.20. Notice that unlike the heat equation, the solution does not become “smoother,” the “sharp edges” remain. We will see the reason for this behavior in the next section where we derive the solution to the wave equation in a different way. Make sure you understand what the plot, such as the one in the figure, is telling you. For each fixed $$t$$, you can think of the function $$y(x,t)$$ as just a function of $$x$$. This function gives you the shape of the string at time $$t$$.