How many matrices are there that are both similar and commute with a complex matrix Let $A$ be an $n \times n$ complex matrix whose characteristic polynomial has no repeated roots. How many $n\times n$ matrices over $\mathbb{C}$ are there that are both similar to and commute with $A$.
Since the characteristic polynomial has no repeated roots. We have $n$ distinct eigenvalues. So $A$ is diagonalizable.
We have $A= PDP^{-1}$. So $AP=PD$. From here, I'm not sure how to proceed.
Any help will be appreciated!
 A: Let $B$ be a $n\times n$ square matrix which commutes with $A$. Then $P^{-1}BP$ commutes with $P^{-1}AP=D$ and vice-versa. Now, to simplify, assume that $n=3$. If$$P^{-1}BP=\begin{bmatrix}b_{11}&b_{12}&b_{13}\\b_{21}&b_{22}&b_{23}\\b_{31}&b_{32}&b_{33}\end{bmatrix}\quad\text{and if}\quad D=\begin{bmatrix}\alpha&0&0\\0&\beta&0\\0&0&\gamma\end{bmatrix}.$$Then\begin{align}0&=\begin{bmatrix}b_{11}&b_{12}&b_{13}\\b_{21}&b_{22}&b_{23}\\b_{31}&b_{32}&b_{33}\end{bmatrix}.\begin{bmatrix}\alpha&0&0\\0&\beta&0\\0&0&\gamma\end{bmatrix}-\begin{bmatrix}\alpha&0&0\\0&\beta&0\\0&0&\gamma\end{bmatrix}\begin{bmatrix}b_{11}&b_{12}&b_{13}\\b_{21}&b_{22}&b_{23}\\b_{31}&b_{32}&b_{33}\end{bmatrix}\\&=\begin{bmatrix}0&(-\alpha+\beta)b_{12}&(-\alpha+\gamma)b_{13}\\(\alpha-\beta)b_{21}&0&(-\beta+\gamma)b_{23}\\(\alpha-\gamma)b_{31}&(\beta-\gamma)b_{32}&0\end{bmatrix},\end{align}and therefore $b_{12}=b_{13}=b_{23}=b_{21}=b_{31}=b_{32}=0$. In other words, $P^{-1}BP$ is a diagonal matrix. So, since it is similar to $D$, it's of the form$$\begin{bmatrix}\alpha'&0&0\\0&\beta'&0\\0&0&\gamma'\end{bmatrix}$$and the numbers $\alpha'$, $\beta'$, and $\gamma'$ are a permutation of the numbers $\alpha$, $\beta$, and $\gamma$. There are $6$ such permutations.
In the general case, the same approach shows that the answer is $n!$.
