TITLE: Computing $ \int_0^\infty \frac{\log x}{\exp x} \ dx $
QUESTION [42 upvotes]: I know that $$ \int_0^\infty \frac{\log x}{\exp x} = -\gamma $$ where $ \gamma $ is the Euler-Mascheroni constant, but I have no idea how to prove this.
The series definition of $ \gamma $ leads me to believe that I should break the integrand into a series and interchange the summation and integration, but I can't think of a good series. The Maclaurin series of $ \ln x $ isn't applicable as the domain of $ x $ is not correct and I can't seem to manipulate the integrand so that such a Maclaurin series will work. 
Another thing I thought of was using $ x \mapsto \log u $ to get $ \int\limits_{-\infty}^\infty \frac{\log \log u}{u^2} \ du $ and use some sort of contour integration, but I can't see how that would work out either.

REPLY [10 votes]: For $x\le n$, $\left(1-\frac{x}{n}\right)^n$ increases with $n$. By Bernoulli's Inequality,
$$
\begin{align}
\frac{\left(1-\frac{x}{n+1}\right)^{n+1}}{\left(1-\frac{x}{n}\right)^n}
&=\left(\frac{(n+1-x)\,n}{(n+1)(n-x)}\right)^{n+1}\left(1-\frac{x}{n}\right)\\
&=\left(1+\frac{x}{(n+1)(n-x)}\right)^{n+1}\left(1-\frac{x}{n}\right)\\[6pt]
&\ge\left(1+\frac{x}{n-x}\right)\left(1-\frac{x}{n}\right)\\[9pt]
&=\frac{n}{n-x}\frac{n-x}{n}\\[12pt]
&=1
\end{align}
$$
Therefore, by Monotone Convergence,
$$
\begin{align}
\int_0^\infty\log(x)e^{-x}\mathrm{d}x
&=\lim_{n\to\infty}\int_0^n\log(x)\left(1-\frac{x}{n}\right)^n\mathrm{d}x\\
&=\lim_{n\to\infty}n\int_0^1(\log(x)+\log(n))\,(1-x)^n\,\mathrm{d}x\\
&=\lim_{n\to\infty}n\int_0^1(\log(1-x)+\log(n))\,x^n\,\mathrm{d}x\\
&=\lim_{n\to\infty}\frac{n}{n+1}\log(n)-n\int_0^1\sum_{k=1}^\infty\frac{x^k}{k}x^n\,\mathrm{d}x\\
&=\lim_{n\to\infty}\frac{n}{n+1}\log(n)-n\sum_{k=1}^\infty\frac1{k(n+k+1)}\\
&=\lim_{n\to\infty}\frac{n}{n+1}\log(n)-\frac{n}{n+1}\sum_{k=1}^\infty\left(\frac1k-\frac1{n+k+1}\right)\\
&=\lim_{n\to\infty}\frac{n}{n+1}\left(\log(n)-\sum_{k=1}^{n+1}\frac1k\right)\\[6pt]
&=-\gamma
\end{align}
$$