Derivative when $(\sqrt{x})^2$ is involved?

$$(\sqrt{x})^2\ne|x|.$$

Don't confuse $\left(\sqrt{x}\right)^2$ and $\sqrt{x^2}$. They actually give you different results:

$$\left(\sqrt{x}\right)^2=x,\ x\ge0$$

and

$$\sqrt{x^2}=|x|.$$

Plug these functions into an online graphing utility such as Desmos and you will see that $f(x)=\left(\sqrt{x}\right)^2$ has graphical output only for $x\ge0$. That's because the square root function is not defined for negative values of $x$. $f(x)=\sqrt{x^2}$, on the other hand, is nothing more than your good old absolute value function. It's defined on the entire real line.

So, the answer to your problem should really be: $$ -\frac{1}{(x+1)^2},\ x\ge0. $$

It should be $x\ge0$ because the original function is simply not defined for values of $x$ that are less than zero and therefore evaluating the derivative at those values would not make sense. However, they did not write $x\ge0$ next to their answer. That's because that information is already there as part of the original function which is a result of the composition of two other functions: $$\left(\frac{1}{\left(\sqrt{x}\right)^2+1}\right)'=-\frac{1}{(x+1)^2}.$$

See that square root function? It tells you that the domain of this new function is only those $x$ values that are greater than or equal to zero.

More properly, your original function should actually be written like this:

$$f(g(x))=\frac{1}{\left(\sqrt{x}\right)^2+1}=\frac{1}{x+1},\ \ x\ge0.$$

And that's the function you're talking the derivative of.


Within the real numbers, $\sqrt x$ is defined only when $x\geqslant0$ and, for each such $x$, $\sqrt x^2=x$. So, the answer provided by your book is correct.


Your book's answer is fine.

$g(x)=\sqrt{x}$ is defined only for $x\ge0$, so $|x|$ is the same as $x$.