Derivative when $(\sqrt{x})^2$ is involved? Problem: If $f(x)=\frac{1}{x^2+1}$ and $g(x)=\sqrt{x}$, then what is the derivative of $f(g(x))$?
My book says the answer is $-(x+1)^{-2}$. This answer seems flawed because $(\sqrt{x})^2$ is being simplified to $x$ when it should really be simplified to $|x|$. If $(\sqrt{x})^2$ is simplified to $|x|$ then the answer I get is instead $-\frac{x}{|x|(|x|+1)^2}$. But the book is probably right so is there something I'm overlooking?

The domain of $f(g(x))$ is $[0,\infty)$ so the absolute value does not do anything here.
