I need help with algebra of exponentiation.
$$\begin{align*} \sqrt{x^2} &= (x^2)^{1/2} &\qquad &\text{(since }\sqrt[x]{y}=y^{1/x}\text{)}\\ &= x^{2(1/2)} &&\text{(since }(x^y)^z = x^{yz}\text{)}\\ &= x^{(1/2)2} &&\text{(since }xy=yx\text{)}\\ &= (x^{1/2})^2 &&\text{(since }(x^y)^z = x^{yz}\text{)}\\ &= \left(\sqrt{x}\right)^2 &&\text{(since }\sqrt[x]{y} = y^{1/x}\text{)} \end{align*}$$
$\sqrt{x^2}$ is a real number.
$(\sqrt{x})^2$ is a real number, if $x\geq 0$.
$\sqrt{x^2} = (\sqrt{x})^2$.