Prove that $2\int_0^\infty \frac{e^x-x-1}{x(e^{2x}-1)} \, \mathrm{d}x =\ln(\pi)-\gamma$

Let $\gamma$ be the Euler-Mascheroni constant.

I'm trying to prove that

$$2\int_0^\infty \frac{e^x-x-1}{x(e^{2x}-1)} \, \mathrm{d}x =\ln(\pi)-\gamma$$

I tried introducing a parameter to the exponent in the numerator and then differentiating under the integral sign. But doing so seems to result in an integral that doesn't converge.

Hint. One may set $$f(s):=2\int_0^\infty \frac{e^{sx}-sx-1}{x(e^{2x}-1)}dx, \quad 0<s<2. \tag1$$ In order to get rid of the factor $x$ in the denominator, we may differentiate under the integral sign getting $$f'(s)=2\int_0^\infty \frac{e^{sx}-1}{e^{2x}-1}dx, \quad 0<s<2. \tag2$$ Then expanding the latter integrand in $e^{-kx}$ terms and integrating termwise we get $$f'(s)=-\gamma-\psi\left(1-\frac{s}2\right) \tag3$$ where $\displaystyle \psi : = \Gamma'/\Gamma$ and where $\gamma$ is the Euler-Mascheroni constant.

Integrating $(3)$, with the fact that, as $s \to 0$, $f(s) \to 0$, we get

$$2\int_0^\infty \frac{e^{sx}-sx-1}{x(e^{2x}-1)}dx=-\gamma s+2 \log \Gamma\left(1-\frac{s}2\right), \quad 0<s<2, \tag4$$

from which you deduce the value of your initial integral by putting $s:=1$.

Identity $(4)$ is much more than what was asked.

• (+1) Who doesn't love differentiation under the $\int$ sign? :) – Jack D'Aurizio May 1 '16 at 22:24

By Frullani's theorem we have: $$\int_{0}^{+\infty}\frac{e^x-1-x}{x}\,e^{-2m x}\,dx = -\frac{1}{2m}+\log\left(\frac{2m}{2m-1}\right)\tag{1}$$ hence it is straightforward to prove the claim by summing $(1)$ over $m\geq 1$, then exploiting: $$\gamma = \sum_{n\geq 1}\left[\frac{1}{n}-\log\left(1+\frac{1}{n}\right)\right] \tag{2}$$ that is just the usual definition of the Euler-Mascheroni constant, together with: $$\sum_{n\geq 1}(-1)^n \log\left(1+\frac{1}{n}\right) = -\log\left(\frac{2}{1}\cdot\frac{2}{3}\cdot\frac{4}{3}\cdot\frac{4}{5}\cdot\ldots\right) = -\log\frac{\pi}{2} \tag{3}$$ that follows from Wallis' product.

• Of course you have to prove that you can exchange the sum and the integral. – Rene Schipperus May 1 '16 at 22:22
• @ReneSchipperus: sure, but the RHS of $(1)$ is $O\left(\frac{1}{m^2}\right)$ and the original integrand function is very well-behaved, hence there is no real issue. – Jack D'Aurizio May 1 '16 at 22:25
• Its always a bit tricky with indefinite integral, not only do you need uniform convergence of the series but the integral must converge uniformly. On the other hand I think this works out and I myself would not bother to go into it for a stack exchange answer. – Rene Schipperus May 1 '16 at 22:30

\begin{align} 2\int_{0}^{\infty} \frac{e^x-x-1}{x(e^{2x}-1)} \, dx &= 2 \int_{0}^{\infty} \frac{1}{x(e^{2x}-1)} \sum_{n=2}^{\infty} \frac{x^{n}}{n!}\\ & = 2 \sum_{n=2}^{\infty}\frac{1}{n!} \int_{0}^{\infty} \frac{x^{n-1}}{e^{2x}-1} \, dx \\ &= 2 \sum_{n=2}^{\infty}\frac{1}{n!2^{n}} \int_{0}^{\infty} \frac{u^{n-1}}{e^{u}-1} \, du \\ &= 2 \sum_{n=2}^{\infty} \frac{\zeta(n)}{n 2^{n}} \tag{1} \\ &= 2 \sum_{n=2}^{\infty} \frac{1}{n 2^{n}} \sum_{k=1}^{\infty} \frac{1}{k^{n}} \\ &= 2 \sum_{k=1}^{\infty} \sum_{n=2}^{\infty} \frac{1}{n(2k)^{n}} \\ & =2 \sum_{k=1}^{\infty} \left[ \log \left(\frac{2k}{2k-1} \right) - \frac{1}{2k}\right] \\ & =2 \lim_{N \to \infty} \left(\log \left(\frac{(2N)!!}{(2N-1)!!} \right) - \frac{H_{N}}{2} \right) \\ &= 2 \lim_{N \to \infty} \left(\log \left(\frac{2^{2N}(N!)^2}{(2N)!} \right) - \frac{H_{N}}{2} \right) \tag{2} \\ &= 2 \lim_{N \to \infty} \left(\log \left(\frac{2^{2N}(2\pi N) \left(\frac{N}{e} \right)^{2N}}{\sqrt{2 \pi(2N)} \left(\frac{2N}{e} \right)^{2N}} \right) - \frac{H_{N}}{2} \right) \tag{3} \\ &= \lim_{N \to \infty} \left(\log(\pi) + \log(N) - H_{N} \right) \\ &= \log(\pi) - \gamma \end{align}

• Nice answer! (+1) – Olivier Oloa May 2 '16 at 20:31


Note that $\ds{{\expo{x} - 1 \over x} - 1 = \int_{0}^{1}\pars{\expo{xt} - 1}\,\dd t}$ such that

\begin{align} &\color{#f00}{% 2\int_{0}^{\infty}{\expo{x} - x - 1 \over x\pars{\expo{2x} - 1}}\,\dd x} = 2\int_{0}^{1}\int_{0}^{\infty}{\expo{tx} - 1 \over \expo{2x} - 1}\,\dd x\,\dd t \\[4mm] \stackrel{\expo{-2x}\,\,\, \equiv\ y}{=}\ &\ -\int_{0}^{1}\int_{0}^{1}{1 - y^{-t/2} \over 1 - y}\,\dd x\,\dd t = -\int_{0}^{1}\bracks{\Psi\pars{1 - {t \over 2}} + \gamma}\,\dd t = 2\ln\pars{\Gamma\pars{1/2} \over \Gamma\pars{1}} - \gamma \\[4mm] = &\ \color{#f00}{\ln\pars{\pi} - \gamma} \end{align}

because $\ds{\quad\Gamma\pars{\half} = \pi^{1/2}\quad}$ and $\ds{\quad\Gamma\pars{1} = 1}$.