Here's how I started: $$\int\frac{\sin{(2x)}}{1+\cos^2 x} dx = -2\int\frac{-\sin x\cos x}{1+\cos^2 x} dx = -2\int \frac{u}{1+u^2}du $$
I know the answer ends up being this from here:
$$ -\ln\left(1+\cos^2 x\right) $$
But I don't understand where this u in the numerator goes, it seems like the answer should look like this:
$$-2\cdot\frac{1}{2}\cdot u^2\cdot\ln\left(1+u^2\right) = -\cos^2 x \cdot \ln\left(1+\cos^2 x\right) $$
Thanks!