2.1.4 Left end fixed, right end free, initial velocity zero, Fourier series solution

Solve, \(0<x<L\)\[ \frac{\partial ^{2}u}{\partial t^{2}}=c^{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\\ \left . \frac{\partial u}{\partial x}\right \vert _{x=L} & =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 ) \end{align*}

Solution

Separation of variables gives the eigenvalue ODE\begin{align*} X^{\prime \prime }+\lambda X & =0\\ X\left ( 0\right ) & =0\\ X^{\prime }\left ( L\right ) & =0 \end{align*}

It is know that only \(\lambda >0\) gives non-trivial solution in this case. Hence solution is\[ X\left ( x\right ) =A\cos \left ( \sqrt{\lambda }x\right ) +B\sin \left ( \sqrt{\lambda }x\right ) \] Since \(X\left ( 0\right ) =0\) then the above gives \(0=A\) and the solution becomes\[ X\left ( x\right ) =B\sin \left ( \sqrt{\lambda }x\right ) \] Taking derivatives\[ X^{\prime }\left ( x\right ) =\sqrt{\lambda }B\cos \left ( \sqrt{\lambda }x\right ) \] Since \(X^{\prime }\left ( L\right ) =0\) the above becomes\[ 0=\sqrt{\lambda }B\cos \left ( \sqrt{\lambda }L\right ) \] Which implies \(\sqrt{\lambda }L=\frac{n\pi }{2}\) for \(n=1,3,5,\cdots \) or \[ \lambda _{n}=\left ( \frac{n\pi }{2L}\right ) ^{2}\qquad n=1,3,5,\cdots \] Hence \[ X_{n}\left ( x\right ) =c_{n}\sin \left ( \sqrt{\lambda _{n}}x\right ) \] The time ODE becomes\[ T_{n}\left ( t\right ) =A_{n}\cos \left ( \sqrt{\lambda _{n}}ct\right ) +B_{n}\sin \left ( \sqrt{\lambda _{n}}ct\right ) \] Taking derivatives gives\[ T_{n}^{\prime }\left ( t\right ) =-\sqrt{\lambda _{n}}cA_{n}\sin \left ( \sqrt{\lambda _{n}}ct\right ) +\sqrt{\lambda _{n}}cB_{n}\cos \left ( \sqrt{\lambda _{n}}ct\right ) \] Since initial velocity is zero, then the above becomes\[ 0=\sqrt{\lambda _{n}}cB_{n}\] Which means \(B_{n}=0\) and the time ODE becomes\[ T_{n}\left ( t\right ) =A_{n}\cos \left ( \sqrt{\lambda _{n}}ct\right ) \] Hence the fundamental solution is \(u_{n}=T_{n}X_{n}\) or by superposition\begin{align*} u\left ( x,t\right ) & =\sum _{n=1,3,5,\cdots }^{\infty }c_{n}\cos \left ( \sqrt{\lambda _{n}}ct\right ) \sin \left ( \sqrt{\lambda _{n}}x\right ) \\ \lambda _{n} & =\left ( \frac{n\pi }{2L}\right ) ^{2}\qquad n=1,3,5,\cdots \end{align*}

\(c_{n}\) is now found from initial position. At \(t=0\) the solution becomes\[ f\left ( x\right ) =\sum _{n=1,3,5,\cdots }^{\infty }c_{n}\sin \left ( \sqrt{\lambda _{n}}x\right ) \] By orthogonality\[ c_{n}=\frac{2}{L}\int _{0}^{L}f\left ( x\right ) \sin \left ( \sqrt{\lambda _{n}}x\right ) dx \] This complete the solution.

Animation

Solve, \(0<x<L\)\[ \frac{\partial ^{2}u}{\partial t^{2}}=c^{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\\ \left . \frac{\partial u}{\partial x}\right \vert _{x=L} & =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 ) =\left \{ \begin{array} [c]{ccc}\frac{3h}{L}x & & 0<x<\frac{L}{3}\\ h & & \frac{L}{3}<x<L \end{array} \right . \end{align*}

Use \(c=4,h=0.1,L=1.\)

Solution, \(c_{n}=\frac{24h}{\left ( \left ( 2n-1\right ) \pi \right ) ^{2}}\sin \left ( \frac{\left ( 2n-1\right ) }{6}\pi \right ) ,\lambda _{n}=\left ( \frac{\left ( 2n-1\right ) \pi }{2L}\right ) ^{2}\) with \(n=1,2,3,\cdots \)\[ u\left ( x,t\right ) =\sum _{n=1}^{\infty }C_{n}\cos \left ( \sqrt{\lambda _{n}}ct\right ) \sin \left ( \sqrt{\lambda _{n}}x\right ) \]

Source code is