Solve the wave equation with Neumann boundary conditions: $$\begin{cases} v_{tt} = c^2 v_{xx} \ \ \text{for} \ \ 0 < x < l\\ v_x(0,t) = v_x(l,t) = 0\\ v(x,0) = x(l - x)\\ v_t(x,0) = x\\ \end{cases}$$ Your final answer should remain in series form. You can use, without proof, that, for $0 < x < l$, $$ x(l - x) = \frac{l^2}{6} + \sum_{n=1}^{\infty}\frac{2 l ^2}{n^2 \pi ^2}((-1)^{n+1} - 1)\cos\left(\frac{n\pi x}{l}\right); \ \ \ x = \frac{l}{2} + \sum_{n=1}^{\infty}\frac{2l}{n^2 \pi^2}((-1)^{n+1} - 1)\cos\left(\frac{n\pi x}{l}\right)$$
Attempted solution - Using separation of variables we have $$v(x,t) = X(x)T(t)$$ This PDE yields $$X(x)T^{\prime \prime} = c^2 X^{\prime\prime}T(t)$$ Rearranging we have $$\frac{1}{c^2}\frac{T^{\prime\prime}}{T(t)} = \frac{X^{\prime\prime}}{X(x)} = -\lambda$$ Rearranging we get \begin{equation} X^{\prime\prime}(x) + \lambda X(x) = 0 \end{equation} and \begin{equation} T^{\prime\prime}(t) + \lambda c^2 T(t) = 0 \end{equation} ODE $(1)$ is a Strum-Lioville problem when coupled with boundary conditions $$v_x(0,t) = X'(0)T(t) = 0 \Rightarrow X'(0) = 0$$ and $$v_x(l,t) = X'(l)T(t) = 0 \Rightarrow X'(l) = 0$$ For $\lambda = 0$ we get $X^{\prime\prime}(x) = 0$. The solution is $X(x) = c_1 + c_2 x$. Applying boundary conditions \begin{align*} X'(0) &= c_2 = 0\\ X'(l) &= c_2 = 0\\ \end{align*} So we have $\lambda_0 = 0$ and $X_0(x) = 1$ as the first eigenvalue and eigenfunction of the system.\ For $\lambda < 0$, say $\lambda = -\mu^2$, $(1)$ becomes $$X^{\prime\prime}(x) - \mu^2 X(x) = 0$$ $$X'(0) = 0, \ \ X'(l) = 0$$ The characteristic equaiton is $$m^2 - \mu^2 = 0\Rightarrow m = \pm \mu$$ So $X(x) = c_1 e^{-\mu x} + c_2 e^{\mu x}$. Applying boundary conditions. $$X'(0) = -c_1 + c_2 = 0$$ $$X^{\prime}(l) = -c_1 e^{-\mu l} + c_2 e^{\mu l} = 0$$ Solving for $c_1,c_2$, we get $c_1 = c_2 = 0$. Thus $X(x) = 0$.\ Now for $\lambda > 0$, say $\lambda = \mu^2$ $(1)$ becomes $$X^{\prime\prime}(x) + \mu^2 X(x) = 0$$ $$X'(0) = 0, \ \ X'(l) = 0$$ The characteristic equation is $$m^2 + \mu^2 = 0 \Rightarrow m = \pm \mu i$$ So $X(x) = c_1 \cos(\mu x) + c_2 \sin(\mu x)$. Applying boundary conditions, \begin{align*} X'(0) &= c_2 = 0\\ X'(l) &= -\mu c_1 \sin(\mu l) = 0 \end{align*} For $c_1 \neq 0$, \begin{align*} \sin(\mu l) &= 0\\ \sin(\mu l) &= \sin(n\pi) \ \ n = 1,2,\ldots\\ \Rightarrow \mu l &= n \pi\\ \mu &= \frac{n\pi}{l} \end{align*} Thus we have eigenvalues $\lambda_n = \frac{n^2 \pi^2}{l^2}$, and corresponding eigenfunction $X_n(x) = \cos\left(\frac{n\pi x}{l} \right) n = 1,2,\ldots$. Noew we can solve $(2)$ for $T(t)$ using $\lambda_n = \frac{n^2 \pi^2}{l^2}$ $$T^{\prime\prime}(t) + \frac{n^2 \pi^2}{l^2}c^2 T(t) = 0$$ The characteristic equation being $$m^2 + \frac{n^2\pi^2 c^2}{l^2} = 0 \Rightarrow m = \pm \frac{n\pi c}{l}i$$ So $$T_n(t) = a_n\cos\left( \frac{n\pi c}{l} t\right) + b_n \sin\left( \frac{n\pi c}{l}t \right) \ \ n = 1,2,\ldots$$ For $n = 0$, we get $T^{\prime\prime}(t) = 0$ $$T_0(t) = a_0 + b_0 t$$ The solution is now ready to be expressed in series form $$u(x,t) = (a_0 + b_0 t) + \sum_{n=1}^{\infty}\left[a_n \cos\left(\frac{n\pi c}{l}t \right) + b_n \sin\left(\frac{n\pi c}{l}t \right) \right]\cos\left(\frac{n\pi x}{l} \right)$$ All is left is to determine the coefficients $a_n$,$b_n$. This can be done by the initial conditions $$v(x,0) = a_0 + \sum_{n=1}^{\infty}a_n\cos\left(\frac{n\pi x}{l} \right) = x(l-x)$$ In other words, the Fourier cosine series of $x(l-x)$ which is given by $$x(l-x) = \frac{l^2}{6} + \sum_{n=1}^{\infty}\frac{2 l^2}{n^2 \pi^2}((-1)^{n+1} - 1)\cos\left(\frac{n\pi x}{l} \right)$$ Equating coefficients, we get $$a_0 = \frac{l^2}{6}, \ \ a_n = \frac{2 l^2}{n^2 \pi^2}((-1)^{n+} - 1)$$ Next, $$v_t(x,0) = b_0 + \sum_{n=1}^{\infty}\frac{n \pi c}{l} b_n \cos\left(\frac{n\pi x}{l} \right) = x$$ Again a Fourier cosine series, which is given by $$x = \frac{l}{2} + \sum_{n=1}^{\infty}\frac{2 l}{n^2 \pi^2}((-1)^n - 1)\cos\left(\frac{n\pi x}{l} \right)$$ Equating coefficients we get $$b_0 = \frac{l}{2}, b_n = \frac{2l}{n^2 \pi^2}((-1)^n - 1)$$ Thus finally, $$v(x,t) = \frac{l^2}{6} + \frac{l}{2}t + \sum_{n=1}^{\infty}\left[\frac{2 l^2}{n^2 \pi^2}((-1)^{n+1} - 1)\cos\left(\frac{n\pi c}{l}t \right) + \frac{2l}{n^2 \pi^2}((-1)^{n} - 1)\sin\left(\frac{n\pi c}{l}t \right) \right]\cos\left(\frac{n \pi x}{l} \right)$$
I know this is long, but I just wanted to check if this is correct. Any suggestions are greatly appreciated.