I'm reading Precalculus from James Stewart. In the book, the author says that $\sqrt{x^2}$ is not equal to $\big(\sqrt{x}\big)^2$. I was performing a couple of proofs and I ended up here:
If you have, for example:
$\sqrt{5^2} ≟ \big(\sqrt{5}\big)^2 \implies (\sqrt{5})² = \sqrt{5}\cdot\sqrt{5} = \sqrt{5}\cdot5 = \sqrt{25} = \big(\sqrt{5}\big)^2$
So, for me, $\sqrt{5^2}= \big(\sqrt{5}\big)^2$.
Can you proof that I'm wrong?
It is true for all positive and zero $x$, but if $x \lt 0, \sqrt x$ is not defined in the reals, so $(\sqrt x)^2$ is also not defined. On the other hand $\sqrt {x^2}$ is defined and equals $|x|$ for all real $x$