how can I find a matrix A such that $B=A^3$ where $$B=\begin{pmatrix} 8 & 12 & 0 \\ 0 & 8 & 12 \\ 0 & 0 & 8 \end{pmatrix}$$
I tried it working on the characteristic polynomial of $A$, but given that it's $f(t)=(8-t)^3$ then the only eigenvalue of $B$ is 8. What I wanted to do is to write $B=QDQ^{-1}$ where $D$ is the Diagonal matrix but I couldn't. I already know that $A$ must be equal to $\begin{pmatrix} 2 & 1 &-1/2 \\ 0 &2&1\\ 0&0&2 \end{pmatrix}$.
Any sugestions?
Here is a nice self-contained approach. Let $I$ denote the identity matrix, and write $$ N = \pmatrix{0&1&0\\0&0&1\\0&0&0}. $$ Your matrix is $$ B = 8I + 12 N. $$ I claim (as a "guess") that the cube root of this matrix can be written in the form $$ A = a_0 I + a_1 N + a_2 N^2. $$ Noting that $N^3 = 0$, we expand $(a_0 I + a_1 N + a_2 N^2)^3$ to get $$ B = A^3 = a_0^3 I + 3a_0^2a_1 N + 3a_0(a_1^2 + a_0a_2)N^2. $$ It now suffices to solve the system $$ \begin{cases} a_0^3 = 8\\ 3a_0^3a_1 = 12\\ 3a_0(a_1^2 + a_0a_2) = 0. \end{cases} $$