TITLE: A sufficient condition for diagonalization
QUESTION [5 upvotes]: How to prove that if $A,B,M\in \mathcal{M_n}(\mathbb{C})$ and $\lambda,\mu\in\mathbb{C}$ so
$$
  \begin{cases}
    M&=& \lambda A+\mu B \\
    M^2&=& \lambda^2 A+\mu^2 B \\
    M^3&=& \lambda^3 A +\mu^3 B
  \end{cases}
\Rightarrow M\ \text{is diagonalizable}.$$

REPLY [4 votes]: It does look like homework but I'll help you.
Consider the polynomial $P(X)=X(X-\lambda)(X-\mu)$.
You then have $P(M)=0$. 
Case 1: $\lambda\mu\neq 0$ and $\lambda\neq \mu$. So the elementary divisors of $M$ are linear, hence $M$ is diagonalizable.
Case 2: $\lambda\mu = 0$, WLOG say $\lambda =0$, if $\mu =0$ you are done, otherwise $B^2=B$, hence $B$ is diagonalizable.
Case 3: $\lambda = \mu \neq 0$, as in case 2, $M$ is diagonalizable because $A+B = (A+B)^2$.