Solve the wave equation $u_{tt}=c^2u_{xx}$ with the boundary conditions $u(0,t)=0 $ and $u_x(l,t)=0$ as well the the initial data $u(x,0)=x$ and $u_t(x,0)=0$.
I have solved this question and would like to have my answer checked here to see if it is correct (or if there's any easier method to do this question.)
To start off, we assume the form $u(x,t)=X(x)T(t)$. Then by separation of variables we obtain $X''(x)+{\lambda}X(x)=0{\Rightarrow}X(x)=A\cos{\beta}x+B\sin{\beta}x$ where ${\lambda=\beta^2}$.
Now $X(0)=0{\Rightarrow}A=0$ and so $X(x)=B\sin{\beta}x$
Then $X'(l)=0{\Rightarrow}B{\beta}\cos{\beta}x=0$ and from here we gather that ${\beta_n=\frac{(n+\frac{1}{2}){\pi}}{l}}$ where $n=0,1,2, ...$
Now for ${T''(t)+ \lambda c^2T(t)=0 \Rightarrow T(t)=C\cos\beta ct + D \sin \beta ct}$.
Putting our results together we get:
$u(x,t)=\sum_{n=0}^\infty (P_n\cos \frac{(n+ \frac{1}{2})\pi ct}{l} + Q_n\sin \frac{(n+ \frac{1}{2})\pi ct}{l})\sin \frac{(n+\frac{1}{2})\pi x}{l}$
Using $u(x,0)=x$ we get $\sum_{n=0}^\infty P_n\sin \frac{(n+\frac{1}{2})\pi x}{l}=0$ and using the orthogonality relations we get $P_n= \frac{l^2}{(n+ \frac{1}{2})^2 \pi^2}(-1)^n$
Using $u_t(x,0)=0$ we have $Q_n=0$ for all $n$ and so we have:
$u(x,t)=\sum_{n=0}^\infty \frac{l^2}{(n+ \frac{1}{2})^2 \pi^2}(-1)^n\cos \frac{(n+ \frac{1}{2})\pi ct}{l} \sin \frac{(n+\frac{1}{2})\pi x}{l}$ as the final answer.
Do kindly advice if I've made any conceptual errors in the working. Thank you very much.