<s>[INST] Square root of square as 2/2 power From school I know that 
$\sqrt{x^2} = |x|$.
But if we rewrite the above equation in another way
$\sqrt{x^2} = (x^2)^{\frac{1}{2}} = x^{\frac{2}{2}} = x^1 = x$
then we get another answer.
How is it possible that rewritting an equation changes the answer? And which answer is right, $x$ or $|x|$?
 [/INST] Let x be a positive number.
So the square of x is $x^2$
Also the square of -x is $(-x)^2 = (-1)^2 x^2 = x^2$.
So we have, $x^2 = (\pm x)^2$
Hence, $\sqrt{x^2} = \sqrt{(\pm x)^2 } = |x|$. As x is positive, |x| = x and as -x is negative |-x| = -(-x) = x 
This is simply x because we know in prior that, x is positive.
Now what if x is negative? Then there exists a number x' = -x > 0,
such that $\sqrt{x^2} = \sqrt{(-x')^2} = \sqrt{x'^2}= x' = -x = |x|$.(From the formal case)
Thus in general,$\sqrt{x^2} = |x|$
</s>