Applying the Laplace transform and its linearity on the given equation we get
\(\begin{array}{c}\mathcal{L}\left\{ {y'' + 9y} \right\}(s) = \mathcal{L}\{ g(t)\} (s)\\\mathcal{L}\{ y\} (s) + 9\mathcal{L}\{ y\} (s) = G(s)\end{array}\)
\(\begin{array}{c}\left[ {{s^2}Y(s) - sy(0) - y'(0)} \right] + 9Y(s) = G(s)\\{s^2}Y(s) - s + 9Y(s) = G(s)\\\left( {{s^2} + 9} \right)Y(s) = G(s) + s\\Y(s) = \frac{{G(s)}}{{{s^2} + 9}} + \frac{s}{{{s^2} + 9}}\end{array}\)
Now applying the inverse Laplace gives:
\(\begin{array}{c}y(t) = {\mathcal{L}^{ - 1}}\left\{ {\frac{{G(s)}}{{{s^2} + 9}} + \frac{s}{{{s^2} + 9}}} \right\}\\ = {\mathcal{L}^{ - 1}}\left\{ {\frac{{G(s)}}{{{s^2} + 9}}} \right\} + {\mathcal{L}^{ - 1}}\left\{ {\frac{s}{{{s^2} + 9}}} \right\}\\ = {\mathcal{L}^{ - 1}}\left\{ {\frac{{G(s)}}{{{s^2} + 9}}} \right\} + \cos 3t\end{array}\)
Since
\({\mathcal{L}^{ - 1}}\left\{ {\frac{3}{{{s^2} + 9}}} \right\} = \sin 3t\)
We have that
Using this we get
Therefore