How do I find a root of $A^2$? How do I find a $3\times 3$ matrix $A$ whose first two diagonal entries are positive and  $A^2= \begin{bmatrix} 13&9&-9 \\ 0&4&0 \\ 12&12&-8 \end{bmatrix}$?
I tried various ways, but I'm still stuck. This problem is supposed to be solved in 3-5mins, so there must be a point I'm missing.
Some hints please. Thank you in advance.
 A: To generalise on the comment by Rudy the Reindeer: of course not all matrices $A\in \mathbb R^{n\times n}$ or $A\in\mathbb C^{n\times n}$ have square roots, but if $A$ has a square root, the following might help you.


*

*If $A$ is already a diagonal matrix with only positive entries, we are done as we then have $$A=\operatorname{diag}(a_1,\dots a_n)=\operatorname{diag}(\sqrt{a_1},\dots\sqrt{a_n})\cdot\operatorname{diag}(\sqrt{a_1},\dots \sqrt{a_n})=\sqrt{A}\cdot\sqrt{A}.$$ The root is not unique, as for each entry we can choose between $\pm\sqrt{a_i}$, thus we obtain $2^n$ different possible roots. If any entry $a_i$ is negative, we can find a complex root of $A$; $A$ still might have a real root, but in this case it won't be a diagonal matrix e.g. $$\begin{pmatrix} -1 & 0 \\ 0 & -1 \end{pmatrix} = \begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix}^2.$$

*If we can diagonalise $A$, we can use the solution from the first case: $$A=TDT^{-1}=T\sqrt{D}\sqrt{D}T^{-1}=\left(T\sqrt{D}T^{-1}\right)\left(T\sqrt{D}T^{-1}\right).$$ Agin we get $2^n$ different possible roots and might be facing complex roots.

*If we can't diagonalise $A$ and we allow the use of complex numebrs, we can find the Jordan Matrix $J$ with $A=TJT^{-1}$ and $J=\operatorname{diag}(J_1,\dots J_k)$, where $J_i$ denote the Jordan block $$J_i=\begin{pmatrix} \lambda_i & 1 & 0 & \dots & 0 \\ 0 & \lambda_i & 1 & \dots & 0 \\ \vdots & \ddots & \ddots & \dots & \vdots \\ 0 & 0 & \dots & \lambda_i & 1 \\ 0 & 0 &\dots & 0 &\lambda_1 \end{pmatrix}.$$ This again allows us to write $$A=TJT^{-1}=TJ^{\frac{1}{2}}T^{-1}=\left(TJ^{\frac{1}{2}}T^{-1}\right)\left(TJ^{\frac{1}{2}}T^{-1}\right),$$ where we get $J^{\frac{1}{2}}$ by taking the root of each Jordan block. For taking the root of a Jordan block $J_i$ we first look at $f(J_i)$ with $f(x)=x^{\beta},~\beta>0$. Let $l$ be the size of $J_i$, then: $$f(J_i)=\begin{pmatrix} f(\gamma_i) & \frac{1}{1!}f'(\gamma_i) & \dots & \frac{1}{(l-1)!}f^{(l-1)}(\gamma_i) \\ 0 & f(\gamma_i) & \ddots & \vdots \\ \vdots & \ddots & \ddots & \frac{1}{1!}f'(\gamma_i) \\ 0 & \dots & 0 & f(\gamma_i)\end{pmatrix}=\begin{pmatrix} a_{i,1} & a_{i,2} & \dots & a_{i,l-1} \\ 0 & a_{i,1} & \ddots & \vdots \\ \vdots & \ddots & \ddots & a_{i,2} \\ 0 & \dots & 0 & a_{i,1}\end{pmatrix}.$$ Thus we have $$a_{i,j}=\frac{\Gamma\left(\beta +1\right)\gamma_i^{\beta-j}}{\Gamma\left(j+1\right)\Gamma\left(\beta-j+1\right)}.$$ Now let $\beta=\dfrac{1}{2}$ to get $\displaystyle J_i^{\frac{1}{2}}$.
The third method only works for $\gamma_i\neq 0$. If we have $\gamma_i=0$ and $l>1$ there doesn't exist a root for the Jordan block $J_i$.
