A question on differentiation : Let $$f(x)=\sin^{-1}(2x\sqrt{1-x^2})$$
I found out $f'(x)$ in three methods and got three different answers ! 
1) Putting $x=\cos\theta$, we get $f(x)=2\cos^{-1}x$, on differentiating this we get 
$$f'(x)=\frac{-2}{\sqrt{1-x^2}}$$
2) Putting $x=\sin\theta$, we get $f(x)=2\sin^{-1}x$, on differentiating we get 
$$f'(x)=\frac{2}{\sqrt{1-x^2}}$$
This is contradicting with the previous result that we arrived at by substituting $x=\cos\theta$. Can someone help me out with the correct solution for this problem!
 A: One should, before starting differentiating, check where the expression is defined. The function $f$ is defined where $-1\le 2x\sqrt{1-x^2}\le1$, that is,
$$
4x^2(1-x^2)\le 1
$$
which is satisfied for all $x$. Thus the function $f$ is defined in $[-1,1]$ because of the square root.
Apply the chain rule; the derivative of $t\mapsto\arcsin t$ is $1/\sqrt{1-t^2}$; the derivative of $2x\sqrt{1-x^2}$ is
$$
2\left(\sqrt{1-x^2}+x\cdot\frac{-x}{\sqrt{1-x^2}}\right)
=\frac{2(1-2x^2)}{\sqrt{1-x^2}}
$$
For $t=2x\sqrt{1-x^2}$ we have
$$
1-t^2=1-4x^2(1-x^2)=1-4x^2+4x^4=(1-2x^2)^2
$$
so
$$
\frac{1}{\sqrt{1-t^2}}=\frac{1}{|1-2x^2|}
$$
and doing the product gives
$$
f'(x)=\frac{1}{|1-2x^2|}\frac{2(1-2x^2)}{\sqrt{1-x^2}}
=\begin{cases}
\frac{2}{\sqrt{1-x^2}} &\text{if $1-2x^2>0$}\\[2ex]
-\frac{2}{\sqrt{1-x^2}} &\text{if $1-2x^2<0$}
\end{cases}
$$
Thus your seemingly contradictory results are “explained”. The function is not differentiable where $x^2=1/2$.

You can use the derivative for simplifying the expression of $f$. For instance, when $-\frac{1}{\sqrt{2}}<x<-\frac{1}{\sqrt{2}}$, you know that
$$
f(x)=C_1+2\arcsin x
$$
and you can determine that $C_1=0$ by computing $f(0)=0$ and $2\arcsin0=0$. For $-1<x<-\frac{1}{\sqrt{2}}$, you have
$$
f(x)=C_2-2\arcsin x
$$
and computing in $-1$ tells $f(-1)=0$, $-2\arcsin(-1)=\pi$, so $C_2=-\pi$. For $\frac{1}{\sqrt{2}}<x<1$, again
$$
f(x)=C_3-2\arcsin x
$$
and $f(1)=0$, $-2\arcsin1=-\pi$, so $C_3=\pi$. Hence
$$
f(x)=\begin{cases}
-\pi-2\arcsin x & \text{for }x\in[-1,-1/\sqrt{2})\\
2\arcsin x & \text{for }x\in[-1/\sqrt{2},1/\sqrt{2}]\\
\pi-2\arcsin x & \text{for }x\in(1/\sqrt{2},1]
\end{cases}
$$
You can check that 
$$
-\pi-2\arcsin\frac{-1}{\sqrt{2}}=-\pi+\frac{\pi}{2}
=-\frac{\pi}{2}=2\arcsin\frac{-1}{\sqrt{2}}
$$
and
$$
\pi-2\arcsin\frac{1}{\sqrt{2}}=\pi-\frac{\pi}{2}=\frac{\pi}{2}
=2\arcsin\frac{1}{\sqrt{2}}
$$
confirming that $f$ is everywhere continuous.
A: HINT:
As the principal value of  $\sin^{-1}x$ lies  $\in [-\frac\pi2, \frac\pi2]; \pi\le 2\sin^{-1}x\le \pi$
So, $$\sin^{-1}(2x\sqrt{1-x^2})=\begin{cases} 
2\sin^{-1}x &\mbox{if } -\frac\pi4\le \sin^{-1}x\le \frac\pi4  \\
-\pi-2\sin^{-1}x & \mbox{if }  -\frac\pi2\le \sin^{-1}x< -\frac\pi4 \\
\pi-2\sin^{-1}x & \mbox{if } \frac\pi4< \sin^{-1}x\le \frac\pi2 \end{cases}  $$
As the principal values of $\cos^{-1}x$ lies  $\in [0,\pi], 0\le 2\cos^{-1}x\le 2\pi,$
So, $$\sin^{-1}(2x\sqrt{1-x^2})=\begin{cases} 2\cos^{-1}x &\mbox{if } 0\le \cos^{-1}x< \frac\pi4 \iff  \frac\pi4< \sin^{-1}x\le \frac\pi2 \\
2\cos^{-1}x-2\pi & \mbox{if }  \frac\pi4\le \cos^{-1}x< \frac{3\pi}4\iff  -\frac\pi2\le \sin^{-1}x< -\frac\pi4\\
\pi-2\cos^{-1}x & \mbox{if } \frac{3\pi}4\le \cos^{-1}x\le \frac\pi2\iff -\frac\pi4\le \sin^{-1}x\le \frac\pi4 \end{cases}  $$
Now differentiate for each region
