Find the solution $y''+9y=\cos t$ using Laplace transform Find the solution to $$y''+9y=\cos{t}$$
Solve with initial conditions $$y(0)=1,y(\pi/2)=-1$$
using Laplace transform.
I first took the Laplace transform of each part then getting $$s^2Y+y'(0)+9Y=s/s^2+1$$
but the problem is that I have two initial values and any is $y'(0)=?$.
 A: 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}$$
