Find all real matrices such that $X^{6} + 2X^{4} + 10X = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}$ 
Find all matrices in $M_2(\mathbb R)$ such that $$X^{6} + 2X^{4} + 10X = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}$$

I tried to take the determinant and trace of both side, but it seems like it only works when the determinant of the RHS equals $0$. Can you guys help me please? Thank you.
 A: Alternatively there is a nice solution that makes use of the fact that
$$\begin{pmatrix} 0 & -1 \\ 1 & 0 \\ \end{pmatrix} \hspace{5 pt} \dot{=} \hspace{5 pt} i$$
from the representation of complex numbers as matrices. So in other words, find all of the solutions of 
$$z^6 + 2z^4 + 10z = i$$
for $z\in\mathbb{C}$. Then convert them back  into their matrix form:
$$a+bi \longrightarrow \begin{pmatrix} a & -b \\ b & a \\ \end{pmatrix}$$
What's nice about this way of looking at the problem is that we know from complex analysis that the polynomial will have exactly six solutions.
A: Let $P(x)=x^6+2x^4+10x$. The matrix $A=\begin{pmatrix}0&-1\\1&0\end{pmatrix}$ has $\pm i$ as eigenvalues. Then $X$ has $2$ distinct eigenvalues $a,b$ that satisfy $P(a)=i,P(b)=-i$. Note that $XA=AX$; if we diagonalize $A$ into $diag(i,-i)$, then $X$ is also diagonalized into $diag(a,b)$. Since the roots of the polynomials $P(x)\pm i$ are simple and pairwise conjugate (in the set of $12$ solutions), there are $36$ solutions over $\mathbb{C}$ and only $6$ over $\mathbb{R}$.
We use the Ninad Munshi's identification $A\approx i$; since $XA=AX$, the $6$ solutions over $\mathbb{R}$ are complex numbers and are the roots of $P(x)=i$.
Unfortunately, the considered roots are not solvable in $\mathbb{Q}[i]$. Indeed, consider the polynomial $Q(x)=(P(x)+i)(P(x)-i)$. According to Magma, this polynomial is irreducible over $\mathbb{Q}$ and has a non-solvable Galois group with cardinal $2(6!)^2$. In particular, over $\mathbb{Q}[i]$,the Galois groups of $P(x)\pm i$ are $S_6$.
