Evaluate the Integral \(\int_{0}^{\infty} \frac{\ln(x)}{1+e^{ax}} \mathrm{d}x\)

How to evaluate

\begin{equation}
I = \int\limits_{0}^{\infty} \frac{\ln(x)}{1+e^{ax}} \mathrm{d}x
\tag{1}
\label{eq:161008-1}
\end{equation}
was a question posed at Mathematics Stack Exchange. As of the time of writing this post, there was a good solution posted there. Here is my solution.

Let
\begin{align}
I_{1} &= \int\limits_{0}^{\infty} \frac{x^{b}}{1+e^{ax}} \mathrm{d}x = \int\limits_{0}^{\infty} \frac{x^{b}e^{-ax}}{1+e^{-ax}} \mathrm{d}x \\
&= \sum\limits_{n=0}^{\infty} (-1)^{n} \int\limits_{0}^{\infty} x^{b} e^{-(a+na)x} \mathrm{d}x
\end{align}

We designate the last integral on the right as \(I_{2}\) and make the substitution \(y=(a+na)x\)
\begin{align}
I_{2} &= \int\limits_{0}^{\infty} x^{b} e^{-(a+na)x} \mathrm{d}x \\
&= \frac{1}{(a+na)^{b+1}} \int\limits_{0}^{\infty} y^{b} e^{-y} \mathrm{d}y \\
&= \frac{\Gamma(b+1)}{(a+na)^{b+1}} \\
&= \frac{\Gamma(b+1)}{a^{b+1}} \frac{1}{(n+1)^{b+1}}
\end{align}

Now \(I_{1}\) becomes
\begin{equation}
I_{1} = \frac{\Gamma(b+1)}{a^{b+1}} \sum\limits_{n=0}^{\infty} (-1)^{n} \frac{1}{(n+1)^{b+1}} = \frac{\Gamma(b+1)}{a^{b+1}} \eta(b+1)
\end{equation}
and we have
\begin{align}
I &= \lim_{b \to 0} \frac{\partial I_{1}}{\partial b} = \lim_{b \to 0} \int\limits_{0}^{\infty} \frac{x^{b} \ln(x)}{1+e^{ax}} \mathrm{d}x \\
&= \lim_{b \to 0} \frac{\partial}{\partial b} \frac{\Gamma(b+1)\eta(b+1)}{a^{b+1}} \\
&= \lim_{b \to 0} \frac{a^{b+1} \Big[ \Gamma(b+1)\eta^{\prime}(b+1) + \Gamma^{\prime}(b+1)\eta(b+1) \Big] – \Gamma(b+1)\eta(b+1)a^{b+1}\ln(a)}{\left(a^{b+1}\right)^{2}} \\
&= \lim_{b \to 0} \frac{\Gamma(b+1)\eta^{\prime}(b+1) + \Gamma^{\prime}(b+1)\eta(b+1) – \Gamma(b+1)\eta(b+1)\ln(a)}{a^{b+1}} \\
\tag{a}
&= \frac{1}{a} \left(\Big[\gamma \ln(2) – \frac{1}{2} \ln^{2}(2)\Big] -\gamma \ln(2) – \ln(2)\ln(a) \right) \\
&= -\frac{\ln(2)}{a} \left(\frac{1}{2} \ln(2) + \ln(a) \right)
\end{align}

In step (a) we have
\begin{align}
\lim_{b \to 0} \Gamma^{\prime}(b+1)\eta(b+1) &= \lim_{b \to 0} \Gamma^(b+1)\psi(b+1)\eta(b+1) \\
&= \Gamma(1)\psi(1)\eta(1) \\
&= -\gamma \ln(2)
\end{align}
and
\begin{align}
\lim_{b \to 0} \Gamma(b+1)\eta^{\prime}(b+1) &= \lim_{s \to 1} \eta^{\prime}(s) \\
&= \lim_{s \to 1} \sum\limits_{n=0}^{\infty} (-1)^{n} \frac{\ln(n)}{n^{s}} \\
&= \gamma \ln(2) – \frac{1}{2} \ln^{2}(2)
\end{align}
See here for a proof of this result.

Notes:

  1. \(\Gamma(z)\) is the Gamma function.
  2. \(\eta(s)\) is the Dirichlet eta function.
  3. \(\zeta(s)\) is the Riemann zeta function.
  4. \(\psi(z)\) is the digamma function.
  5. \(\gamma\) is the Euler-Mascheroni constant.

Derivation of an Integral Expression of the Euler-Mascheroni Constant – Part 2

I derived the expression
\begin{equation}
\int\limits_{0}^{\infty} \mathrm{e}^{-x} \mathrm{ln}(x) \mathrm{d} x = -\gamma
\label{eq:1608161}
\tag{1}
\end{equation}
for the Euler-Mascheroni constant here. However, there is a far easier method that was fully derived in Advanced Integration Techniques by Zaid Alyafeai. I recommend this book to readers of this blog. It is free and contains many useful and interesting results.

We start with
\begin{equation}
\int\limits_{0}^{\infty} \mathrm{e}^{-x} x^t \mathrm{d} x = \Gamma(t+1)
\label{eq:1608162}
\tag{2}
\end{equation}
Differentiate with respect to \(t\)
\begin{equation}
\int\limits_{0}^{\infty} \mathrm{e}^{-x} x^t \mathrm{ln}(x) \mathrm{d} x = \frac{d\Gamma(t+1)}{dt} = \Gamma(t+1) \psi^{(0)}(t+1)
\label{eq:1608163}
\tag{3}
\end{equation}

Taking the limit of equation \eqref{eq:1608163}, \(t \to 0\) yields
\begin{equation}
\int\limits_{0}^{\infty} \mathrm{e}^{-x} \mathrm{ln}(x) \mathrm{d} x = \Gamma(1) \psi^{(0)}(1) = -\gamma
\label{eq:1608164}
\tag{4}
\end{equation}

Derivation of an Integral Expression of the Euler-Mascheroni Constant

\begin{equation}
\int\limits_{0}^{\infty} \mathrm{e}^{-x} \mathrm{ln}(x) \mathrm{d} x = -\gamma
\label{eq:1608111}
\tag{1}
\end{equation}

ii boros mollThere are of course an enormous number of integral expressions of the Euler-Mascheroni Constant. This particular expression appeared on the cover of Irresistible Integrals: Symbolics, Analysis and Experiments in the Evaluation of Integrals by George Boros and Victor Moll and was derived in section 9.3 of the book. Here, I will show this derivation and fill in the steps as well as parts that were not shown in the book.

Let us begin by providing a basic definition of the Euler-Mascheroni Constant
\begin{equation}
\gamma := \lim_{n \to \infty} H_{n} – \mathrm{ln}(n)
\label{eq:1608112}
\tag{2}
\end{equation}
where \(H_{n}\) are the harmonic numbers defined as
\begin{equation}
H_{n} = \displaystyle\sum_{k=1}^{n} \frac{1}{k}
\label{eq:1608113}
\tag{3}
\end{equation}

We will break up the derivation into parts to make it easier to follow.

1. Exercise 9.3.1 – Prove
\begin{equation}
\int\limits_{0}^{1} \frac{1-(1-x)^{n}}{x} \mathrm{d} x = H_{n}
\label{eq:1608114}
\tag{4}
\end{equation}

\begin{align}
\label{eq:1608115}
\tag{5}
\int\limits_{0}^{1} \frac{1-(1-x)^{n}}{x} \mathrm{d} x & = \int\limits_{0}^{1} \frac{1-y^{n}}{1-y} \mathrm{d} y \\
& = \int\limits_{0}^{1} \frac{1}{1-y} \mathrm{d} y \, – \int\limits_{0}^{1} \frac{y^{n}}{1-y} \mathrm{d} y \\
& = \int\limits_{0}^{1} \displaystyle\sum_{k=0}^{\infty} y^{k} \mathrm{d} y \,\, – \int\limits_{0}^{1} y^{n} \displaystyle\sum_{k=0}^{\infty} y^{k} \mathrm{d} y \\
& = \displaystyle\sum_{k=0}^{\infty} \frac{y^{k+1}}{k+1} \big|_{0}^{1} \,\, – \displaystyle\sum_{k=0}^{\infty} \frac{y^{k+n+1}}{k+n+1} \big|_{0}^{1} \\
& = (1 + \frac{1}{2} + \frac{1}{3} + \dots) \, – (\frac{1}{n+1} + \frac{1}{n+2} +\frac{1}{n+3} + \dots) \\
& = 1 + \frac{1}{2} + \frac{1}{3} + \dots + \frac{1}{n} = H_{n}
\end{align}

Notes:

  • \(|x| < 1\)
  • Let \(y=1-x\)
  • Expand \(1/(1-y)\) as a geometric series \begin{equation} \frac{1}{1-y} = \displaystyle\sum_{k=0}^{\infty} y^{k} \end{equation}
  • The integrals are improper, we have dropped the limits for clarity.
  • We assumed that the integrals converged uniformly so that we could integrate term by term. We acknowledge that this should be proven, but the assumption is warranted based on the form of the integrand and experience.

2. Proposition 9.3.1 – The Euler constant is given by
\begin{equation}
\gamma = \int\limits_{0}^{1} \frac{1-\mathrm{e}^{-x}}{x} \mathrm{d} x \,\, – \int\limits_{1}^{\infty} \frac{\mathrm{e}^{-x}}{x} \mathrm{d} x
\label{eq:1608116}
\tag{6}
\end{equation}
The proof in the book is fairly straightforward but there are some missing steps.

Make the substitution \(x = \frac{y}{n}\) in \eqref{eq:1608114} to obtain
\begin{align}
H_{n} & = \int\limits_{0}^{n} \frac{1-(1-\frac{y}{n})^{n}}{y} \mathrm{d} y \\
& = \int\limits_{0}^{1} \frac{1-(1-\frac{y}{n})^{n}}{y} \mathrm{d} y \,\, + \int\limits_{1}^{n} \frac{1-(1-\frac{y}{n})^{n}}{y} \mathrm{d} y \\
& = \int\limits_{0}^{1} \frac{1-(1-\frac{y}{n})^{n}}{y} \mathrm{d} y \,\, + \int\limits_{1}^{n} \frac{1}{y} \mathrm{d} y \,\, – \int\limits_{1}^{n} \frac{(1-\frac{y}{n})^{n}}{y} \mathrm{d} y \\
& = \int\limits_{0}^{1} \frac{1-(1-\frac{y}{n})^{n}}{y} \mathrm{d} y \,\, + \mathrm{ln}(n) \, – \int\limits_{1}^{n} \frac{(1-\frac{y}{n})^{n}}{y} \mathrm{d} y
\label{eq:1608117}
\tag{7}
\end{align}

Applying \(\lim n \to \infty\) to equation \eqref{eq:1608117}, noting the limit definition of
\begin{equation}
\mathrm{e}^{\pm x} = \lim_{n \to \infty} \left(1 \pm \frac{x}{n} \right)^{n}
\end{equation}
and invoking equation \eqref{eq:1608112} yields our result.

3. Proposition 9.3.2 – Euler’s constant is given by equation \eqref{eq:1608111}.

Here we require one obvious alteration of the integral in light of \eqref{eq:1608117} and a non obvious trick.

\begin{equation}
\int\limits_{0}^{\infty} \mathrm{e}^{-x} \mathrm{ln}(x) \mathrm{d} x = \int\limits_{0}^{1} \mathrm{e}^{-x} \mathrm{ln}(x) \mathrm{d} x + \int\limits_{1}^{\infty} \mathrm{e}^{-x} \mathrm{ln}(x) \mathrm{d} x = \mathrm{I}_{1} + \mathrm{I}_{2}
\label{eq:1608118}
\tag{8}
\end{equation}

Integrating \(\mathrm{I}_{2}\) by parts and applying the appropriate limit yields
\begin{equation}
\mathrm{I}_{2} = \int\limits_{1}^{\infty} \frac{\mathrm{e}^{-x}}{x} \mathrm{d} x
\label{eq:1608119}
\tag{9}
\end{equation}

For \(\mathrm{I}_{1}\) use the substitution
\begin{equation}
\mathrm{e}^{-x} = -\frac{\mathrm d}{\mathrm d x} (\mathrm{e}^{-x} – 1),
\end{equation}
integrate by parts and apply the appropriate limit to obtain
\begin{equation}
\mathrm{I}_{1} = -\int\limits_{0}^{1} \frac{\mathrm{e}^{-x} – 1}{x} \mathrm{d} x
\label{eq:16081110}
\tag{10}
\end{equation}
Substituting equations \eqref{eq:16081110} and \eqref{eq:1608119} into \eqref{eq:1608118} and using \eqref{eq:1608116} yields our final result.