It is a well known result that if $u$ and $v$ are two diagonalizable endomorphisms of a $\mathbb{C}$ finite-dimensional linear space $E$, if $u$ (or $v$) has distinct eigenvalues and if $u$ and $v$ commute, then $u$ and $v$ are simultaneously diagonalizable.
I am wondering what happens when we drop the hypothesis that $u$ or $v$ has distinct eigenvalues ? The usual proof consists in saying that if $(\lambda_{1},\ldots,\lambda_{n})$ are the distinct eigenvalues of $u$ and $E_{i} = \mathrm{ker}(u- \lambda_{i} \mathrm{Id})$ then $g_{\vert E_{i}}$ (the endomorphism induced by $g$ on $E_{i}$) is diagonalizable. Then if $B_{i}$ is a basis of $E_{i}$ composed of eigenvectors for $g$, $(B_{1},\ldots,B_{n})$ is a basis of $E$ which diagonalize both $u$ and $v$.
What changes if the engenvalues are not distinct ?