While trying to find the derivative of $$f(x)=\arcsin\left(2x\sqrt{1-x^2}\right)$$ we arrive at two different answers by substituting $x=\sin t$ or $x=\cos t$. The aim is to simplify it as $\arcsin(\sin2t)$ and further simplify it as $2t$ and take its derivative. Proceeding in that manner, I arrived at two different answers for the derivative. I could understand that it was because the function $f$ is defined differently in different intervals, and as I have solved the problem without considering the intervals, I hit this answer. Also, I thought that since $\sin t$ and $\cos t$ will coincide only when $t=\dfrac{\pi}4$, $x=\pm\dfrac1{\sqrt{2}}$ will be the points where the definition changes. I got some more clarity when I looked at the graph of $f(x)$ but I could not figure out a way to systematically figure out what answer suits what interval.
MAJOR EDIT: I made a mistake in the function itself that I had given. My question earlier read: $$f(x)=\arcsin\left(2x\sqrt{x^2-1}\right)$$ But I wanted only for what I've now altered it as. My sincere apologies...
EDIT: My question is how to figure out the interval in which the substitution applies for such problems in general. I don't need the expression for the derivative of $f(x)$.
Note: I am new to this community, so please point out any deviation from the policy, if I have deviated. Also, I couldn't post my working as I do not have $10$ reputation.
$$f(x)=\arcsin(2x\sqrt{x^2-1})$$ $$\sin(f(x))=2x\sqrt{x^2-1}$$ $$f'(x)\ \cos(f(x))=2\sqrt{x^2-1}+2x\dfrac{2x}{2\sqrt{x^2-1}}$$ $$f'(x)\sqrt{1-\sin^2f(x)}=2\dfrac{2x^2-1}{\sqrt{x^2-1}}$$ $$f'(x)=2\dfrac{2x^2-1}{\sqrt{x^2-1}\sqrt{1-4x^4+4x^2}}$$