Quick easy question! I was always taught at school that $(x^m)^n=x^{mn}$. However, I've only just noticed when computing something (two years into an undergrad course..) that for example $(x^2)^{\frac{1}{2}}=|x|$ rather than $x$. I've never really thought about it before. A lot of the time when simplifying I would have blindly done things like $\sqrt{x^4+x^2}=x\sqrt{x^2+1}$ which is clearly wrong now I've looked at it.
Is there a general rule I have not been taught before?