Is $\sqrt{x^2}=|x|$ or $=x$? Isn't $(x^2)^\frac12=x?$ [duplicate]

You know that $x^2$ is not an invertible function. To find an inverse you must restrict it. The convention is to restrict the function to positive numbers, hence the $\sqrt y$ function always gives the non negative solution to the equation $x^2=y$.

This being said you understand that the rule: $$ (x^p)^q = x^{pq} $$ is not valid when $x<0$, but is only valid for $x>0$.


$$\sqrt{x^2}=|x|$$ so if $x\ge 0$ then $\sqrt{x^2}=+x$ and if $x<0$ then $\sqrt{x^2}=-x$. In both cases the square root should be held positive. Many students have troubles in making difference between the question you asked and this fact that $(\pm x)^2=x^2$.


By convention, the square-root sign $\sqrt{}$ denotes the non-negative square root. So $\sqrt{x^2} = |x|$.