Integral representation of Digamma function A similar question was already asked about 2 years ago:
Integral representation of the Digamma function
Someone asked for the derivation of the integral representation of the Digamma-function and it was answered, but I don't see how you get from here:
$$ \psi^{(0)}(x)=\frac{\int_{0}^{\infty}t^{x-1}ln(t)e^{-t}dt}{\int_{0}^{\infty}t^{x-1}e^{-t}dt} $$
To here:
$$ \psi (x)=\int _{0}^{\infty }\left({\frac {e^{-t}}{t}}-{\frac {e^{-xt}}{1-e^{-t}}}\right)\,dt $$ 
I really thought a lot about it, but I just don't see how it is done... :(
Thank you so much for your much-appreciated help :)
 A: Here is another derivation of the second formula:
We can use a Frullani Integral to evaluate the red part. The green part is a simple integral of an exponential.
$$
\begin{align}
&\int_0^\infty\left(\frac1t-\frac1{1-e^{-t}}\right)e^{-t}\,\mathrm{d}t\\
&=\lim_{n\to\infty}\sum_{k=1}^n\int_0^\infty\left(\color{#C00}{\frac1t}-\color{#090}{\frac1{1-e^{-t}}}\right)\left(e^{-kt}-e^{-(k+1)t}\right)\,\mathrm{d}t\\
&=\lim_{n\to\infty}\sum_{k=1}^n\left(\color{#C00}{\log\left(\frac{k+1}k\right)}-\color{#090}{\frac1k}\right)\\[6pt]
&=\lim_{n\to\infty}\left(\color{#C00}{\log(n+1)}-\color{#090}{H_n}\right)\\[9pt]
&=-\gamma\tag1
\end{align}
$$
where $\gamma$ is the Euler-Mascheroni constant.
This integral evaluates to the extension of the Harmonic Numbers to all of $\mathbb{C}$ (except the negative integers).
$$
\begin{align}
\int_0^\infty\frac{e^{-t}-e^{-zt}}{1-e^{-t}}\,\mathrm{d}t
&=\sum_{k=1}^\infty\int_0^\infty\left(1-e^{-(z-1)t}\right)e^{-kt}\,\mathrm{d}t\\
&=\sum_{k=1}^\infty\left(\frac1k-\frac1{k+z-1}\right)\\[6pt]
&=H_{z-1}\tag2
\end{align}
$$
If $\mathrm{Re}(z)\gt0$, each of the integrals in the sum converges and the sum of those integrals converges.
Putting these together, we get that for $\mathrm{Re}(z)\gt0$,
$$
\begin{align}
&\int_0^\infty\left(\frac{e^{-t}}t-\frac{e^{-zt}}{1-e^{-t}}\right)\mathrm{d}t\\
&=\int_0^\infty\left(\left(\frac1t-\frac1{1-e^{-t}}\right)e^{-t}+\frac{e^{-t}-e^{-zt}}{1-e^{-t}}\right)\mathrm{d}t\\[6pt]
&=H_{z-1}-\gamma\tag3
\end{align}
$$
and this is the digamma function, as shown in this answer.
A: I'll give a more detailed version of Jack D'Aurizio's answer on the other question.Start with the Weierstrass product for the $\Gamma$ function
$$ \Gamma(z+1) = e^{-\gamma z}\prod_{n\geq 1}\left(1+\frac{z}{n}\right)^{-1}e^{z/n}\tag{1}.$$
By definition, 
\begin{align*}
\psi(z+1) &= \frac{d}{dz} \log \Gamma(z+1) \\
&= \frac{d}{dz} \log\left( e^{-\gamma z}\prod_{n\geq 1}\left(1+\frac{z}
{n}\right)^{-1}e^{z/n}\right)\\
&= \frac{d}{dz}\left( -\gamma z + \sum_{n\geq 1}\left(\frac{z}{n} + \log \left(1+\frac{z}
{n}\right)^{-1}\right) \right)\\
&=  -\gamma + \sum_{n\geq 1}\left(\frac{1}{n} - \frac{1}{z+n}\right)
\end{align*}
Now note that 
\begin{align*}\gamma &= \lim_{k\rightarrow \infty} - \log(k) + \sum_{n=1}^k 1/n \\
&= \lim_{k \rightarrow \infty} -\sum_{n=1}^{k-1} \big( \log(n+1) - \log(n)\big) + \sum_{n=1}^{k} \frac{1}{n} \\
&= \sum_{n=1}^{\infty} \big( \log(n) - \log(n+1) + \frac{1}{n} \big)
\end{align*} since the inner sum is a telescoping series.
And so 
\begin{align*}
\psi(z+1) &= \sum_{n\geq 1}\left[\log(n+1)-\log(n)+\frac{1}{n+z}.\right]
\end{align*}
Now he cites the identity
$$ \log(n+1)-\log(n) = \int_{0}^{+\infty}\frac{e^{-nt}-e^{-(n+1)t}}{t}\,dt$$
(by Frullani), and 
$$\frac{1}{n+z} = \int_{0}^{+\infty} e^{-(n+z)t}\,dt$$
by a Laplace transform (or just by hand).
And so we get
\begin{align*}
\psi(z+1) &= \sum_{n\geq 1}\int_{0}^{+\infty}\frac{e^{-nt}-e^{-(n+1)t}}{t} + e^{-(n+z)t}\,dt\\
&=\int_{0}^{+\infty} \sum_{n\geq 1}\frac{e^{-nt}-e^{-(n+1)t}}{t} + e^{-(n+z)t}\,dt\\
&=\int_{0}^{+\infty} \left( \frac{1- e^{-t}}{t} + e^{-zt} \right)\sum_{n\geq 1} e^{-nt}   \,dt \\
&=\int_{0}^{+\infty} \left( \frac{1- e^{-t}}{t} + e^{-zt} \right) \frac{e^{-t}}{1-e^{-t}}   \,dt \\
&=\int_{0}^{+\infty} \left(\frac{e^{-t}}{t} + \frac{e^{-(z+1)t}}{1-e^{-t}} \right) \,dt \\
\end{align*}
and we are done (modulo whatever typos/mistakes I've made.)
