Solve $u_{tt}-u_{xx}=e^t\sin(5x), u(t,0)=u(t,\pi)=0, u(0,x)=0,u_t(0,x)=\sin(3x)$ 
Solve $u_{tt}-u_{xx}=e^t\sin(5x)$, $t>0, x\in (0,\pi)$


$u(t,0)=u(t,\pi)=0,$


$u(0,x)=0,u_t(0,x)=\sin(3x)$

I tried to solve using fourier sine series,
$u(t,x)=\sum_{n=1}^\infty u_n(t) \sin(nx)$
$u_{xx}=\sum_{n=1}^\infty w_n(t)\sin(nx)$
$w_n(t)=\frac{2}{\pi} \int_{0}^\pi u_{xx}\sin(nx)dx$
Which using integration by parts I solved as:
$w_n(t)=-n^2 u_n(t)$
then using $u_{xx}=u_{tt}-e^{t}\sin(5x)$
I get $-n^2 u_n(t)=w_n(t)=\frac{2}{\pi}\int_{0}^\pi\partial^{2}_t u\sin(nx)dx-\frac{2}{\pi}\int_{0}^\pi e^{t}\sin(5x)\sin(nx)dx$
Which I simplified to $u_{n}^{\prime\prime}(t)+n^2u_n(t)=\frac{2}{\pi}e^{t}\int_{0}^\pi \sin(5x)\sin(nx)$
I found that $\int_{0}^\pi \sin(5x)\sin(nx)=0$ when $n\neq 5$ and is $\pi/2$ when $n=5$.
I ended up with these ODE's:
$n\neq 5$, $u^{\prime\prime}_n(t)+n^2u_n(t)=0$
$n=5$, $u^{\prime\prime}_5(t)+25u_5(t)=e^t$
But couldn't solve these. I believe there is likely a mistake earlier on.
 A: Laplace transorm works wonderfully for this problem.
Let $F(s,x)=\mathcal{L}(u(t,x))=\int_0^{\infty}u(t,x)e^{-st}\mathrm{d}t$ i.e. $F(s,x)$ is the Laplace transform of $u(t,x)$. Then $$\begin{eqnarray*}\mathcal{L}\Big(u_{tt}(t,x)\Big)&=&s^2F(s,x)-su(0,x)-u_{t}(0,x) \\ &=&s^2 F(s,x)-(s+1)\sin(3x)\end{eqnarray*}$$ On the other hand, $$\mathcal{L}\Big(u_{xx}(t,x)\Big)=F_{xx}(s,x)$$ Your PDE becomes $$s^2F(s,x)-(s+1)\sin(3x)-F_{xx}(s,x)=\frac{\sin(5x)}{s-1}$$ Rearrange terms to see how $$F_{xx}(s,x)-s^2F(s,x)=\frac{\sin(5x)}{1-s}-(s+1)\sin(3x)$$ which is a second order linear non$-$homogeneous DE in the spatial variable $x$. Using the method of undetermined coefficients, the general solution to this DE becomes $$F(s,x)=C_1e^{sx}+C_2e^{-sx}+\frac{\sin(5x)}{(s-1)(s^2+25)}+ \frac{(s+1)\sin(3x)}{s^2+9}$$ Here, $C_1,C_2$ are functions of $s$. Enforcing $F(s,0)=F(s,\pi)=0$ gives $C_1=C_2=0$ and yields our particular solution. $$F(s,x)=\frac{\sin(5x)}{(s-1)(s^2+25)}+ \frac{(s+1)\sin(3x)}{s^2+9}$$ Apply $\mathcal{L}^{-1}$ to recover $u$... $$u(t,x)=\Bigg({e^t \over 26}-{\cos(5t) \over 26} - {\sin(5t) \over 130}\Bigg) \sin(5x)+\Bigg(\cos(3t)+{1 \over 3}\sin(3t)\Bigg)\sin(3x)$$
