Using an integral involong reals to evaluate an operator integral I am perplexed by the justification offered for equation (8) in this paper, copied as follows:
$$\int_0^\infty \mathrm{d}s (\mathbf{A}+s)^{-1}\mathbf{A}(\mathbf{A}+s)^{-1}=\mathbf{I},\tag{8}$$
where $\mathbf{A}>0$ is a positive-definite operator, and $\mathbf{I}$ is an identity operator.  The justification for (8) is that, for $x>0$, $\int_0^\infty\mathrm{d}s~ x/(x+s)^2=1$.  
There seems something wrong with that statement to me -- for one, I think it is lacking rigor. However, I am not an expert on operator integration. When is it actually OK to reduce an integration problem involving operators to an integral involving only real numbers?  I am looking for the conditions when one can do this, and the source for the appropriate lemmata justifying this.
 A: In our case, the computation is perfectly fine since everything is done on a finite-dimensional Hilbert space. A good thing is that you can diagonalize $\mathbf{A}$:
$$ \mathbf{A} = \mathbf{U}^* \mathbf{D}\mathbf{U} $$
where $\mathbf{U}$ is a unitary matrix and $\mathbf{D} = \operatorname{diag}(\lambda_1, \cdots, \lambda_d)$ is a diagonal matrix consisting only of positive diagonals, i.e., $\lambda_1, \cdots, \lambda_d > 0$. Then
$$\int_{0}^{\infty} (\mathbf{A}+s)^{-1}\mathbf{A}(\mathbf{A}+s)^{-1} \, \mathrm{d}s = \mathbf{U}^* \left( \int_{0}^{\infty} (\mathbf{D}+s)^{-1}\mathbf{D}(\mathbf{D}+s)^{-1} \, \mathrm{d}s \right) \mathbf{U}. \tag{*} $$
The integral in the RHS is then a diagonal matrix whose $j$-th diagonal is exactly
$$ \int_{0}^{\infty} \frac{\lambda_j}{(\lambda_j+s)^2} \, \mathrm{d}s = 1. $$
This shows that the RHS of $\text{(*)}$ is $\mathbf{I}$.
Extending this to infinite Hilbert spaces requires some hard works, but the computation should be the same. I am not an expert of functional calculus, but I think the result remains fine for self-adjoint operators $\mathbf{A}$ with $\sigma(\mathbf{A}) \subseteq (0,\infty)$. Indeed this is true when $\mathbf{A}$ is bounded so that $\sigma(\mathbf{A})$ is compactly supported on $(0,\infty)$, and then the general case would follow from monotone-convergence argument.
A: This is perfectly fine. If you're not familiar with the spectral theory of self adjoint operators, I would suggest a more elementary approach, diagonalizing $A$ as $A=S^{-1}DS$ ($A$ is diagonalizable because $A>0$) so that 
$$(A+sI)^{-1}A(A+sI)^{-1}
=(S^{-1}DS+sS^{-1}S)^{-1}S^{-1}DS(S^{-1}DS+sS^{-1}S)^{-1}
=S^{-1}(D+sI)^{-1}SS^{-1}DSS^{-1}(D+sI)^{-1}S
=S^{-1}(D+sI)^{-1}D(D+sI)^{-1}S$$
And carry out the integration entrywise in the diagonal, 
$$
\int_{0}^{\infty}(A+sI)^{-1}A(A+sI)^{-1}ds
=\int_{0}^{\infty}S^{-1}(D+sI)^{-1}D(D+sI)^{-1}Sds
=S^{-1}\left(\int_{0}^{\infty}(D+sI)^{-1}D(D+sI)^{-1}ds\right)S
$$
