<s>[INST] Given a diagonalizable matrix $A$ and polynomial $f$, prove $f(A)$ is diagonalizable I have been given a diagonalizable matrix $A \in K^{n
\times n}$ and a polynomial $f \in K[X]$ for a field $K$. I need to prove that $f(A)$ is diagonalizable. Because the matrix $A$ is a arbitrary matrix, it follows: 
$$A = \left(\begin{array}{cccc}
a_{11} & a_{12} & \cdots & a_{1n}\\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & \ddots & \vdots\\
a_{n1} & a_{n2} & \cdots & a_{nn}
\end{array}\right) \in K^{n
\times n} \, for \, a_1,\dots,a_n \in K.$$
Assuming that $f$ is a normalized polynomial, it follows:
$$f = X^n + a_{n-1}X^{n-1} + \dots + a_1X + a_0$$
My first idea was to simply insert the given the matrix $A$ in the polynomial $f$ which results in the following:
$$f(A) = \left(\begin{array}{cccc}
a_{11} & a_{12} & \cdots & a_{1n}\\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & \ddots & \vdots\\
a_{n1} & a_{n2} & \cdots & a_{nn}
\end{array}\right)^n + a_{n-1}
\left(\begin{array}{cccc}
a_{11} & a_{12} & \cdots & a_{1n}\\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & \ddots & \vdots\\
a_{n1} & a_{n2} & \cdots & a_{nn}
\end{array}\right)^{n-1} + \dots + 
a_1\left(\begin{array}{cccc}
a_{11} & a_{12} & \cdots & a_{1n}\\
a_{21} & a_{22} & \cdots & a_{2n}\\
\vdots & \vdots & \ddots & \vdots\\
a_{n1} & a_{n2} & \cdots & a_{nn}
\end{array}\right)^1 + a_0
\left(\begin{array}{cccc}
1 & 0 & \cdots & 0\\
0 & 1 & \cdots & 0\\
\vdots & \vdots & \ddots & \vdots\\
0 & 0 & \cdots & 1
\end{array}\right)$$
I know that in order to determine the matrix $A^n$ I can use the following:
$$A^n = TB^nT^{-1} \text{$\,$ where B is a diagonal matrix}.$$
I know such matrix $B$ exists because matrix $A$ is diagonalizable, so $A$ is similar to a diagonal matrix. I don't know if this is the right approach because from this point on I am stuck. 
 [/INST] I think you can do it as this. Let
$$f(X) = X^n + a_{n-1}X^{n-1} + \cdots +a_1 X + a_0, \quad \in K[X]$$
be your polynomial and let $A$ diagonalize as
$$A = TBT^{-1}.$$
Then you have
\begin{align*}
f(A) &=A^n + a_{n-1}A^{n-1} + \cdots + a_1A + a_0I \\
&=TB^nT^{-1} + a_{n-1}TB^{n-1}T^{-1} + \cdots + a_1 TBT^{-1} + a_0 I \\
&=T \left(B^nT^{-1} + a_{n-1}B^{n-1}T^{-1} + \cdots + a_1 BT^{-1} + a_0 T^{-1} \right) \\
&=T \left(B^n + a_{n-1}B^{n-1} + \cdots + a_1 B + a_0 I \right)T^{-1}
\end{align*}
where we use the property, that for scalars $\lambda \in K$ and Matrices $A,B$, 
$$\lambda (AB) = (\lambda A)B = A(\lambda B)$$
Now we have to show, that the matrix $B^n + a_{n-1}B^{n-1} + \cdots + a_1 B + a_0 I$is a diagonal one. Let $\lambda_1,\dots, \lambda_n$  be the different eigenvalues, then
$$B^i = \begin{pmatrix} \lambda_1^i &0 &0 &\cdots &0 \\ 0 &\lambda_2^i& 0 &\cdots &0 \\ 0 &0&\lambda_3^i &\cdots &0\\\vdots&&&\ddots\\0&0&0&\cdots & \lambda_n^i\end{pmatrix},\quad \text{ for } 1 \le i \le n.$$
Since the sum of diagonal matrices is diagonal, and multiplication by scalar gives also a diagonal matrix, it should be fine.
</s>