\require{cancel}\newcommand{\nicefrac}[2]{{{}^{#1}}\!/\!{{}_{#2}}} \newcommand{\unitfrac}[3][\!\!]{#1 \,\, {{}^{#2}}\!/\!{{}_{#3}}} \newcommand{\unit}[2][\!\!]{#1 \,\, #2} \newcommand{\noalign}[1]{} \newcommand{\qed}{\qquad \Box} \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&}

## Section4.7One dimensional wave equation

1 lecture, §9.6 in [EP], §10.7 in [BD]

Imagine we have a tensioned guitar string of length $L\text{.}$ 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 5.7.1.

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

\begin{equation*} \boxed{~~ y_{tt} = a^2 y_{xx} , ~~} \end{equation*}

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

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,

\begin{equation*} y(x,0) = f(x) \qquad \text{and} \qquad y_t (x,0) = g(x) , \end{equation*}

for some known functions $f(x)$ and $g(x)\text{.}$

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

$$\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}\label{wave_weq}\tag{10}$$

and

$$\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}\label{wave_zeq}\tag{11}$$

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)\text{.}$ Hence, $y$ is a solution to

$$\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}\label{wave_yeq}\tag{12}$$

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

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

\begin{equation*} X(x)T''(t) = a^2 X''(x) T(t) . \end{equation*}

Rewriting we get

\begin{equation*} \frac{T''(t)}{a^2 T(t)} = \frac{X''(x)}{X(x)} . \end{equation*}

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

\begin{equation*} \frac{T''(t)}{a^2 T(t)} = -\lambda = \frac{X''(x)}{X(x)} . \end{equation*}

We solve to get two ordinary differential equations

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

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

\begin{equation*} X_n(x) = \sin \left( \frac{n \pi}{L} \, x \right) . \end{equation*}

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

\begin{equation*} T_n(t) = A \cos \left( \frac{n \pi a}{L} \, t \right) + B \sin \left( \frac{n \pi a}{L} \, t \right). \end{equation*}

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

\begin{equation*} T_n(t) = \frac{L}{n \pi a} \sin \left( \frac{n \pi a}{L} \, t \right). \end{equation*}

Our building-block solutions are

\begin{equation*} w_n(x,t) = \frac{L}{n \pi a} \, \sin \left( \frac{n \pi}{L} \, x \right) \, \sin \left( \frac{n \pi a}{L} \, t \right) . \end{equation*}

We differentiate in $t\text{,}$ that is

\begin{equation*} \frac{\partial w_n}{\partial t}(x,t) = \sin \left( \frac{n \pi}{L} \, x \right) \, \cos \left( \frac{n \pi a}{L} \, t \right) . \end{equation*}

Hence,

\begin{equation*} \frac{\partial w_n}{\partial t}(x,0) = \sin \left( \frac{n \pi}{L} \, x \right) . \end{equation*}

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

\begin{equation*} g(x) = \sum_{n=1}^\infty b_n \sin \left( \frac{n \pi}{L} \, x \right) . \end{equation*}

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

\begin{equation*} w(x,t) = \sum_{n=1}^\infty b_n w_n(x,t) = \sum_{n=1}^\infty b_n \, \frac{L}{n \pi a} \, \sin \left( \frac{n \pi}{L} \, x \right) \, \sin \left( \frac{n \pi a}{L} \, t \right) . \end{equation*}
###### Exercise4.7.1

Check that $w(x,0) = 0$ and $w_t(x,0) = g(x)\text{.}$

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

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

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

\begin{equation*} X_n(x) = \sin \left( \frac{n \pi}{L} \, x \right) . \end{equation*}

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

\begin{equation*} T_n(t) = \cos \left( \frac{n \pi a}{L} \, t \right). \end{equation*}

Our building-block solution will be

\begin{equation*} z_n(x,t) = \sin \left( \frac{n \pi}{L} \, x \right) \, \cos \left( \frac{n \pi a}{L} \, t \right) . \end{equation*}

As $z_n(x,0) = \sin \left( \frac{n \pi}{L} \, x \right)\text{,}$ we expand $f(x)$ in terms of these sines as

\begin{equation*} f(x) = \sum_{n=1}^\infty c_n \sin \left( \frac{n \pi}{L} \, x \right) . \end{equation*}

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

\begin{equation*} z(x,t) = \sum_{n=1}^\infty c_n z_n(x,t) = \sum_{n=1}^\infty c_n \, \sin \left( \frac{n \pi}{L} \, x \right) \, \cos \left( \frac{n \pi a}{L} \, t \right) . \end{equation*}
###### Exercise4.7.2

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

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

###### Example4.7.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 5.7.6. That is

\begin{equation*} f(x) = \begin{cases} 0.1\, x & \text{if } \; 0 \leq x \leq 1 , \\ 0.1\, (2-x) & \text{if } \; 1 < x \leq 2 . \end{cases} \end{equation*}

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

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

\begin{equation*} f(x) = \sum_{n=1}^\infty \frac{0.8}{n^2 \pi^2} \sin \left( \frac{n \pi}{2} \right) \, \sin \left( \frac{n \pi}{2} \, x \right) . \end{equation*}

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

\begin{equation*} f(x) = \frac{0.8}{\pi^2} \sin \left( \frac{\pi}{2} \, x \right) - \frac{0.8}{9 \pi^2} \sin \left( \frac{3 \pi}{2} \, x \right) + \frac{0.8}{25 \pi^2} \sin \left( \frac{5 \pi}{2} \, x \right) - \cdots \end{equation*}

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

\begin{equation*} \begin{split} y(x,t) & = \sum_{n=1}^\infty \frac{0.8}{n^2 \pi^2} \, \sin \left( \frac{n \pi}{2} \right) \, \sin \left( \frac{n \pi}{2} \, x \right) \, \cos \left( \frac{n \pi}{2} \, t \right) \\ & = \sum_{m=1}^\infty \frac{0.8 {(-1)}^{m+1}}{{(2m-1)}^2 \pi^2} \, \sin \left( \frac{(2m-1) \pi}{2} \, x \right) \, \cos \left( \frac{(2m-1) \pi}{2} \, t \right) \\ & = \frac{0.8}{\pi^2} \, \sin \left( \frac{\pi}{2} \, x \right) \, \cos \left( \frac{\pi}{2} \, t \right) - \frac{0.8}{9 \pi^2} \, \sin \left( \frac{3 \pi}{2} \, x \right) \, \cos \left( \frac{3 \pi}{2} \, t \right) + \frac{0.8}{25 \pi^2} \, \sin \left( \frac{5 \pi}{2} \, x \right) \, \cos \left( \frac{5 \pi}{2} \, t \right) - \cdots \end{split} \end{equation*}

A plot for $0 < t < 3$ is given in Figure 5.7.7. 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\text{,}$ you can think of the function $y(x,t)$ as just a function of $x\text{.}$ This function gives you the shape of the string at time $t\text{.}$

### Subsection4.7.1Exercises

###### Exercise4.7.3

Solve

\begin{equation*} \begin{array}{ll} y_{tt} = 9 y_{xx} , & \\ y(0,t) = y(1,t) = 0 , & \\ y(x,0) = \sin (3\pi x) + \frac{1}{4} \sin (6 \pi x) & \qquad \text{for } \; 0 < x < 1 , \\ y_t(x,0) = 0 & \qquad \text{for } \; 0 < x < 1 . \end{array} \end{equation*}
###### Exercise4.7.4

Solve

\begin{equation*} \begin{array}{ll} y_{tt} = 4 y_{xx} , & \\ y(0,t) = y(1,t) = 0 , & \\ y(x,0) = \sin (3\pi x) + \frac{1}{4} \sin (6 \pi x) & \qquad \text{for } \; 0 < x < 1 , \\ y_t(x,0) = \sin (9 \pi x) & \qquad \text{for } \; 0 < x < 1 . \end{array} \end{equation*}
###### Exercise4.7.5

Derive the solution for a general plucked string of length $L\text{,}$ where we raise the string some distance $b$ at the midpoint and let go, and for any constant $a$ (in the equation $y_{tt} = a^2 y_{xx}$).

###### Exercise4.7.6

Imagine that a stringed musical instrument falls on the floor. Suppose that the length of the string is 1 and $a=1\text{.}$ When the musical instrument hits the ground the string was in rest position and hence $y(x,0) = 0\text{.}$ However, the string was moving at some velocity at impact ($t=0$), say $y_t(x,0) = -1\text{.}$ Find the solution $y(x,t)$ for the shape of the string at time $t\text{.}$

###### Exercise4.7.7

(challenging)   Suppose that you have a vibrating string and that there is air resistance proportional to the velocity. That is, you have

\begin{equation*} \begin{array}{ll} y_{tt} = a^2 y_{xx} - k y_t , & \\ y(0,t) = y(1,t) = 0 , & \\ y(x,0) = f(x) & \qquad \text{for } \; 0 < x < 1 , \\ y_t(x,0) = 0 & \qquad \text{for } \; 0 < x < 1 . \end{array} \end{equation*}

Suppose that $0 < k < 2 \pi a\text{.}$ Derive a series solution to the problem. Any coefficients in the series should be expressed as integrals of $f(x)\text{.}$

###### Exercise4.7.101

Solve

\begin{equation*} \begin{array}{ll} y_{tt} = y_{xx} , & \\ y(0,t) = y(\pi,t) = 0 , & \\ y(x,0) = \sin(x) & \qquad \text{for } \; 0 < x < \pi , \\ y_t(x,0) = \sin(x) & \qquad \text{for } \; 0 < x < \pi . \end{array} \end{equation*}

$y(x,t) = \sin(x) \, \bigl(\sin(t) + \cos(t)\bigr)$

###### Exercise4.7.102

Solve

\begin{equation*} \begin{array}{ll} y_{tt} = 25 y_{xx} , & \\ y(0,t) = y(2,t) = 0 , & \\ y(x,0) = 0 & \qquad \text{for } \; 0 < x < 2 , \\ y_t(x,0) = \sin(\pi t) + 0.1 \sin(2\pi t) & \qquad \text{for } \; 0 < x < 2 . \end{array} \end{equation*}

$y(x,t) = \frac{1}{5 \pi} \, \sin (\pi x) \, \sin (5 \pi t) + \frac{1}{100 \pi} \, \sin(2\pi x) \, \sin(10\pi t)$

###### Exercise4.7.103

Solve

\begin{equation*} \begin{array}{ll} y_{tt} = 2 y_{xx} , & \\ y(0,t) = y(\pi,t) = 0 , & \\ y(x,0) = x & \qquad \text{for } \; 0 < x < \pi , \\ y_t(x,0) = 0 & \qquad \text{for } \; 0 < x < \pi . \end{array} \end{equation*}
$y(x,t) = \sum\limits_{n=1}^\infty \frac{2{(-1)}^{n+1}}{n} \, \sin(nx) \, \cos( n \sqrt{2}\,t )$
Let's see what happens when $a=0\text{.}$ Find a solution to $y_{tt} = 0\text{,}$ $y(0,t) = y(\pi,t) = 0\text{,}$ $y(x,0) = \sin(2x)\text{,}$ $y_t(x,0) = \sin(x)\text{.}$
$y(x,t) = \sin(2x)+t\sin(x)$