We have:
$$\mathcal{L}(\cos(t)) = \dfrac{s}{s^2+1}$$
$$\mathcal{L}(t \cos(t)) = -\dfrac{d}{ds} \left(\dfrac{s}{s^2+1}\right) = \dfrac{s^2-1}{(s^2+1)^2}$$
Are you familiar with the rule I am using?
If
$$\mathcal{L}(f(t)) = F(s)$$
Then
$$\mathcal{L}(t^nf(t)) = (-1)^n\dfrac{d^n}{ds^n}F(s)$$
Well, we have that:
$$\text{y}''\left(t\right)+9\cdot\text{y}\left(t\right)=\cos\left(t\right)\tag1$$
Now, when we take the Laplace transform of both sides we get:
$$\mathscr{L}_t\left[\text{y}''\left(t\right)+9\cdot\text{y}\left(t\right)\right]_{\left(\text{s}\right)}=\mathscr{L}_t\left[\text{y}''\left(t\right)\right]_{\left(\text{s}\right)}+9\cdot\mathscr{L}_t\left[\text{y}\left(t\right)\right]_{\left(\text{s}\right)}=\mathscr{L}_t\left[\cos\left(t\right)\right]_{\left(\text{s}\right)}\tag2$$
Use that:
- $$\mathscr{L}_t\left[\text{y}''\left(t\right)\right]_{\left(\text{s}\right)}=\text{s}^2\cdot\text{Y}\left(\text{s}\right)-\text{s}\cdot\text{y}\left(0\right)-\text{y}'\left(0\right)\tag3$$
- $$\mathscr{L}_t\left[\text{y}\left(t\right)\right]_{\left(\text{s}\right)}=\text{Y}\left(\text{s}\right)\tag4$$
- $$\mathscr{L}_t\left[\cos\left(t\right)\right]_{\left(\text{s}\right)}=\frac{\text{s}}{1+\text{s}^2}\tag5$$
So, we get:
$$\text{s}^2\cdot\text{Y}\left(\text{s}\right)-\text{s}\cdot\text{y}\left(0\right)-\text{y}'\left(0\right)+9\cdot\text{Y}\left(\text{s}\right)=\frac{\text{s}}{1+\text{s}^2}\tag6$$
Now, using the initial condition $\text{y}\left(0\right)=1$:
$$\text{s}^2\cdot\text{Y}\left(\text{s}\right)-\text{s}\cdot1-\text{y}'\left(0\right)+9\cdot\text{Y}\left(\text{s}\right)=\text{s}^2\cdot\text{Y}\left(\text{s}\right)-\text{s}-\text{y}'\left(0\right)+9\cdot\text{Y}\left(\text{s}\right)=\frac{\text{s}}{1+\text{s}^2}\tag7$$
Now, solving $\text{Y}\left(\text{s}\right)$:
$$\text{Y}\left(\text{s}\right)=\frac{\text{y}'\left(0\right)+\text{s}^2\cdot\text{y}'\left(0\right)+\text{s}^3+2\cdot\text{s}}{\text{s}^4+10\cdot\text{s}^2+9}\tag8$$
Now, using inverse Laplace transform:
$$\text{y}\left(t\right)=\frac{\cos\left(t\right)+7\cos\left(3t\right)}{8}+\frac{\text{y}'\left(0\right)\cdot\sin\left(3t\right)}{3}\tag9$$
So, in order to solve $\text{y}'\left(0\right)$, use the second initial condition $\text{y}\left(\frac{\pi}{2}\right)=-1$:
$$-1=\frac{\cos\left(\frac{\pi}{2}\right)+7\cos\left(3\cdot\frac{\pi}{2}\right)}{8}+\frac{\text{y}'\left(0\right)\cdot\sin\left(3\cdot\frac{\pi}{2}\right)}{3}=-\frac{\text{y}'\left(0\right)}{3}\space\Longleftrightarrow\space\color{red}{\text{y}'\left(0\right)=3}\tag{10}$$
So, the complete solution is given by:
$$\text{y}\left(t\right)=\frac{\cos\left(t\right)+7\cos\left(3t\right)}{8}+\sin\left(3t\right)\tag{11}$$
Best Answer
Hint: $\frac{s}{(s^2+9)^2} = \frac{d}{ds}\frac{-1}{2(s^2+9)}$