#### 2.1.2 Both ends of string ﬁxed, initial velocity 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} & =0\\ u\left ( x,0\right ) & =f\left ( x\right ) =\frac{8x\left ( L-x\right ) ^{2}}{L^{3}} \end{align*}

solution

Let L=10 and $$a=1$$. Since domain is ﬁnite, it is easier to use the series solution for wave equation than D’Alembert solution. This is given by$u\left ( x,t\right ) =\sum _{n=1}^{\infty }c_{n}\cos \left ( \sqrt{\lambda _{n}}at\right ) \sin \left ( \sqrt{\lambda _{n}}x\right )$ Where $$\lambda _{n}=\left ( \frac{n\pi }{L}\right ) ^{2},n=1,2,3,\cdots$$ and $$c_{n}=\frac{2}{L}\int _{0}^{L}f\left ( x\right ) \sin \left ( \sqrt{\lambda _{n}}x\right ) dx$$. Hence, since $$a=1$$ and $$L=10$$, the solution becomes\begin{align*} u\left ( x,t\right ) & =\sum _{n=1}^{\infty }c_{n}\cos \left ( \frac{n\pi }{10}t\right ) \sin \left ( \frac{n\pi }{10}x\right ) \\ c_{n} & =\frac{2}{10}\int _{0}^{10}\frac{8x\left ( L-x\right ) ^{2}}{L^{3}}\sin \left ( \frac{n\pi }{10}x\right ) dx\\ & =\frac{2}{10}\int _{0}^{10}\frac{8x\left ( 10-x\right ) ^{2}}{10^{3}}\sin \left ( \frac{n\pi }{10}x\right ) dx \end{align*}

Integrating gives $c_{n}=\frac{32\left ( 2+\left ( -1\right ) ^{n}\right ) }{n^{3}\pi ^{3}}$ Hence solution is$u\left ( x,t\right ) =\frac{32}{\pi ^{3}}\sum _{n=1}^{\infty }\frac{2+\left ( -1\right ) ^{n}}{n^{3}}\cos \left ( \frac{n\pi }{10}t\right ) \sin \left ( \frac{n\pi }{10}x\right )$ Animation

For 60 seconds

Source code is