Evaluate $\int \sin^{-1}\frac{2x}{1+x^2}dx$ $\int \sin^{-1}\dfrac{2x}{1+x^2}dx$
My attempt is as follows:-
$$x=\tan\theta$$
$$dx=\sec^2\theta d\theta$$
$$\int \sin^{-1}(\sin2\theta) \cdot\sec^2\theta d\theta$$
So here should we make cases on the basis of values of $\theta$ or can we write $\sin^{-1}(\sin2\theta)$ as $2\theta$?

The function to find an antiderivative of can be rewritten as
$$
f(x)=\begin{cases}
-\pi-2\arctan x & x<-1 \\[6px]
2\arctan x & -1\le x\le 1 \\[6px]
\pi-2\arctan x & x>1
\end{cases}
$$
It's sufficient to see that the derivative is
$$
f'(x)=\dfrac{1-x^2}{|1-x^2|}\dfrac{2}{1+x^2}
$$
Thus an antiderivative is
$$
F(x)=\int_0^x f(t)\,dt
$$
Since the function $f$ is odd, we can state that $F$ is even, so we can assume $x>0$.
Recalling that, with integration by parts,
$$
\int 2\arctan x\,dx=2x\arctan x-\log(1+x^2)
$$
we have, for $0\le x\le 1$,
$$
F(x)=\Bigl[2t\arctan t-\log(1+t^2)\Bigr]_0^x=2x\arctan x-\log(1+x^2)
$$
and $F(1)=\pi/2-\log2$. For $x>1$, we have
\begin{align}
F(x)
&=F(1)+\int_1^x (\pi-2\arctan t)\,dt \\[6px]
&=F(1)+\Bigl[\pi t-2t\arctan t+\log(1+t^2)\Bigr]_1^x \\[6px]
&=\frac{\pi}{2}-\log2+\pi x-2x\arctan x+\log(1+x^2)-\pi+\frac{\pi}{2}-\log2 \\[6px]
&=-2\log2+\pi x-2x\arctan x+\log(1+x^2)
\end{align}
Thus the most general antiderivative is $F(x)+c$, where
$$
F(x)=\begin{cases}
2x\arctan x-\log(1+x^2) & |x|\le 1 \\[6px]
-2\log2+\pi|x|-2x\arctan x+\log(1+x^2) & |x|>1
\end{cases}
$$
