difficult , classical? Let $A, B$ two matrix in $\mathcal{M}_n(\mathbb{C})$
 such that $AB=BA$
suppose that all eigenvalues of $B$ are distincts 
1) show that every eigenvector of $B$ is an eigenvector of $A$
2)show that it exist a polynomial $P$ which coefficient are in $C$ such that $deg(P) < n$ and $A=P(B)$

If $v\ne0$ and $Bv=\lambda v$, then
$$
\lambda(Av)=ABv=B(Av)
$$

If $Av=0$, then $v$ is an eigenvector of $A$.


If $Av\ne0$, prove that $Av=\mu v$, for some $\mu$, and so $v$ is also an eigenvector of $A$.


Prove there exists an invertible matrix $S$ such that both $S^{-1}BS$ and $S^{-1}AS$ are both diagonal.


If $P$ is a polynomial, then $P(S^{-1}BS)=S^{-1}P(B)S$. Thus $P(B)=A$ if and only if $P(S^{-1}BS)=S^{-1}AS$.

Hence it is not restrictive to assume both $A$ and $B$ to be diagonal. Suppose $B=\operatorname{diag}(\lambda_1,\dots,\lambda_n)$; if $P$ is a polynomial, then
$$
P(B)=\operatorname{diag}(P(\lambda_1),\dots,P(\lambda_n))
$$
If $A=\operatorname{diag}(\mu_1,\dots,\mu_n)$, the problem is reduced to find a polynomial $P$ of degree less than $n$ with
$$
P(\lambda_i)=\mu_i,\quad i=1,2,\dots,n
$$

Write $P=a_0+a_1X+\dots+a_{n-1}X^{n-1}$ and solve the resulting linear system. Why is it solvable?

