Solution verification for $y'$ when $y=\sin^{-1}(\frac{2x}{1+x^2})$ I was required to find $y'$ when $y=\sin^{-1}(\frac{2x}{1+x^2})$
This is my solution.

Above when I put $\sqrt{x^4-2x+1}=\sqrt{(1-x^2)^2}$ then I get the correct answer but when I put $\sqrt{x^4-2x+1}=\sqrt{(x^2-1)^2}$ then I get something else.
Now my question is that which one is correct and why? How you will come to know that we should put $\sqrt{x^4-2x+1}=\sqrt{(1-x^2)^2}$ and not $\sqrt{x^4-2x+1}=\sqrt{(x^2-1)^2}$
Kindly help me.  
 A: HINT:
For real $a,$ $$\sqrt{a^2}=|a|$$  
$=+a$ if $a\ge0$ and $=-a$ if $a<0$
Things will be clearer with the following : 
Using my answer here: showing $\arctan(\frac{2}{3}) = \frac{1}{2} \arctan(\frac{12}{5})$ and $\arctan y=\arcsin\dfrac y{\sqrt{y^2+1}}$
$$2\arctan x=\begin{cases} \arcsin\frac{2x}{1+x^2} &\mbox{if } x^2<1\\ \pi+\arcsin\frac{2x}{1+x^2} & \mbox{if } x^2>1\end{cases} $$
A: Hint:
Given
$$
y = \sin^{-1}\left( \frac{2x}{1+x^2}\right),
$$
then
$$
\sin(y) = \frac{2x}{1+x^2},
$$
so
$$
\cos(y) y' = \left( \frac{2x}{1+x^2} \right)'.
$$
Now
$$
\cos(y) = \sqrt{ 1 - \sin^2(y) } =
\sqrt{ 1 - \left( \frac{2x}{1+x^2} \right)^2 },
$$
so you get
$$
y' = \frac{ \displaystyle \left( \frac{2x}{1+x^2} \right)' }
{ \displaystyle \sqrt{ 1 - \left( \frac{2x}{1+x^2} \right)^2 }}.
$$
And
$$
\left( \frac{2x}{1+x^2} \right)' = 2 \frac{1 - x^2}{(1+x^2)^2}.
$$
So final is
$$
y' = 2 \frac{ 1 - x^2 }{ \displaystyle (1+x^2) \sqrt{ (1+x^2)^2 - 4x^2 }}
= 2 \frac{ 1 - x^2 }{ \displaystyle (1+x^2) \sqrt{ (1-x^2)^2 }}.
$$
Thus
$$
y' =
\left\{
\begin{array}{rcl}
|x| < 1 : \displaystyle \frac{2}{1+x^2}\\\\
|x| > 1 : \displaystyle \frac{-2}{1+x^2}
\end{array}
\right.
$$
