I don't feel that the linked answers completely solves you problem, so let me spell it out a little bit.
You write in your comments that
$\begin{equation}
\sqrt{x^2}=(x^2)^{\frac{1}{2}}=x
\end{equation}$
This is not correct. Sure, for a real number $x$ and integers $a$ and $b$, you have $(x^a)^b=x^{ab}$, but this is not true for non-integer exponents.
What might have confused you, is that the above rule is true when $x$ is a positive real number, and a lot of texts might ommit this crucial assumption when doing symbolic manipulations as the one suggested in the wrong equation above.
As some comments suggest, the correct equation is
$\sqrt{x^2}=|x|$
You can maybe convince yourself why this is true by considering what happens when $x$ is either negative or positive. Else let me know, and I'll happily elaborate.
Edit: Comprehensive proof that $\sqrt{x^2}=|x|$.
Let $x$ be any real number. If $x\ge 0$, we have by definition of the squareroot function that
$\sqrt{x^2}=x=|x|$
The first equality is true, since $x$ is the unique non-negative number satisfying the equation $y^2=x^2$ (where we solve for $y$). The second equality is true since the absolute value of a non-negative number is the number itself.
Let's now assume that $x< 0$. By this assumption, we have that $|x|=-x$. From this, we get
$x^2=1\cdot x^2=(-1)^2x^2=(-x)^2=|x|^2$
From this we get that
$\sqrt{x^2}=\sqrt{|x|^2}$
Since $|x|$ is a positive number, we conclude from the previous that
$\sqrt{x^2}=\sqrt{|x|^2}=|x|$