I'm running into the following problem:
If $A\in M_n$ and $A=S^{-1} DS,\, D=diag(d_1,...,d_n)$, and $P(\bullet)$ is a polynomial,
show that
$P(A)=S^{-1}P(D)S$ $\,$ where $\,P(D)=diag(P(d_1),...,P(d_n))$.
So I started by defining the $(i,j)th$ element of the matrix $A$ as
$$ A_{i,j}=(S^{-1}DS)_{i,j}=\sum_{k=1}^n (S^{-1})_{i,k}d_kS_{k,j}=\sum_{k=1}^n d_k(S^{-1})_{i,k} S_{k,j} $$
And so I could define the $(i,j)th$ element of the matrix $P(A)$ as:
$$ [1] \quad (P(A))_{i,j}=P(A_{i,j})=P(\sum_{k=1}^n d_k (S^{-1})_{i,k} S_{k,j})= \sum_{k=1}^n P(d_k (S^{-1})_{i,k} S_{k,j})$$
and on the other side, defining the $(i,j)th$ element of the right hand matrix:
$$ [2] \quad (S^{-1}P(D)S)_{i,j}=\sum_{k=1}^n (S^{-1})_{i,k}P(d_k)S_{k,j} $$
And now I should somehow show that $[1]$ is equal to $[2]$ for every $(i,j)\in {1,...,n}$
But I can't figure out how to disassemble the $P(..)$ in $[1]$ so I'm kinda stuck here..
Am I in the right direction? any help (fully or partially) with be greatful.