#### 2.1.1 Both ends of string ﬁxed, initial position zero, Fourier series solution

Solve, $$0<x<L$$

$\frac{\partial ^{2}u}{\partial t^{2}}=a^{2}\frac{\partial ^{2}u}{\partial x^{2}}\qquad 0<x<L,t>0$ Boundary conditions, $$t>0$$\begin{align*} u\left ( 0,t\right ) & =0\\ u\left ( L,t\right ) & =0 \end{align*}

Initial conditions, $$t=0$$\begin{align*} \frac{\partial u\left ( x,0\right ) }{\partial t} & =g\left ( x\right ) =\frac{8x\left ( L-x\right ) ^{2}}{L^{3}}\\ u\left ( x,0\right ) & =0 \end{align*}

Let $$L=10,a=1$$ for animation.

Solution

Since domain is ﬁnite, it is easier to use the series solution for wave equation than D’Alembert solution. The eigenvalue ODE is gives solution for $$\lambda >0$$ as$X_{n}\left ( x\right ) =c_{n}\sin \left ( \sqrt{\lambda _{n}}x\right )$ Where $$\lambda _{n}=\left ( \frac{n\pi }{L}\right ) ^{2},n=1,2,3,\cdots \$$The time solution is $$T_{n}\left ( t\right ) =A_{n}\cos \left ( \sqrt{\lambda _{n}}at\right ) +B_{n}\sin \left ( \sqrt{\lambda _{n}}at\right )$$. At $$t=0$$, this gives $$0=A_{n}$$. Therefore $$T_{n}\left ( t\right ) =B_{n}\sin \left ( \sqrt{\lambda _{n}}at\right )$$. Hence the complete solution is\begin{align*} u\left ( x,t\right ) & =\sum _{n=1}^{\infty }c_{n}T_{n}\left ( t\right ) X_{n}\left ( x\right ) \\ & =\sum _{n=1}^{\infty }c_{n}\sin \left ( \sqrt{\lambda _{n}}at\right ) \sin \left ( \sqrt{\lambda _{n}}x\right ) \end{align*}

To ﬁnd $$c_{n}$$, taking the time derivative of the above gives$\frac{\partial }{\partial t}u\left ( x,t\right ) =\sum _{n=1}^{\infty }c_{n}\sqrt{\lambda _{n}}\cos \left ( \sqrt{\lambda _{n}}at\right ) \sin \left ( \sqrt{\lambda _{n}}x\right )$ At $$t=0$$ the above becomes$g\left ( x\right ) =\sum _{n=1}^{\infty }c_{n}\sqrt{\lambda _{n}}\sin \left ( \sqrt{\lambda _{n}}x\right )$ Applying orthogonality\begin{align*} \int _{0}^{L}g\left ( x\right ) \sin \left ( \sqrt{\lambda _{n}}x\right ) dx & =\sqrt{\lambda _{n}}c_{n}\frac{L}{2}\\ c_{n} & =\frac{2}{L\sqrt{\lambda _{n}}}\int _{0}^{L}g\left ( x\right ) \sin \left ( \sqrt{\lambda _{n}}x\right ) dx \end{align*}

Hence since $$g\left ( x\right ) =\frac{8x\left ( L-x\right ) ^{2}}{L^{3}}$$, $$L=10,a=1$$ the above becomes$c_{n}=\frac{2}{10\left ( \frac{n\pi }{10}\right ) }\int _{0}^{10}\frac{8x\left ( 10-x\right ) ^{2}}{10^{3}}\sin \left ( \frac{n\pi }{10}x\right ) dx$ Integrating the above gives$c_{n}=\frac{320\left ( 2+\left ( -1\right ) ^{n}\right ) }{n^{4}\pi ^{4}}$ Therefore the solution is\begin{align*} u\left ( x,t\right ) & =\sum _{n=1}^{\infty }\frac{320\left ( 2+\left ( -1\right ) ^{n}\right ) }{n^{4}\pi ^{4}}T_{n}\left ( t\right ) X_{n}\left ( x\right ) \\ & =\frac{320}{\pi ^{4}}\sum _{n=1}^{\infty }\frac{2+\left ( -1\right ) ^{n}}{n^{4}}\sin \left ( \sqrt{\lambda _{n}}at\right ) \sin \left ( \sqrt{\lambda _{n}}x\right ) \end{align*}

Animation

Animation for 60 seconds

Source code is