Diagonalization of commutative matrices I have this problem. 
Let $A,B\in M_n(\mathbb C)$ such that $AB=BA$. assume that $A$ has n distinct eigenvalues. Prove that $B$ is diagonalizable.
I know that the eigenspaces of $A$ are $B$-invariant and that $A$ is diagonalizable, but I do not know how it helps (if it is). Any suggestions? thanks for helpers!
 A: For any eigenvector $v$ of $A$ with eigenvalue $\lambda$, you've already said that the eigenspaces of $A$ are $B$ invariant, so what does the fact that $Bv$ lies in the eigenspace of $\lambda$ tell you about how $Bv$ relates to $v$? (Note that $A$ having $n$ distinct eigenvalues tells you something about the dimension of each eigenspace.)
A: You're kind of already on the right track, but let's rephrase it.
Put the linearly independent eigenvectors $v_1,\ldots,v_n$ of $A$ in order as columns of a matrix $X$. We have that $AX=XD$ where $D$ is diagonal.
You can see that for each eigenvector $v$ of $A$, $Bv$ is an eigenvector of $A$. You can produce $n$ eigenvectors $Bv_1,\ldots Bv_n$ this way, and each one corresponds to a different eigenvalue, so they are linearly independent. This says that $BX$ is invertible. Combine this fact with the $AX=XD$ equation above, and you should rapidly see the end.
A: Let $A,B\in M_n(C)$ such that $AB=BA$. Assume that $A$ has $n$ distinct eigenvalues. Say $\{\lambda_1,\lambda_2,..\lambda_n\}$ are the eigenvalues of $A$ corresponding to the eigenvectors $\{x_1,x_2,..x_n\}$. Then $Ax_i=\lambda_ix_i$. Multiplying $B$ through out would give $BAx_i=\lambda_iBx_i\implies A(Bx_i)=\lambda_iBx_i $.This gives that $Bx_i$ is also an eigenvector corresponding to $\lambda_i$. But you already had $x_i$ as eigenvector and we know that eigenvectors are linearly independent. Moreover$A$ has ditinct eigenvalues. Hence $Bx_i=c_ix_i$ and you are through
