# Solving a second order ODE via Laplace transform

Use Laplace transform to solve the following ODE

$$y''-2y'+2y=cos(t)$$ $$y(0)=1$$ $$y'(0)=0$$

What i tried

Converting the folllowing ODE to its Laplace form, i got

$$S^2Y(s)-Sy(0)-y'(0)-2SY(s)+2y(0)+2Y(s)=\frac{S}{S^2+1}$$

From here I expressed the eqn in terms of $$Y(s)=\frac{s-2+\frac{s}{s^2+1}}{s^2-2s+2}$$

and i have to change this expression into a partial fraction form before i can convert it back to the form in $y(t)$ which is the solutions. After simplification, i got the following form of $$Y(S)=\frac{s^3-2s^2+2s-2}{s^4-2s^3+3s^2-2s+2}$$

However i could not change this expression into a partial fraction form as i got a complex root instead. Could anyone explain where i went wrong. Thanks

Instead of joining everything together: $$\frac{s-2+\frac{s}{s^2+1}}{s^2-2s+2}=\frac{s-2}{s^2-2s+2}+\frac{s-2}{(s^2-2s+2)(s^2+1)}$$
$$\frac{s-2}{(s^2-2s+2)(s^2+1)}=\frac{-3 s-4}{5 (s^2+1)}+\frac{3 s-2}{5 (s^2-2 s+2)}$$