# square root of a real matrix

I want to compute the square root of a real symmetric positive definite matrix $S\in \mathcal{M}_{m,m}$ such that $S^{1/2}S^{1/2}=S$ and it's well known that this decomposition is unique.

My question is if I have $S$ a real matrix will its square root be real too or it could be a complex matrix. In case that it could be complex then $S$ could have infinitely many square roots.

-
Note that the answer by user1551 shows that the statement above needs the requirement that $S^{1/2}$ is positive (semi-)definite in order for the uniqueness claim to hold. If you are asking about possible complex positive definite square roots, then you should first make precise what exactly that means (usually "positive definite" implies real symmetric, but allowing complex Hermitian matrices is a possibility). If you don't want the positive definite requirement, infinitely many real and complex solutions may exist. – Marc van Leeuwen Apr 4 '13 at 5:11

If $S$ is real, symmetric and positive definite, consider its eigenvalue / eigenvector decomposition $S = X \Lambda X^T$ where $\Lambda$ is diagonal and $X$ is orthogonal. Because $S$ is positive definite, $\Lambda_{ii} > 0$ for all $i$. The unique symmetric and positive definite square root of $S$ is given by $S^{1/2} = X \Lambda^{1/2} X^T$, where $\Lambda^{1/2}$ is the diagonal matrix with the $\sqrt{\Lambda_{ii}}$ on its diagonal. Indeed, $$S^{1/2} S^{1/2} = X \Lambda^{1/2} X^T X \Lambda^{1/2} X^T = X \Lambda X^T = S,$$ because $X^T X = I$. So $S^{1/2}$ is indeed real.
A real matrix $S$ can possess infinitely many real or nonreal square roots. For example, $$S=I=\begin{pmatrix}1&t\\0&-1\end{pmatrix}^2$$ for every $t\in\mathbb{C}$. Note that $S=I$ is real and positive definite.