Two $n × n$ matrices $A$ and $B$ are said to be simultaneously diagonalizable if there exists an invertible $n × n$ matrix $S$ such that $S^{−1}AS$ and $S^{−1}BS$ are both diagonal.
How do I prove that if $A$ and $B$ are $n × n$ matrices such that $A$ has $n$ distinct eigenvalues and $AB = BA$, then $A$ and $B$ are simultaneously diagonalizable.
I am totally lost on this problem.