Find integral
$$\int\dfrac{2-\sin{x}}{\sin^2{x}-\sin{x}+1}dx$$

As suggested ,we take the [Weierstrass Substitution](http://en.wikipedia.org/wiki/Weierstrass_substitution) is often useful in integrals such as the original.
$$
\begin{align}
\sin(x)&=\frac{2z}{1+z^2}\\
\cos(x)&=\frac{1-z^2}{1+z^2}\\
\mathrm{d}x&=\frac{2\,\mathrm{d}z}{1+z^2}
\end{align}
$$
I known is equal to
$$\int\dfrac{4(z^2-z+1)}{z^4-2z^3+6z^2-2z+1}dz$$
but I don't know how I should calculate the last integral.