Possible Duplicate:
Simultaneous diagonalization
If $A$ and $B$ are diagonalisable matrices such that $AB=BA$, prove that there exists an invertible matrix $P$ such that $P^{-1}AP$ and $P^{-1}BP$ are diagonal matrices.
If such $P$ exists, the columns of $P$ must be eigenvectors of $A$ and $B$, right? So we need to prove that $A$ and $B$ have exactly the same eigenvectors. If $x$ is an eigenvector of $A$ associated to an eigenvalue $\lambda$, then $ABx=BAx=B\lambda x=\lambda Bx$. So $Bx$ is also an eigenvector of $A$. I'm not sure how to continue from here.