Paul's Online Notes
Paul's Online Notes
Home / Differential Equations / Partial Differential Equations / Vibrating String
Show Mobile Notice Show All Notes Hide All Notes
Mobile Notice
You appear to be on a device with a "narrow" screen width (i.e. you are probably on a mobile phone). Due to the nature of the mathematics on this site it is best viewed in landscape mode. If your device is not in landscape mode many of the equations will run off the side of your device (you should be able to scroll/swipe to see them) and some of the menu items will be cut off due to the narrow screen width.

Section 9.8 : Vibrating String

This will be the final partial differential equation that we’ll be solving in this chapter. In this section we’ll be solving the 1-D wave equation to determine the displacement of a vibrating string. There really isn’t much in the way of introduction to do here so let’s just jump straight into the example.

Example 1 Find a solution to the following partial differential equation.

\[\begin{align*}& \frac{{{\partial ^2}u}}{{\partial {t^2}}} = {c^2}\frac{{{\partial ^2}u}}{{\partial {x^2}}}\\ & u\left( {x,0} \right) = f\left( x \right)\hspace{0.25in}\frac{{\partial u}}{{\partial t}}\left( {x,0} \right) = g\left( x \right)\\ & u\left( {0,t} \right) = 0\hspace{0.25in}u\left( {L,t} \right) = 0\end{align*}\]
Show Solution

One of the main differences here that we’re going to have to deal with is the fact that we’ve now got two initial conditions. That is not something we’ve seen to this point but will not be all that difficult to deal with when the time rolls around.

We’ve already done the separation of variables for this problem, but let’s go ahead and redo it here so we can say we’ve got another problem almost completely worked out.

So, let’s start off with the product solution.

\[u\left( {x,t} \right) = \varphi \left( x \right)h\left( t \right)\]

Plugging this into the two boundary conditions gives,

\[\varphi \left( 0 \right) = 0\hspace{0.25in}\varphi \left( L \right) = 0\]

Plugging the product solution into the differential equation, separating and introducing a separation constant gives,

\[\begin{align*}\frac{{{\partial ^2}}}{{\partial {t^2}}}\left( {\varphi \left( x \right)h\left( t \right)} \right) & = {c^2}\frac{{{\partial ^2}}}{{\partial {x^2}}}\left( {\varphi \left( x \right)h\left( t \right)} \right)\\ \varphi \left( x \right)\frac{{{d^2}h}}{{d{t^2}}} & = {c^2}h\left( t \right)\frac{{{d^2}\varphi }}{{d{x^2}}}\\ \frac{1}{{{c^2}h}}\frac{{{d^2}h}}{{d{t^2}}} & = \frac{1}{\varphi }\frac{{{d^2}\varphi }}{{d{x^2}}} = - \lambda \end{align*}\]

We moved the \({c^2}\) to the left side for convenience and chose \( - \lambda \) for the separation constant so the differential equation for \(\varphi \) would match a known (and solved) case.

The two ordinary differential equations we get from separation of variables are then,

\[\begin{align*}\frac{{{d^2}h}}{{d{t^2}}} + {c^2}\lambda h = 0\hspace{0.25in} & \frac{{{d^2}\varphi }}{{d{x^2}}} + \lambda \varphi=0 \\ & \varphi \left( 0 \right) = 0\hspace{0.25in}\varphi \left( L \right) = 0\end{align*}\]

We solved the boundary value problem above in Example 1 of the Solving the Heat Equation section of this chapter and so the eigenvalues and eigenfunctions for this problem are,

\[{\lambda _{\,n}} = {\left( {\frac{{n\pi }}{L}} \right)^2}\hspace{0.25in}{\varphi _n}\left( x \right) = \sin \left( {\frac{{n\,\pi \,x}}{L}} \right)\hspace{0.25in}n = 1,2,3, \ldots \]

The first ordinary differential equation is now,

\[\frac{{{d^2}h}}{{d{t^2}}} + {\left( {\frac{{n\pi c}}{L}} \right)^2}h = 0\]

and because the coefficient of the \(h\) is clearly positive the solution to this is,

\[h\left( t \right) = {c_1}\cos \left( {\frac{{n\pi c\,t}}{L}} \right) + {c_2}\sin \left( {\frac{{n\pi c\,t}}{L}} \right)\]

Because there is no reason to think that either of the coefficients above are zero we then get two product solutions,

\[\begin{array}{*{20}{c}}{{u_n}\left( {x,t} \right) = {A_n}\cos \left( {\frac{{n\pi c\,t}}{L}} \right)\sin \left( {\frac{{n\,\pi \,x}}{L}} \right)}\\{{u_n}\left( {x,t} \right) = {B_n}\sin \left( {\frac{{n\pi c\,t}}{L}} \right)\sin \left( {\frac{{n\,\pi \,x}}{L}} \right)}\end{array}\hspace{0.25in}n = 1,2,3, \ldots \]

The solution is then,

\[u\left( {x,t} \right) = \sum\limits_{n = 1}^\infty {\left[ {{A_n}\cos \left( {\frac{{n\pi c\,t}}{L}} \right)\sin \left( {\frac{{n\,\pi \,x}}{L}} \right) + {B_n}\sin \left( {\frac{{n\pi c\,t}}{L}} \right)\sin \left( {\frac{{n\,\pi \,x}}{L}} \right)} \right]} \]

Now, in order to apply the second initial condition we’ll need to differentiate this with respect to \(t\) so,

\[\frac{{\partial u}}{{\partial t}} = \sum\limits_{n = 1}^\infty {\left[ { - \frac{{n\pi c}}{L}{A_n}\sin \left( {\frac{{n\pi c\,t}}{L}} \right)\sin \left( {\frac{{n\,\pi \,x}}{L}} \right) + \frac{{n\pi c}}{L}{B_n}\cos \left( {\frac{{n\pi c\,t}}{L}} \right)\sin \left( {\frac{{n\,\pi \,x}}{L}} \right)} \right]} \]

If we now apply the initial conditions we get,

\[\begin{align*}& u\left( {x,0} \right) = f\left( x \right) = \sum\limits_{n = 1}^\infty {\left[ {{A_n}\cos \left( 0 \right)\sin \left( {\frac{{n\,\pi \,x}}{L}} \right) + {B_n}\sin \left( 0 \right)\sin \left( {\frac{{n\,\pi \,x}}{L}} \right)} \right]} = \sum\limits_{n = 1}^\infty {{A_n}\sin \left( {\frac{{n\,\pi \,x}}{L}} \right)} \\ & \frac{{\partial u}}{{\partial t}}\left( {x,0} \right) = g\left( x \right) = \sum\limits_{n = 1}^\infty {\frac{{n\pi c}}{L}{B_n}\sin \left( {\frac{{n\,\pi \,x}}{L}} \right)} \end{align*}\]

Both of these are Fourier sine series. The first is for \(f\left( x \right)\) on \(0 \le x \le L\) while the second is for \(g\left( x \right)\) on \(0 \le x \le L\) with a slightly messy coefficient. As in the last few sections we’re faced with the choice of either using the orthogonality of the sines to derive formulas for \({A_n}\) and \({B_n}\) or we could reuse formula from previous work.

It’s easier to reuse formulas so using the formulas form the Fourier sine series section we get,

\[\begin{align*}{A_{\,n}} & = \frac{2}{L}\int_{{\,0}}^{{\,L}}{{f\left( x \right)\sin \left( {\frac{{n\,\pi x}}{L}} \right)\,dx}}\,\,\,\,\,\,\,n = 1,2,3, \ldots \\ \frac{{n\pi c}}{L}{B_{\,n}} & = \frac{2}{L}\int_{{\,0}}^{{\,L}}{{g\left( x \right)\sin \left( {\frac{{n\,\pi x}}{L}} \right)\,dx}}\,\,\,\,\,\,\,n = 1,2,3, \ldots \end{align*}\]

Upon solving the second one we get,

\[\begin{align*}{A_{\,n}} & = \frac{2}{L}\int_{{\,0}}^{{\,L}}{{f\left( x \right)\sin \left( {\frac{{n\,\pi x}}{L}} \right)\,dx}}\,\,\,\,\,\,\,n = 1,2,3, \ldots \\ {B_{\,n}} & = \frac{2}{{n\pi c}}\int_{{\,0}}^{{\,L}}{{g\left( x \right)\sin \left( {\frac{{n\,\pi x}}{L}} \right)\,dx}}\,\,\,\,\,\,\,n = 1,2,3, \ldots \end{align*}\]

So, there is the solution to the 1-D wave equation and with that we’ve solved the final partial differential equation in this chapter.