I'm currently working on an exercise about an inhomogeneous wave equation (PDE) and I can't seem to figure it out completely.
The equation is: $u_{tt}-u_{xx}=\cos{2t} $
With the boundary/initial conditions:
$u(0,t)=u(1,t)=0 $
$u(x,0)=0 $
$u_t (x,0)=\sum_{n=1}^{\infty} \sin{2 \pi n x} $
Solving the homogeneous problem is fairly straight-forward, I came to a solution of the kind
$ u(x,t)=\sum_{n=1}^{\infty} a_n \sin{n \pi x} \sin{n \pi t} $
How can I include the inhomogeneous $\cos(2t)$ now? I have been thinking about this a bit and I think I am basically looking for a special solution $v(x,t)$ that solves the wave equation and also
$ v(0,t)=v(1,t)=0,~v(x,0)=0,~v_t (x,0)=0 $,
i.e. does not change the boundary conditions. Is this the right way to tackle this problem, and if so, how do I proceed?
Thanks in advance!