Why does simplifying $\arcsin(2x\sqrt{1-x^2})$ two ways give different results? 
Find derivative of
  $y=\arcsin(2x \sqrt{1-x^2}) $ in domain $\frac{-1}{\sqrt{2}} < x < \frac{1}{\sqrt{2}}$

If you put $x=\sin\theta$ then
$$ y= \arcsin(2sin(\theta) \sqrt{1- sin^2 ( \theta)})$$
$$y= \arcsin( sin2\theta)$$
$$y= 2\theta$$
$$y = 2 \arcsin(x)$$
But, if you put $x=\cos\theta$ then , again,
$$y=2\theta$$
But,  resubstituting
$$ y= 2 \arccos(x)$$
But derivatives of both are different.

Now where's the mistake? Is it something related to the original domain I took?

 A: Notice, your first substitution is correct. When you substitute $x=\cos\theta$
$$\sin^{-1}(2\cos\theta\sqrt{1-\cos^2\theta})$$
$$=\sin^{-1}(2\cos\theta\sqrt{\sin^2\theta})$$
$$=\sin^{-1}(2\cos\theta|\sin\theta|)$$
$$|\sin\theta|=\begin{cases}-\sin\theta\ \  \forall \ \ \ -\frac{\pi}{4}<\theta<0\\ \sin\theta\ \ \ \forall \ \ \ 0\le \theta<\frac{\pi}{4}\end{cases}$$
A: It is a good habit of writing the interval for the parameter when you make trigonometric substitutions. In the first case,
$$x=\sin\theta, \qquad\theta\in\left[-\dfrac\pi2,\dfrac\pi2\right]$$
Now, since $x\in\left(-\dfrac1{\sqrt2},\dfrac1{\sqrt2}\right)$, hence, $\theta\in\left(-\dfrac\pi4,\dfrac\pi4\right)$ and therefore, $$\sin^{-1}\Big(\sin(2\theta)\Big)=2\theta$$
In the second case, 
$$x=\cos\theta,\qquad\theta\in[0,\pi]$$
Now, since by the given domain of $x$, we infer $\theta\in\left(\dfrac\pi4,\dfrac{3\pi}4\right)$. Hence,
$$\sin^{-1}\Big(\sin(2\theta)\Big)=\pi-2\theta$$
Hope it helps.
A: There is nothing wrong with your algebra. It’s just that you need to take extra care when dealing with the domain. Note that $\arcsin(\sin \theta=\theta$ only when $-\frac{\pi}{2} \le \theta\le \frac{\pi}{2}$. 
Substituting $x=\sin\theta$ gives $$y= \arcsin(2\sin\theta|\cos\theta|)=\arcsin|\sin 2\theta| $$ Now, $$-\frac{1}{\sqrt 2} \lt \sin\theta \lt \frac{1}{\sqrt 2} \\ \implies -\frac{\pi}{4} \le \theta\le \frac{\pi}{4} \\\implies -\frac{\pi}{2} \lt2\theta \lt \frac{\pi}{2}$$ and we can safely say that $$y=2\theta=2\arcsin x$$
But when $x=\cos \theta$, we have $$ -\frac{1}{\sqrt 2} \lt \cos\theta \lt \frac{1}{\sqrt 2} \\ \implies \frac{\pi}{4} \lt \theta \lt \frac{3\pi}{4} \\ \implies \frac{\pi}{2} \lt 2\theta \lt \frac{3\pi}{2}$$ This time, we need to shift by $\pi$ so that $$-\frac{\pi}{2}\lt 2\theta-\pi\lt\frac{\pi}{2}$$So, $$ y =\arcsin(\sin 2\theta) =\arcsin\left(-\sin(2\theta-\pi)\right) = \pi-2\arccos x \\ = 2\left(\frac{\pi}{2}-\arccos x\right) \\ = 2\arcsin x$$
