## Nonscalar matrices of dimension 2 over a field are similar if and only if they have the same characteristic polynomial

Let $A,B \in \mathsf{Mat}_2(F)$ be nonscalar matrices over a field $F$. Prove that $A$ and $B$ are similar if and only if they have the same characteristic polynomial.

We showed in this previous exercise that similar matrices have the same characteristic polynomial. Thus it suffices to show that two nonscalar matrices of dimension 2 having the same characteristic polynomial are similar. To do this, it suffices to show that two such matrices have the same rational canonical form.

To this end, let $A$ and $B$ be $2 \times 2$ matrices over $F$ having the same characteristic polynomial. Note that $p(x) = \mathsf{char}_A(x) = \mathsf{char}_B(x)$ has degree 2.

Let $m_A(x)$ be the minimal polynomial of $A$. If $m_A(x) = x-\alpha$ has degree 1, then $p(x) = (x-\alpha)^2$ by Proposition 20 in D&F, and the invariant factors of $A$ are $x-\alpha$ and $x - \alpha$. But now $A$ is similar to the diagonal matrix $\alpha I = \begin{bmatrix} \alpha & 0 \\ 0 & \alpha \end{bmatrix}$. But if $Q^{-1}AQ = \alpha I$, then in fact $A = \alpha I$, a contradiction. So $m_A(x)$ has degree 2. Since $m_A(x)$ divides the characteristic polynomial of $A$ (being the divisibility-largest invariant factor, while the characteristic polynomial is the product of the invariant factors) and both are monic, we have $m_A(x) = p(x)$.

Similarly, we have $m_B(x) = p(x)$.

So $A$ and $B$ have the same minimal polynomial $m(x) = p(x)$, which is in fact their (only) invariant factor. So $A$ and $B$ have the same rational canonical form. By Theorem 15 in D&F, $A$ and $B$ are similar.