Integrate $\int \frac{\sin{2x}}{\sin{x}+\cos^2{x}}dx$ $$\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.
 A: 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.
A: $$\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| t=\sin x,\quad  dt=\cos x\,dx \right|$$ $$=\int \frac{2t}{-t^2+t+1}dt$$
$$=\int\frac{-2t}{t^2 - t -1}dt$$ $$ =-\left(\int \frac{2t - 1}{t^2 - t-1}\,dt + \int \frac {1}{t^2 -t - 1}\,dt\right)\tag{1}$$
For the first integral, put $$u = t^2 - t -1\implies du = 2t - 1$$...and proceed from there. 
For the second integral $${t^2 -t-1} = \frac{-1}{4}\left(-2t + \sqrt 5+1  \right)\left(2t + \sqrt 5-1\right) $$
so you can compute the second integral via partial fractions.
A: After the substitution your integral is
$$
\int\frac{-2t}{(t-\varphi)(t-\hat\varphi)}\,dt
$$
where
$$
\varphi=\frac{1+\sqrt{5}}{2},
\qquad
\hat\varphi=\frac{1-\sqrt{5}}{2}=1-\varphi
$$
so the decomposition into partial factors is
$$
\frac{-2t}{(t-\varphi)(t-\hat\varphi)}=
\frac{A}{t-\varphi}+\frac{B}{t-\hat\varphi}
$$
which results in
$$
(A+B)t-(A\hat\varphi+B\varphi)=-2t
$$
so $A+B=-2$ and $B=-2-A$. From the constant term we get
$$
A\hat\varphi-A\varphi-2\varphi=0
$$
which gives
$$
A=\frac{2\varphi}{\hat\varphi-\varphi}=-\frac{2\varphi}{\sqrt{5}}
$$
and
$$
B=-2-A=\frac{2\hat\varphi}{\sqrt{5}}
$$
Thus the integral is
$$
\frac{2\hat\varphi}{\sqrt{5}}\log|t-\hat\varphi|-
\frac{2\varphi}{\sqrt{5}}\log|t-\varphi|+C
$$
Substitute back $t=\sin x$ and you're done.
