Show that $q(T)(x)=\sum_{n=1}^\infty q(\lambda_n) \langle x,e_n\rangle e_n$ coincide with $q(T)=\sum_{k=0}^n a_kT^k$ Let $Tx=\sum_{n=1}^\infty \lambda_n \langle x,e_n\rangle e_n$ be bounded where $\{\lambda_n\}_n$ are the complex eigenvalues and $\{e_n\}_n$ are
an orthonormal basis of the separable space $H$. For any continuous function $f : \mathbb C \to \mathbb C$ define $f(T)(x) = \sum_{n=1}^\infty f(\lambda_n) \langle x,e_n\rangle e_n$.
For a polynomial $q(x) = \sum_{k=0}^n a_kx^k$ we have $q(T) = \sum_{k=0}^n a_kT^k$where ^T^0 = I$. 
Prove that for polynomials $q(x)$, the definition $q(T)(x)=\sum_{n=1}^\infty q(\lambda_n) \langle x,e_n\rangle e_n$ coincide with the definition $q(T)=\sum_{k=0}^n a_kT^k$ meaning they give the same result for diagonalizable operators.
We say that a linear operator $T : H \to H$ is diagonalizable if $H$ has an orthonormal basis composed of eigenvectors of $H$.
 A: Since $Te_i = \lambda_i e_i$ and $||e_i|| = 1$, we must have $\sup_{i} |\lambda_i| \leq ||T|| < \infty$. Then, we have
$$ (T^2)(x) = T \left( \sum_{i=1}^{\infty} \lambda_i \left<x, e_i \right> e_i \right) = T \left( \lim_{N \to \infty} \sum_{i=1}^N \lambda_i \left<x, e_i \right> e_i \right) = \\
\lim_{N \to \infty} T \left( \sum_{i=1}^N \lambda_i \left<x, e_i \right> e_i \right) =
\lim_{N \to \infty} \sum_{i=1}^N \lambda_i \left<x, e_i \right>  T(e_i) = \lim_{N \to \infty} \sum_{i=1}^N \lambda_i^2 \left<x, e_i \right> e_i = \sum_{i = 1}^{\infty} \lambda_i^2 \left<x, e_i \right> e_i$$
and the last series converges absolutely. By induction it follows that $(T^k)(x) = \sum_{i=1}^{\infty} \lambda_i^k \left<x,e_i\right> e_i$ and so
$$ \left( \sum_{k=0}^n a_k T^k \right)(x) = \sum_{k=0}^n a_k T^k(x) = \sum_{k=0}^n a_k \left( \sum_{i=1}^{\infty} \lambda_i^k \left<x,e_i\right> e_i \right) = \sum_{i=1}^{\infty} \left( \sum_{k=0}^n a_k \lambda_i^k \right) \left<x, e_i \right> e_i = \\
\sum_{i=1}^{\infty} q(\lambda_i) \left<x, e_i \right> e_i.  $$
