Computing $ \int_0^\infty \frac{\log x}{\exp x} \ dx $

lemma1: $$\int_{0}^{1}\dfrac{1-e^{-x}}{x}dx-\int_{1}^{\infty}\dfrac{e^{-x}}{x}dx=\gamma$$

pf:use \begin{align}\sum_{i=1}^{n}\dfrac{1}{i}&=\int_{0}^{1}\dfrac{1-t^n}{1-t}dt\\ &=\int_{0}^{n}\dfrac{1-(1-\frac{x}{n})^n}{x}dx \end{align} and $$\ln{n}=\int_{1}^{n}\dfrac{1}{x}dx$$ so $$\gamma=\lim_{n\to\infty}(\sum_{i=1}^{n}\dfrac{1}{i}-\ln{n})=\lim_{n\to\infty}\left(\int_{0}^{1}\dfrac{1-(1-x/n)^n}{x}dx-\int_{1}^{n}\dfrac{(1-x/n)^n}{x}dx\right)$$

so $$\gamma=\int_{0}^{1}\dfrac{1-e^{-x}}{x}dx-\int_{1}^{\infty}\dfrac{e^{-x}}{x}dx=\int_{0}^{1}(1-e^{-x})d(\ln{x})-\int_{1}^{\infty}e^{-x}d(\ln{x})=\cdots=-\int_{0}^{\infty}e^{-x}\ln{x}dx$$


Here is one way, just derived it (by the way, the integral is equal to $-\gamma$). We know from Euler that you can write the logarithm as the following limit

$$\mathrm{ln}(x)=\lim_{n \to 0}\frac{x^n-1}{n}$$

The integral is now

$$\int_0^\infty \frac{\mathrm{ln} x}{\exp x}dx=\lim_{n\to 0}\frac{1}{n}\int_{0}^\infty\frac{x^n-1}{e^x}dx$$

This is just the Euler integral of second kind, thus you get

$$\int_0^\infty \frac{\mathrm{ln} x}{\exp x}dx=\lim_{n\to 0}\frac{\Gamma(n +1)-1}{n}=-\gamma$$


Recalling the Mellin transform of a function $f$

$$ F(s)=\int_{0}^{\infty}x^{s-1}f(x)dx \implies F'(s) = \int_{0}^{\infty} x^{s-1}\ln(x)f(x) dx.$$

So, taking $f(x)=e^{-x}$ and finding its Mellin transform

$$ F(s)=\Gamma(s) \implies F'(s)=\Gamma'(s) $$

Taking the limit as $s\to 1$ yields the desired resuly

$$ \lim_{s\to 1}F'(s)=-\gamma. $$

Note: You can use the identity to find the limit

$$ \psi(x)=\frac{d}{dx}\ln\Gamma(x)=\frac{\Gamma'(x)}{\Gamma(x)}\implies \Gamma'(x)=\Gamma(x)\psi(x), $$

where $\psi(x)$ is the digamma function and $\psi(1)=-\gamma$.