Differentiation by Substitution Find $\frac{dy}{dx}$ if $$y=sin^{-1}\frac{1-x^2}{1+x^2}$$
Let us put $t=\frac{1-x^2}{1+x^2}$ then $y=sin^{-1}t$ So $$\frac{dy}{dx}=\frac{dy}{dt}×\frac{dt}{dx}$$ so we get $$\frac{dy}{dx}=\frac{d}{dt}(sin^{-1}t)×\frac{d}{dx}(\frac{1-x^2}{1+x^2})=\frac{1}{\sqrt{1-(\frac{1-x^2}{1+x^2})^2}}×\frac{-4x}{(1+x^2)^2}=\frac{1}{\sqrt{\frac{4x^2}{(1+x^2)^2}}}×\frac{-4x}{(1+x^2)^2}=\frac{1+x^2}{\sqrt{4x^2}}×\frac{-4x}{(1+x^2)^2} =\frac{1+x^2}{2x}×\frac{-4x}{(1+x^2)^2}=\frac{-2}{1+x^2}$$
$$$$ But I want to know that here we used $\sqrt{4x^2}=2x$ but if we use $\sqrt{4x^2}=-2x$ then we will get $$\frac{dy}{dx}=\frac{2}{1+x^2}$$, But if we substitute $x=tan\theta$ then we will get $$\frac{dy}{dx}=\frac{-2}{1+x^2}$$ for every $x$. Also in the method used above we have used $\frac{x}{x}=1$ but this is only true for $x$ not equal to $0$. How to explain all this?

Both your questions can be explained by looking at the graph of $y$.


*

*You'll notice that $y$ is not differentiable at $x = 0$ so your concern about $x/x = 1$ doesn't matter because there is no derivative there.

*You'll notice that for $x > 0$ the derivative is negative and for $x < 0$ the derivative is positive. On the other hand, $2/(1 + x^2)$ is always positive and $-2/(1+x^2)$ is always negative. So actually the derivative is
$$
\frac{dy}{dx} = \begin{cases}
\frac{2}{1+x^2} & x < 0 \\
\text{undefined} & x = 0 \\
-\frac{2}{1+x^2} & x > 0
\end{cases}
$$
What's going on here is that $\sqrt{u}$ is by definition always the non-negative square root. (See why is the range of the function $\sqrt x$ the set of numbers $\geq 0$). Therefore,
$$ \sqrt{x^2} = |x| $$
and, whereas $\lim_{x\to 0} x/x = 1$, the function $|x|/x$ does not have a limit as $x \to 0$ and hence the whole derivative is undefined at $x = 0$.
