Determine $X \in M_{n\times n}(\mathbb{C})$ satisfying $AX=XA$ for every $A \in M_{n\times n}(\mathbb{C})$. I want to determine(or classify) all the complex matrix $X$, i.e.,  $X \in M_{n\times n}(\mathbb{C})$ satisfying $AX=XA$ for every $A \in M_{n\times n}(\mathbb{C})$.
Obviously if $X= O_n=0$ or $X= I_n= \operatorname{diag}(1,\cdots, 1)$ then it commutes.

Explicit trials : For $n=1$ is trivial.
For $n=2$, denoting $(A)_{ij} = a_{ij}, (X)_{ij} = x_{ij}$, One have
\begin{align}
\begin{pmatrix}
a_{11} x_{11} + a_{12} x_{21} & a_{11} x_{12} + a_{12} x_{22} \\
a_{21} x_{11} + a_{22} x_{21} & a_{21} x_{12} + a_{22} x_{22}
\end{pmatrix}=
\begin{pmatrix}
x_{11} a_{11} + x_{12} a_{21} & x_{11} a_{12} + x_{12} a_{22} \\
x_{21} a_{11} + x_{22} a_{21} & x_{21} a_{12} + x_{22} a_{22}
\end{pmatrix}
\end{align}
Since my $A$ is arbitrary, solving these four equations in terms of $x_{ij}$...
Solving this I have $x_{21} = \frac{a_{21} x_{12}}{a_{12}}$, $x_{22} = x_{11} - \frac{(a_{11} - a_{22})x_{12}}{a_{12}}$.
Do I have to solve for the $n\times n$ matrix explicitly? .. Any ideas or known results?
 A: I don't know any result giving the commutant of a matrix $A$ without any assumptions. Suppose $A$ is diagonalizable, then $C(A)$ is an algebra of dimension $m_1^2+\ldots+m_r^2$ where $m_i$ is the multiplicity of the eigenvalue $\lambda_i$, and ${\rm Sp}(A)=\{\lambda_1,\ldots,\lambda_r\}$. On the one hand, if $X\in C(A)$, then the eigenspaces of $A$ are stable by $X$. On the other hand, if $X$ stabilizes all the eigenspaces of $A$, then for $v=\sum_{i=1}^r v_i\in \mathbb{C}^n$ with $v_i\in{\rm Ker}(A-\lambda_i I_n)=:E_i$, then
$$ AXv=\sum_{i=1}^r A\underbrace{(Xv_i)}_{\in E_i}=\sum_{i=1}^r \lambda_i Xv_i=X\sum_{i=1}^r \lambda_i v_i=X\sum_{i=1}^n Av_i=XAv $$
Therefore $C(A)$ is the set of all matrices $X$ that stabilizes all the eigenspaces of $A$, which means that in a basis that diagonalizes $A$, such a $X$ has blocks in the diagonale of dimensions $m_1,\ldots,m_r$ and this ends the proof. In particular, if $A$ has $n$ distinct eigenvalues, $C(A)$ is the set of diagonal matrices, which means that $C(A)=\mathbb{C}[A]$.
