Find the function $u(x,t)$ that satisfies the following initial and boundary value problem.
$u_{tt} = u_{xx} + h(x)e^{-t}$, $x \in (0, \pi)$, $t>0$.
$u(x,0)=u_{t}(x,0)=0$, $x \in (0, \pi)$
$u(0,t)=u_{x}(0,t)=\cos(t)$, $t>0$
Professor said you are to find the function $h(x)$ as well.
I expanded the RHS as a Fourier series.
$h(x)e^{-t} = \frac{C_0e^{-t}}{2}+\sum_{n=1}^{\infty}[C_{n}\cos(nx)+D_{n}\sin(nx)]e^{-t}$
I then assume $u(x,t)$ is of the form
$u(x,t) = \frac{A_0(t)}{2}+\sum_{n=1}^{\infty}[A_{n}(t)\cos(nx)+B_{n}(t)\sin(nx)]$
From the initial conditions you find that
$A_{n}(0)=B_{n}(0)=A'_{n}(0)=B'_{n}(0)=0$
Substituting the assumed form of $u(x,t)$ back into the PDE grants
$A_0(t)=C_0(e^{-t}+t-1)$ and $B_0(t)=D_0(e^{-t}+t-1)$
$A_n''(t)+n^2A_n(t)=C_ne^{-t}$
$B_n''(t)+n^2B_n(t)=D_ne^{-t}$
Solving the ODEs using the initial conditions for $A_n(t)$ and $B_n(t)$ that were calculated earlier gives
$A_n(t)=\frac{C_n}{n^2+1}(e^{-t}+\frac{\sin(nt)}{n}-\cos(nt))$
$B_n(t)=\frac{D_n}{n^2+1}(e^{-t}+\frac{\sin(nt)}{n}-\cos(nt))$
That's all the work I've managed to do. Now I'm hopelessly stuck. I haven't used the boundary conditions yet, so that's maybe a starting point?