$$\int \frac{\sin{2x}}{\sin{x}+\cos^2{x}}dx=\int \frac{2\sin{x}\cos{x}}{\sin{x}+1-\sin^2{x}}dx=\left| \begin{array}{c} t=\sin x \\ dt=\cos x\,dx \end{array} \right|=\int \frac{2t}{-t^2+t+1}dt$$
Now I see that $2t$ in numerator and $-t^2$ in denominator, i want to do substitution, but $t$ is the way. I am stuck here.
Rewriting $$\frac{2t}{t^2-t-1}=\frac{2t-1}{t^2-t-1}+\frac{1}{t^2-t-1}$$
We see that the first summand equals the following logarithmic derivative $$(\log(t^2-t-1))'$$ Whereas the second term can be easily dealt with.
Remark: from your question, it seemed that the problem was dealing with the $t$ in the numerator, so I only did that.