Evaluate $$\int \frac{\arctan(\sin(2x))}{\cos^2x}dx,\ x \in (-\frac{\pi}{2},\frac{\pi}{2}) $$
Now, I have no idea how to start . I checked wolframalpha and it gives an interesting solution ( I am not sure how it arrived there ) . Any hints will be appreciated !
Let tanx=t
$I= \int tan^{-1}\frac{2t}{1+t^2}dt$
using by parts $I= t.tan^{-1}\frac{2t}{1+t^2}-\int\frac{2(1-t^2)}{(1+t^2)^2+4t^2}dt$
$I= t.tan^{-1}\frac{2t}{1+t^2}-\int\frac{2(\frac{1}{t^2}-1)}{(t+\frac{1}{t})^2+4}dt$
Now let $(t+\frac{1}{t})=z$