So I have $y' + 2y = \sin(\omega t)$.
Since $\sin(\omega t) = \operatorname{Im}(e^{i\omega t})$ I can solve the equation as far as to $$ y = \operatorname{Im}(\frac1{i\omega + 2}e^{i\omega t}) = \operatorname{Im}\left(\frac{2-i\omega}{\omega^2 + 2}\cdot(\cos(\omega t) + i\cdot \sin(\omega t))\right). $$
Now in my book they take it one step further, like this: $y = \frac 1{\omega^2 + 2}(2\sin(\omega t) - \omega \cos(\omega t))$.
That last step then becomes the final answer to the question, but I honestly cannot understand how they do that last jump. How do they remove the $\operatorname{Im}()$ thing and how does it affect the equation?