Find the solution to the pde $$u_t-ku_{xx}+\sin(t)u=0$$ $$u(x,0)=\phi(x)$$ $$0 \le t\lt \infty$$ $$ -\infty \lt x \lt +\infty$$
So far I have found the solution to its ODE$$g'+\sin(t)g=0$$ by using the integrating factor method. So, $g(t)=ce^{\cos(t)}$. Now what do I do?
Multiply the equation by $e^{\cos(t)}$ and notice $$\frac{\partial}{\partial t}\left( e^{\cos(t)}u \right) - k \frac{\partial^2}{\partial x^2}\left( e^{\cos(t)}u \right) = 0. $$ Put $v(x,t) = e^{\cos(t)}u(x,t)$ so that $$v_t - k v_{xx} = 0$$ and $v(x,0) = e^{\cos(0)}u(x,0) = e \phi(x)$.
Now if you can solve the heat equation, you can solve the original equation.
We know that the heat equation above has solution $$v(x,t) = \frac{1}{\sqrt{4\pi k t}} \int_\mathbb R e^{(x-y)^2/4kt}[e\phi(y)] dy = \frac{e}{\sqrt{4\pi k t}} \int_\mathbb R e^{(x-y)^2/4kt}\phi(y) dy.$$ Thus $$u(x,t) = e^{-\cos(t)}v(x,t) = \frac{e^{1-\cos(t)}}{\sqrt{4\pi k t}} \int_\mathbb R e^{(x-y)^2/4kt}\phi(y) dy.$$