integral representation of matrix logarithm Consider the following integral representation of $ln(X)$:
$$\ln(X) = \int_{0}^{\infty}[\frac{1}{1+t}I - (X+tI)^{-1}]dt.$$
I do not understand how they derived this formula.
The only formula I found is $\ln(A) = (A-I)\int_{0}^{1}[s(A-I)+I]^{-1}ds$ from page 13 in the link http://scipp.ucsc.edu/~haber/ph251/exp19.pdf
I appreciate if someone could send a reference of this formula, or its derivation. Thank you
 A: Intuitively, this is nothing but the matrix-version of the following identity
$$ \int_{0}^{\infty}  \left( \frac{1}{1+t} - \frac{1}{\lambda + t} \right) \, \mathrm{d}t = \log \lambda $$
for $\lambda$ in $ \Omega := \mathbb{C}\setminus(-\infty, 0]$. In light of functional calculus, this identity will remain true if we replace $\lambda$ by a square matrix $X$ with all of its eigenvalues lying in $\Omega$.
Let $\mathcal{X}_n$ denote the set of all $n\times n$ complex matrices for which the eigenvalues lie in $\Omega$.
1st Solution. Note that the set of all diagonalizable $X \in \mathcal{X}_n$ is dense in $\mathcal{X}_n$ and the integral in question is continuous on $\mathcal{X}_n$, it suffices to prove the claim when $X$ is diagonalizable. Then the general case follows by the continuity argument.
If $X \in \mathcal{X}_n$ is diagonalizable, we may write $X = P\operatorname{diag}(\lambda_k:1\leq k\leq n)P^{-1}$ for some invertible $P$ and for $\lambda_1, \dots, \lambda_n \in \mathbb{C}\setminus(-\infty, 0]$. Then
\begin{align*}
&\int_{0}^{\infty} \left( (1 + t)^{-1}I - (X + tI)^{-1} \right) \, \mathrm{d}t \\
&= P \operatorname{diag}\left( \int_{0}^{\infty}  \left( \frac{1}{1+t} - \frac{1}{\lambda_k + t} \right) \, \mathrm{d}t : 1 \leq k \leq n \right) P^{-1} \\
&= P \operatorname{diag}\left( \log \lambda_k : 1 \leq k \leq n \right) P^{-1} \\
&= \log X.
\end{align*}
Therefore the desired identity follows.
2nd Solution. By the holomorphic functional calculus, for each $X \in \mathcal{X}_n$,
$$ \log X = \frac{1}{2\pi i} \oint_{\Gamma} (z I - T)^{-1} \log(z) \, \mathrm{d}z $$
for any piecewise-smooth simple closed curve $\Gamma \subset \Omega$ enclosing all the eigenvalues of $X$. Since $\log(I) = 0$, we may as well write
$$ \log X = \frac{1}{2\pi i} \oint_{\Gamma} f(z) \, \mathrm{d}z, \qquad f(z) := \left[ (z I - T)^{-1} - (zI - I)^{-1} \right] \log(z). $$
This makes the integrand decay fast enough as $z \to \infty$, namely
$$ \left\| f(z) \right\| = \mathcal{O}\biggl( \frac{\log\left|z\right|}{\left|z\right|^2} \biggr) \quad\text{as } \left|z\right|\to\infty. $$
So by deforming the contour $\Gamma$ in the shape of keyhole contour surrounding the branch cut $(-\infty, 0]$ and letting the radius to infinity, only the infinite contour surrounding the branch cut remains, yielding
\begin{align*}
\log X
&= \frac{1}{2\pi i} \biggl( \int_{-\infty + 0^+i}^{0^+i} f(z) \, \mathrm{d}z + \int_{- 0^+i}^{-\infty-0^+i} f(z) \, \mathrm{d}z \biggr) \\
&= \frac{1}{2\pi i} \int_{0}^{\infty} \bigl( f(-t + 0^+i) - f(-t - 0^+i) \bigr) \, \mathrm{d}t \\
&= \int_{0}^{\infty} \left( -(t I + T)^{-1} + (tI + I)^{-1} \right)  \, \mathrm{d}t.
\end{align*}
In the third line, we used the fact that $\log(-t + 0^+i) - \log(-t - 0^+i) = 2\pi i$ for $t > 0$.
