Integrating a Linear Operator $A:H\longrightarrow H$ (Matrix) I am trying to prove a functional analysis proposition, but I got stuck. I have to integrate a matrix.
In my proof I use the following matrix:

Let $A$ be a self-adjoint matrix on $H=\mathbb{C}^n$ with the following decomposition:
  $$A=V^*\,\,\text{Diag}(\lambda_1,\ldots,\lambda_n)\,\,V, $$
  where $V$ is Unitary and $\lambda_1\le\ldots\le\lambda_n$

Now, I came across this integral
$$f(A)=\frac{1}{2\pi i}\int_{\Gamma}{f(\lambda)(\lambda-A)^{-1}d\lambda},$$
where $\Gamma$ is the Cauchy contour around spectrum $\sigma(A)$. Here, I assume that $f$ is holomorphic on $\Omega$ (inner domain of $\Gamma$).
My question is: How can I evaluate this integral? Is there a special method to integrate matrices or an easy way to construct the contour?
Any hints are appreciated.
 A: Case 1. You know approximations of the eigenvalues of $A$; then you know also (the calculation is in $O(n^3)$) a convenient matrix $V$ and finally $f(A)=V^*diag(f(\lambda_1),\cdots,f(\lambda_n))V$.
Of course, you can also use the mickep's method. Yet, the calculation of $(\lambda I_n-A)^{-1}$ becomes complicated when $n$ grows.
Case 2. You know only bounds about the eigenvalues; then you choose some disc  containing $spectrum(A)$ and no poles of your function $f$. Parametrize the edge of the disc $\lambda=a+re^{i\theta},\theta\in[0,2\pi]$. Calculate (numerically) $1/(2i\pi)\int_0^{2\pi}f(a+re^{i\theta})((a+re^{i\theta})I_n-A)^{-1}rie^{i\theta}d\theta$.
A: The contour $\Gamma$ doesn't matter, as long as all $\lambda_j$ are inside. You have, with $D=\text{Diag}\,(\lambda_1,\ldots,\lambda_n)$, $$ \lambda I-A=\lambda V^* V-V^*DV=V^*(\lambda I-D)V=V^*\,\begin{bmatrix}\lambda-\lambda_1&0&\cdots&0\\ 0&\lambda-\lambda_2&\cdots&0\\ \vdots& &\ddots&\vdots \\0&0&\cdots&\lambda-\lambda_n
\end{bmatrix}\,V,
$$
so
$$ (\lambda I-A)^{-1}=V^*\,\begin{bmatrix}\frac1{\lambda-\lambda_1}&0&\cdots&0\\ 0&\frac1{\lambda-\lambda_2}&\cdots&0\\ \vdots& &\ddots&\vdots \\0&0&\cdots&\frac1{\lambda-\lambda_n}
\end{bmatrix}\,V.
$$
Conjugation by $V$ is linear and continuous, so 
\begin{align}
f(A)&=\frac1{2\pi i}\,\int_\Gamma f(\lambda)\,V^*(\lambda I-D)^{-1}\,V\,d\lambda
=V^*\,\frac1{2\pi i}\,\int_\Gamma f(\lambda)\,(\lambda I-D)^{-1}\,d\lambda\,V\\ \ \\
&=V^*\,\begin{bmatrix}\displaystyle\frac1{2\pi i}\,\int_\Gamma \frac{f(\lambda)}{\lambda-\lambda_1}\,d\lambda&0&\cdots&0\\ 0&\displaystyle\frac1{2\pi i}\,\int_\Gamma \frac{f(\lambda)}{\lambda-\lambda_2}\,d\lambda&\cdots&0\\ \vdots& &\ddots&\vdots \\0&0&\cdots&\displaystyle\frac1{2\pi i}\,\int_\Gamma \frac{f(\lambda)}{\lambda-\lambda_n}\,d\lambda
\end{bmatrix} \, V\\ \ \\
&=V^*\,\begin{bmatrix}f(\lambda_1)&0&\cdots&0\\ 0&f(\lambda_2)&\cdots&0\\ \vdots& &\ddots&\vdots \\0&0&\cdots&f(\lambda_n)
\end{bmatrix} \, V
\end{align}
