Fourier Method for 1D Wave equation-Visualization

$\renewcommand{\Re}{\operatorname{Re}}$ $\renewcommand{\Im}{\operatorname{Im}}$ $\newcommand{\erf}{\operatorname{erf}}$ $\newcommand{\dag}{\dagger}$ $\newcommand{\const}{\mathrm{const}}$ $\newcommand{\arcsinh}{\operatorname{arcsinh}}$

Fourier Method for $1$D Wave equation-Visualization

Dirichlet-Neumann

For boundary value problem $$\begin{aligned} &u_{tt}-c^2u_{xx}=0,\\ &u|_{x=0}=u_x|_{x=l}=0 \end{aligned}$$ there are simple solutions in the form $$u(x,t)= \cos(\frac{(n-\frac{1}{2})\pi ct}{l})\cos(\frac{(n-\frac{1}{2})\pi x}{l})$$

and general solutions of in the form $$u(x,t)= \sum_{n=1}^{\infty}\bigl[A_n\cos(\frac{(n-\frac{1}{2})\pi ct}{l})+B_n\sin (\frac{(n-\frac{1}{2})\pi ct}{l})\bigr]\sin(\frac{(n-\frac{1}{2})\pi x}{l})$$