Square root of negative number I was reading my school's math textbooks for the next semester, and I found that when $a >0,$ $\sqrt{(-a)^2}=a$, but $\sqrt{(-a)^2}=\sqrt{a^2}i^2=-a$. So which one is right? 
 A: I think a key point here is that the square root function isn't well defined without making choices. Since 2 numbers square to any given nonzero number ($a^2=(-a)^2$), the square root is ambiguous unless you arbitrarily pick one. When dealing with the real numbers, it was decided to always pick the positive root. So $\sqrt{(a)^2}=|a|$ and $\sqrt{(-a)^2}=|a|$ for any real $a$.
As soon as you start dealing with complex numbers, things get more complicated. I don't know how to explain the fine details without a bunch of complex analysis but an important consequence is that you can't always say many things that feel like they should be true, such as: $\sqrt{ab}=\sqrt{a}\sqrt{b}$ or $\sqrt{a^2}=\sqrt{a}^2$ or any other formula that might get you from  $\sqrt{(-a)^2}$ to $\sqrt{a^2}i^2$
A: 
$a >0,$ $\sqrt{(-a)^2}=a$

This is correct, because $(-a)^2 = (-1)^2 a^2 = a^2$ and $\sqrt{a^2} = a$.

$\sqrt{(-a)^2}=\sqrt{a^2}i^2=-a$

This is not correct, because $\sqrt{(-a)^2} = a$ different from $\sqrt{a^2} i^2 = a (-1) = -a$.
A: The convention is that $b=\sqrt a$ means that $b$ is the non-negative solution $x$ of $x^2=a$. The square-root notation $\sqrt a$ is usually avoided unless $ a$ is a non-negative real number,  because of ambiguities. It's always good to check the definition, before trying any algebraic calculations. When someone first wrote $b=\sqrt a$ he had to explain exactly what that said about $b$.
