I am trying to find the inverse Laplace transform of $$F(s)=-\frac{1}{s(s+1)}+\frac{(s+1)(s+2)}{s\left((s+1)^2+1\right)}.$$
I proceeded as follows:
\begin{align} F(s)&=-\frac{1}{s(s+1)}+\frac{(s+1)(s+2)}{s\left((s+1)^2+1\right)} \\ &=-\frac{1}{s}+\frac{1}{s+1}+\frac{s+1}{(s+1)^2+1}+\frac{4}{s\left((s+1)^2+1\right)} \\ f(t)&=-1+e^{-t}+e^{-t}\cos(t)+\mathcal{L}^{-1}\left(\frac{4}{s}\times\frac{1}{(s+1)^2+1}\right) \\ &=-1+e^{-t}+e^{-t}\cos(t)+4\int_0^{\infty}e^{-u}\sin(u) \ du \ \ \ \ \ \text{(convolution theorem)} \\ &=1+e^{-t}(1+\cos(t)) \end{align} But the answer is apparently $f(t)=e^{-t}(1+\sin(t)).$ I have looked over my worked and agree with my solution.
edit:
\begin{align} \frac{(s+1)(s+2)}{s\left((s+1)^2+1\right)}&=\frac{s^2+3s+2}{s\left((s+1)^2+1\right)} \\ &=\frac{s^2+3s}{s\left((s+1)^2+1\right)}+\frac{2}{s\left((s+1)^2+1\right)} \\ &=\frac{s(s+3)}{s\left((s+1)^2+1\right)}+\frac{2}{s\left((s+1)^2+1\right)} \\ &=\frac{s+3}{(s+1)^2+1}+\frac{2}{s\left((s+1)^2+1\right)} \\ &=\frac{s+1}{(s+1)^2+1}+\frac{4}{s\left((s+1)^2+1\right)} \end{align}
Your partial fractions are not correct for the second term: \begin{equation} \frac{(s+1)(s+2)}{s((s+1)^2+1)}=\frac{1}{(s+1)^2+1}+\frac{1}{s}. \end{equation} Then, \begin{equation} F(s) = \frac{1}{(s+1)}+\frac{1}{(s+1)^2+1}. \end{equation} Thus, you get the desired result!