# If A is diagonalizable, is $p(A)$ diagonalizable?

Problem: Let $$A$$ any $$n\times n$$ diagonalizable matrix. Is $$p(A)$$ diagonalizable for any polynomial p(x)?

My attempt: I set $$p(x)=a_nx^n+a_{n-1}x^{n-1}+\cdots+a_1x+a_0$$ I know that a matrix is diagonalizable iff there are n linearly independent eigenvectors.
So I set $$Ax=qx$$ (q is eigenvalue), and after some substituting, i got $$q(A)x=q(p)x$$ This is the part where I got stuck. I get a feeling that I should divide cases when A has n linearly independent eigenvectors by having n distinct eigenvalues, or if it has an eigenvalue with geometric multiplicity larger than $$1$$… Any hint please?

If $$M$$ is such that $$M^{-1}AM$$ is equal to some diagonal matrix $$D$$, then $$p(M^{-1}AM)=M^{-1}p(A)M$$, which is a sum of diagonal matrices. More precisely, if$$p(x)=a_nx^n+a_{n-1}x^{n-1}+\cdots+a_1x+a_0,$$then$$p(M^{-1}AM)=a_nD^n+a_{n-1}D^{n-1}+\cdots+a_1D+a_0\operatorname{Id}.$$Therefore, $$p(M^{-1}AM)$$ is a diagonal matrix too.