<s>[INST] 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.  
 [/INST] 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} $$
</s>