Use Green's Functions to solve $$u_{tt}-u_{xx}=g(t)\sin(x)$$ for $$0<x<\pi,t>0$$ with initial conditions $$u(x,0)=u_t(x,0)=0$$ for $$0\leq x \leq \pi$$ and boundary conditions $$u(0,t)=u(\pi,t)=0, t \geq 0$$
I know that the answer is $$u(x,t)=\sin(x) \int_0^t g(t-\tau)\sin(\tau)d\tau$$ but I have no idea where to start. :(
If anyone could offer intuition and steps I could follow for these types of problems I would really appreciate the help. Is there a standard algorithm of sorts used for Green's functions solutions? They are really confusing to me
$\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,} \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack} \newcommand{\dd}{\mathrm{d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,} \newcommand{\ic}{\mathrm{i}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\mrm}[1]{\mathrm{#1}} \newcommand{\pars}[1]{\left(\,{#1}\,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,} \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}} \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
Then, \begin{align} \mrm{U}\pars{t} & = \int_{0}^{\infty}\mrm{G}\pars{t,t'}\mrm{g}\pars{t'}\,\dd t' \quad\mbox{where}\quad \left\{\begin{array}{rcl} \ds{\pars{\partiald[2]{}{t} + 1}\mrm{G}\pars{t,t'}} & \ds{=} & \ds{\delta\pars{t - t'}} \\[2mm] \ds{\mrm{G}\pars{0,t'} = \mrm{G}_{t}\!\pars{0,t'}} & \ds{=} & \ds{0} \end{array}\right. \end{align}
Then, \begin{align} &\mrm{G}\pars{t,t'} = \left\{\begin{array}{lcl} \ds{A\sin\pars{t} + B\cos\pars{t}} & \ds{t < t'} \\[2mm] \ds{C\sin\pars{t - t'}} & \ds{t > t'} \end{array}\right. \\[5mm] & \mrm{U}\pars{0} = \mrm{U}_{t}\pars{0} = 0 \implies A = B = 0. \end{align}
Then, $$ \mrm{U}\pars{t} = \int_{0}^{t}\sin\pars{t - t'}\mrm{g}\pars{t'}\,\dd t' = \int_{0}^{t}\sin\pars{t'}\mrm{g}\pars{t - t'}\,\dd t' $$ $$ \bbx{\mrm{u}\pars{x,t} = \sin\pars{x}\int_{0}^{t}\mrm{g}\pars{t - t'}\sin\pars{t'}\,\dd t'} $$