Eigenvalues and eigenspaces of AB Problem: Consider two matrices $A, B \in \mathbb{R}^{3 \times 3}$. Suppose $A$ has three distinct real eigenvalues $\lambda_1, \lambda_2$ and $\lambda_3$ with respective eigenspaces $E_{\lambda_1}, E_{\lambda_2}$ and $E_{\lambda_3}$. Suppose furthermore that $B$ has two distinct real eigenvalues $\mu_1$ and $\mu_2$ with respective eigenspaces $E_{\mu_1} = \text{span}(E_{\lambda_1}, E_{\lambda_2})$ (the space spanned by $E_{\lambda_1}$ and $E_{\lambda_2}$) and $E_{\mu_2} = E_{\lambda_3}$.
1) Determine the eigenvalues and corresponding eigenspaces of $AB$.
2) Show that $AB = BA$. 
Attempt at solution: I have no idea how to do this. I tried writing $\det(A - x \mathbb{I}_3) = (-1)^3 (x- \lambda_1) (x- \lambda_2) (x- \lambda_3)$ and then using the fact that $\det(AB) = \det(A) \det(B)$. But then I figured that the characteristic equation doesn't necessarily have to split like that ?
 A: There is a basis $\{ e_1,e_2,e_3 \}$ of eigenvectors of $A$ because there are three distinct eigenvalues for the $3\times 3$ matrix $A$, and non-zero eigenvectors corresponding to distinct eigenvalues form a linearly-independent set. These eigenvectors are also eigenvectors of $B$. So both $A$ and $B$ are diagonalizable with respect to this basis. In this basis,
$$
                A = \left[\begin{array}{ccc}\lambda_1 & 0 & 0 \\ 0 & \lambda_2 & 0 \\ 0 & 0 & \lambda_3\end{array}\right] \;\;\;
                 B = \left[\begin{array}{ccc}\mu_1 & 0 & 0 \\ 0 & \mu_1 & 0 \\ 0 & 0 & \mu_2\end{array}\right]
$$
Therefore, $A$ and $B$ commute in this basis system, which means they commute, i.e., $AB=BA$.
Let $e_j$ be a non-zero vector in $E_{\lambda_j}$ for $j=1,2,3$. Then $\{ e_1,e_2,e_3 \}$ satisfy
$$
\begin{array}{cc}
              Ae_1 = \lambda_1 e_1 & Be_1 = \mu_1 e_1,\\
              Ae_2 = \lambda_2 e_2 & Be_2 = \mu_1 e_2, \\
              Ae_3 = \lambda_3 e_3 & Be_3 = \mu_2 e_3.
\end{array}
$$
That's enough to work out $AB$ acting on this basis $\{e_1,e_2,e_3\}$:
$$
               ABe_1 = A(\mu_1 e_1) = \mu_1 Ae_1 = \mu_1 \lambda_1 e_1 \\
               ABe_2 = A(\mu_1 e_2) = \mu_1 Ae_2 = \mu_1 \lambda_2 e_2 \\
               ABe_3 = A(\mu_2 e_3) = \mu_2 Ae_3 = \mu_2\lambda_3 e_3
$$
This also follows by multiplying the diagonal matrix representations of $A$ and $B$.
