<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] dan_fulea mentioned in another answer that the contestants are not expected to know diagonalisation or Jordan form. So, I will give a more elementary solution below. Let
$$
A=uv^T=\pmatrix{2\\ 1}\pmatrix{1&2}.
$$
The equation in question is equivalent to
$$
X^3-4X^2+5X=5A.\tag{1}
$$
One can easily verify that $A^2=4A$ and $X=A$ is a solution to $(1)$. In general, if $X$ satisfies $(1)$, we must have $XA=AX$, i.e. $Xuv^T=uv^TX$. Therefore $Xu=ku$ and $v^TX=kv^T$ for some common real factor $k$, and $XA=AX=kA$. It follows from $(1)$ that
\begin{aligned}
X^3A-4X^2A+5XA&=5A^2,\\
k^3A-4k^2A+5kA&=20A,\\
k^3-4k^2+5k-20&=0,\\
(k-4)(k^2+5)&=0.
\end{aligned}
Therefore $k=4$ and $XA=AX=4A$. Since $A^2=4A$, if we put $Y=X-A$, we get
$YA=AY=0$ or $Yuv^T=uv^TY=0$. Hence $Y$ must be a real scalar multiple of
$$
B=\pmatrix{2\\ -1}\pmatrix{1&-2}
$$
and $X=A+bB$ for some real scalar $b$. As $X=A$ is a solution to $(1)$, $AB=BA=0$ and $B^2=4B$, if we substitute $X=A+bB$ into $(1)$, we get
\begin{aligned}
b^3B^3-4b^2B^2+5bB&=0,\\
16b^3-16b^2+5b&=0,\\
b(16^2-16b+5)&=0,\\
b&=0.
\end{aligned}
Hence the only solution to $(1)$ is given by $X=A$.
</s>