Integrate $\sin^{-1}\frac{2x}{1+x^2}$ 
Integrate $\sin^{-1}\frac{2x}{1+x^2}$

The solution is given in my reference as: $2x\tan^{-1}x-\log(1+x^2)+C$.
But, is it a complete solution ?
My Attempt
$$
\int 2\tan^{-1}x \, dx=\int \tan^{-1}x \cdot 2\,dx=\tan^{-1}x\int2\,dx-\int\frac{1}{1+x^2}\int2\,dx\cdot dx\\
=\tan^{-1}x \cdot2x-\int\frac{2x}{1+x^2}\,dx=2x\tan^{-1}x-\log(1+x^2)+C
$$
$$
2\tan^{-1}x=\begin{cases}\sin^{-1}\frac{2x}{1+x^2}\text{ if }|x|\leq{1}\\
\pi-\sin^{-1}\frac{2x}{1+x^2}\text{ if }|x|>{1}\text{ and }x>0\\
-\pi-\sin^{-1}\frac{2x}{1+x^2}\text{ if }|x|>{1}\text{ and }x<0
\end{cases}\\
\sin^{-1}\frac{2x}{1+x^2}=\begin{cases}2\tan^{-1}x\text{ if }|x|\leq{1}\\
\pi-2\tan^{-1}x\text{ if }|x|>{1}\text{ and }x>0\\
-\pi-2\tan^{-1}x\text{ if }|x|>{1}\text{ and }x<0
\end{cases}
$$
$$
\int\sin^{-1}\frac{2x}{1+x^2}\,dx=\begin{cases}\int2\tan^{-1}x\,dx&\text{ if } |x|\leq{1}\\\int\pi\, dx-\int2\tan^{-1}x\,dx&\text{ if }|x|>{1}&\text{ and } x>0\\-\int\pi \,dx-\int2\tan^{-1}x\,dx&\text{ if }|x|>{1}&\text{ and } x<0\end{cases}=\begin{cases}\color{red}{2x\tan^{-1}x-\log(1+x^2)+C\text{ if } |x|\leq{1}}\\\pi x-2x\tan^{-1}x+\log(1+x^2)+C&\text{ if }|x|>{1}&\text{ and } x>0\\-\pi x-2x\tan^{-1}x+\log(1+x^2)+C&\text{ if }|x|>{1}&\text{ and } x<0\end{cases}$$
So don't we have two more cases for our solution rather than that is given in my reference, right ?

The "identity"
$$\arcsin\left(2x\over1+x^2\right)=2\arctan x$$
does not hold for all $x$.  You can see this by comparing the ranges of the two sides.  The arcsine function has $[-\pi/2,\pi/2]$ as its range, but twice the arctangent function has $(-\pi,\pi)$ as its range. In particular, if $x\gt1$, then $2\arctan x\gt\pi/2$, and likewise if $x\lt-1$ then $2\arctan x\lt-\pi/2$ (since $\arctan1=\pi/4$).
The correct identity is
$$\arcsin\left(2x\over1+x^2\right)=
\begin{cases}
\pi-2\arctan x\qquad\text{if }x\ge1\\
2\arctan x\qquad\quad\text{ }\text{ if }-1\le x\le1\\
-\pi-2\arctan x\quad\text{ if }x\le-1
\end{cases}$$
(Note, I've intentionally overlapped the intervals at $x=\pm1$ to stress the agreement of $\pi-2\arctan1=2\arctan1$ and $2\arctan(-1)=-\pi-2\arctan(-1)$.) The OP's observations regarding the integral follow.
