If $B^2$= this matrix, find $B$ Find the real matrix $B$ such that
$$ B^2 = \begin{pmatrix} 2 & 0 & 1 \\ 0 & 1 & 0 \\ 1 & 0 & 2 \end{pmatrix} $$
I think I am meant to use egenvalues to solve this, but would i find the egenvalues for $B^2$ or what? I am stuck on what to do.
 A: The matrix $B^2$ is real-symmetric, so it is going to diagonalizable with real eigenvalues. Moreover, since the question tells you that $B$ is real, the eigenvalues will have to be non-negative.
A good strategy is therefore to find the eigenvalues and the corresponding eigenvectors first, thus obtaining a decomposition $B^2=EDE^{-1}$. The matrix $B$ is then computable from $B=EFE^{-1}$, where $F$ is the diagonal matrix obtained by taking the square root of the diagonal entries of $D$.
A: This is not general as the other answers, but works in this case. We have $B^2=I+P $,  where $$P=\begin {bmatrix}1&0&1\\0&0&0\\1&0&1\end {bmatrix}. $$ As $2P=P^2$ and it commutes with $I $, we have $$(I+\alpha P)^2=I+2\alpha P+2\alpha^2P=I+(2\alpha +2\alpha^2)P . $$So we can choose  $\alpha= \frac{\sqrt3-1}2$. Thus
$$
B=I+\left(\frac {\sqrt3-1}2\right)\,P=\begin {bmatrix}\frac {\sqrt3+1}2&0&\frac {\sqrt3-1}2\\ 0&1&0\\ \frac {\sqrt3-1}2&0&\frac {\sqrt3+1}2\end {bmatrix}. $$
A: In general, you can't find a single matrix $B$ such that $B^2$ is your given matrix (which I'll call $C$). There will be infinitely many solutions to the equation $B^2 = C$. However, note that your matrix is symmetric and hence diagonalizable with real eigenvalues. By diagonalizing orthogonally $C$, you can write $C = O^TDO$ with $O$ orthogonal and $D$ diagonal. The diagonal entries of $D$ will be the eigenvalues of $C$ - neccesarily non-negative real numbers. Then, by taking $B = O^T \sqrt{D} O$ where $\sqrt{D}$ is the diagonal matrix whose diagonal entries are the (positive) square roots of the diagonal entries of $D$, you will obtain a symmetric matrix $B$ such that $B^2 = C$ and such that the eigenvalues of $B$ are non-negative. This will be the unique symmetric matrix $B$ with non-negative eigenvalues such that $B^2 = C$.
