<s>[INST] Find all real matrices such that $X^{3}-4X^{2}+5X=\begin{pmatrix} 10 & 20 \\ 5 & 10 \end{pmatrix}$ The following question come from the 1998 Romanian Mathematical Competition:

Find all matrices in $M_2(\mathbb R)$ such that $$X^{3}-4X^{2}+5X=\begin{pmatrix} 10 & 20 \\ 5 & 10 \end{pmatrix}$$

Can you guy please help me? Thanks a lot!
 [/INST] There is a matrix $U$ such that 
$$U^{-1}\begin{pmatrix} 10 & 20 \\ 5 & 10 \end{pmatrix} U=\begin{pmatrix} 20 & 0 \\ 0&0 \end{pmatrix}.$$ 
Let $Y=U^{-1}XU$, then $Y^{3}-4Y^{2}+5Y=\begin{pmatrix} 20 & 0 \\0 & 0 \end{pmatrix}$. The matrix $Y$ then commutes with $\begin{pmatrix} 20 & 0 \\ 0&0 \end{pmatrix}$ and so is diagonal. Let $Y=\begin{pmatrix} a & 0 \\ 0&b \end{pmatrix}.$
Then $a^{3}-4a^{2}+5a=20,b^{3}-4b^{2}+5b=0.$ The only real solutions are $a=4,b=0.$ 
Then $X$ is uniquely determined as $UYU^{-1}$. If we did not know  that $X=\begin{pmatrix} 2 & 4 \cr 1 & 2 \end{pmatrix}$ we could find it using the matrix $U$.
</s>