TITLE: Prove that $2\int_0^\infty \frac{e^x-x-1}{x(e^{2x}-1)} \, \mathrm{d}x =\ln(\pi)-\gamma $
QUESTION [6 upvotes]: 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.

REPLY [3 votes]: $\newcommand{\angles}[1]{\left\langle\,{#1}\,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\Li}[1]{\,\mathrm{Li}_{#1}}
 \newcommand{\ol}[1]{\overline{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\color{#f00}{%
2\int_{0}^{\infty}{\expo{x} - x - 1 \over x\pars{\expo{2x} - 1}}\,\dd x} =
2\int_{0}^{\infty}{\pars{\expo{x} - 1}/x  - 1 \over \expo{2x} - 1}\,\dd x
\end{align}

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}$.