Integrate \(\int_{0}^{\infty} \frac{\mathrm{ln}^{3}(x)}{(1+x^{2})(1+x)^{2}} \mathrm{d} x \)

The following integral was a question on Mathematics Stack Exchange.

\begin{equation}
\int\limits_{0}^{\infty} \frac{\mathrm{ln}^{3}(x)}{(1+x^{2})(1+x)^{2}} \mathrm{d} x
\label{eq:160813a1}
\tag{1}
\end{equation}

As usual, there are multiple clever solutions. However, a user noted that the integral could be evaluated via the Mellin transform but he did not provide any details so I will do it here.

Let us evaluate it via the Mellin transform
\begin{equation}
\mathcal{M}[f(x)](s) = \int\limits_{0}^{\infty} x^{s-1} f(x) \mathrm{d} x
\label{eq:160813a2}
\tag{2}
\end{equation}

where
\begin{equation}
f(x) = \frac{1}{(1+x^{2})(1+x)^{2}} = -\frac{1}{2}\frac{x}{x^{2}+1} + \frac{1}{2}\frac{1}{x+1} + \frac{1}{2}\frac{1}{(x+1)^{2}}
\label{eq:160813a3}
\tag{3}
\end{equation}
via partial fraction expansion.

Applying the Mellin transform, yields
\begin{align}
\mathcal{M}[f(x)](s) & = \int\limits_{0}^{\infty} \frac{x^{s-1}}{(1+x^{2})(1+x)^{2}} \\
& = -\frac{1}{2}\left[\frac{1}{2}\pi\sec\left(\frac{\pi}{2}s\right)\right] + \frac{1}{2}\pi\csc(\pi s) + \frac{1}{2} \mathrm{B}(s,2-s)
\label{eq:160813a4}
\tag{4}
\end{align}

Taking the 3rd derivative of equation \eqref{eq:160813a4} with respect to s and then taking \(\lim s \to 1\) yields
\begin{align}
\int\limits_{0}^{\infty} \frac{\mathrm{ln}^{3}(x)}{(1+x^{2})(1+x)^{2}} \mathrm{d} x & = -\frac{1}{2}\left( -\frac{7}{960} \pi^{4} \right) + \frac{1}{2} \left( -\frac{7}{60} \pi^{4} \right) + \frac{1}{2}0 \\
& = -\frac{7}{128} \pi^{4}
\label{eq:160813a5}
\tag{5}
\end{align}

Let us fill in the details. Handling the beta function first, we have
\begin{equation}
\mathrm{B}(s,2-s) = \frac{\Gamma(s)\Gamma(2-s)}{\Gamma(2)} = \Gamma(s)\Gamma(2-s)
\label{eq:160813a6}
\tag{6}
\end{equation}
To take derivatives, we note that
\begin{equation}
\frac{\mathrm d}{\mathrm d s} \Gamma(s) = \Gamma(s) \psi^{(0)}(s) \quad \mathrm{and} \quad \psi^{(n)}(s) = \frac{\mathrm{d}^{n}}{\mathrm{d} s^{n}} \psi^{(0)}(s)
\end{equation}
Where \(\psi^{(n)}(s)\) is the polygamma function.

Taking the third derivative of equation \eqref{eq:160813a6} and letting \(\lim s \to 1\) equals 0. Here we used
\begin{equation}
\psi^{(0)}(1) = -\gamma \quad \mathrm{and} \quad \psi^{(1)}(1) = \frac{\pi^{2}}{6}
\end{equation}
and fortunately \(\Gamma^{(3)}(s) = -\Gamma^{(3)}(2-s)\) which leads to some cancellations.

Doing the same for the first two terms on the right hand side of equation \eqref{eq:160813a4}, we have to be careful. Each of them individually goes to \(\infty\) as \(\lim s \to 1\) but the \((s-1)^{-4}\) terms in the Laurent expansions about \(s=1\) cancel. Here I used Wolfram Alpha. Doing it with the two terms combined yielded our final answer.

Integrate \(\int_{0}^{\infty} \mathrm{ln}^{2}(x)\,(1+x^{2})^{-1} \mathrm{d} x \)

The following integral was a question on Mathematics Stack Exchange

\begin{equation}
\int\limits_{0}^{\infty} \frac{\mathrm{ln}^{2}(x)}{1+x^{2}} \mathrm{d} x
\label{eq:1608131}
\tag{1}
\end{equation}

Let us evaluate it via the Mellin transform
\begin{equation}
\mathcal{M}[f(x)](s) = \int\limits_{0}^{\infty} x^{s-1} f(x) \mathrm{d} x
\label{eq:1608132}
\tag{2}
\end{equation}

where
\begin{equation}
f(x) = \frac{1}{1+x^{2}}
\label{eq:1608133}
\tag{3}
\end{equation}

Applying the Mellin transform, yields
\begin{equation}
\mathcal{M}[f(x)](s) = \int\limits_{0}^{\infty} \frac{x^{s-1}}{1+x^{2}} \mathrm{d} x = \frac{\pi}{2}\csc\left(\frac{\pi}{2}s\right)
\label{eq:1608134}
\tag{4}
\end{equation}

And thus
\begin{align}
\int\limits_{0}^{\infty} \frac{\mathrm{ln}^{2}(x)}{1+x^{2}} \mathrm{d} x & = \frac{\mathrm{d}^{2}}{\mathrm{d}s^{2}} \int\limits_{0}^{\infty} \frac{x^{s-1}}{1+x^{2}} \mathrm{d} x |_{s=1} \\
& = \frac{\mathrm{d}^{2}}{\mathrm{d}s^{2}} \frac{\pi}{2}\csc\left(\frac{\pi}{2}s\right) |_{s=1} \\
& = \frac{\pi^{3}}{16}[\cos(\pi s) + 3]\csc^{3}\left(\frac{\pi}{2}s\right) |_{s=1} \\
& = \frac{\pi^{3}}{8}
\label{eq:1608135}
\tag{5}
\end{align}

Integrate \(\int_{0}^{1} \frac{\mathrm{ln}^{3}(x)}{1+x} \mathrm{d} x\)

The following integral was a question on Mathematics Stack Exchange

\begin{equation}
\int\limits_{0}^{1} \frac{\mathrm{ln}^{3}(x)}{1+x} \mathrm{d} x
\label{eq:160812a1}
\tag{1}
\end{equation}

We begin with the substitution \(x=\mathrm{e}^{-y}\) so our integral becomes
\begin{equation}
-\int\limits_{0}^{\infty} \frac{y^{3}}{1+\mathrm{e}^{\,y}} \mathrm{d} y
\label{eq:160812a2}
\tag{2}
\end{equation}

This integral is a Mellin transform of the function
\begin{equation}
f(y) = \frac{1}{1+\mathrm{e}^{\,y}}
\label{eq:160812a3}
\tag{3}
\end{equation}
where the Mellin transform is defined as
\begin{equation}
\mathcal{M}[f(x)](s) = \int\limits_{0}^{\infty} x^{s-1} f(x) \mathrm{d} x
\label{eq:160812a4}
\tag{4}
\end{equation}

From Tables of Integral Transforms (Bateman Manuscript) Volume 1, we have
\begin{equation}
\mathcal{M}[(\mathrm{e}^{\alpha x} + 1)^{-1}](s) = \frac{1}{\alpha^{s}} \Gamma(s) (1-2^{1-s}) \zeta(s)
\label{eq:160812a5}
\tag{5}
\end{equation}

With \(s = 4\) and \(\alpha = 1\) we have
\begin{equation}
-\int\limits_{0}^{\infty} \frac{y^{3}}{1+\mathrm{e}^{\,y}} \mathrm{d} y = -\Gamma(4) (1-2^{1-4}) \zeta(4) = -\frac{7\pi^{4}}{120}
\label{eq:160812a6}
\tag{6}
\end{equation}

Thus
\begin{equation}
\int\limits_{0}^{1} \frac{\mathrm{ln}^{3}(x)}{1+x} \mathrm{d} x = -\frac{7\pi^{4}}{120}
\label{eq:160812a7}
\tag{7}
\end{equation}

Addendum

We can rewrite \eqref{eq:160812a5} as
\begin{align}
\mathcal{M}[(\mathrm{e}^{\alpha x} + 1)^{-1}](s) & = \frac{1}{\alpha^{s}} \Gamma(s) (1-2^{1-s}) \zeta(s) \\
& = \frac{1}{\alpha^{s}} \Gamma(s) \eta(s)
\label{eq:160812a8}
\tag{8}
\end{align}
where
\begin{equation}
\eta(s) = (1-2^{1-s}) \zeta(s) = \sum\limits_{n=1}^{\infty} \frac{(-1)^{n-1}}{n^{s}}
\end{equation}
is the Dirichlet eta function, also known as the alternating Riemann zeta function.

Note that for Wolfram Alpha, \(\eta(s)\) defaults to the Dedekind eta function. To obtain the Dirichlet eta function type “dirichlet eta(s)”.

The nth Catalan Number Expressed as a Beta Function

John Cook who blogs here, posted the following expression for the nth Catalan number on one of his twitter accounts

\begin{equation}
C_{n} = \frac{1}{2\pi} \int\limits_{0}^{4} x^{n} \sqrt{\frac{4-x}{x}} \mathrm{d} x
\label{eq:1608121}
\tag{1}
\end{equation}

Let us express this as a Beta function
\begin{align}
\int\limits_{0}^{4} x^{n} \sqrt{\frac{4-x}{x}} \mathrm{d} x & = x^{n-\frac{1}{2}} (4-x)^{\frac{1}{2}} \mathrm{d} x \\
& = 4^{n+1} \int\limits_{0}^{1} y^{n-\frac{1}{2}} (1-y)^{\frac{1}{2}} \mathrm{d} y \\
& = 4^{n+1} \, \mathrm{B}\left(n + \frac{1}{2}, \frac{3}{2} \right)
\label{eq:1608122}
\tag{2}
\end{align}
We used the substitution \(y=\frac{x}{4}\).

Now we have
\begin{equation}
C_{n} = \frac{1}{2\pi} \int\limits_{0}^{4} x^{n} \sqrt{\frac{4-x}{x}} \mathrm{d} x = \frac{2^{2n+1}}{\pi} \mathrm{B}\left(n + \frac{1}{2}, \frac{3}{2} \right)
\label{eq:1608123}
\tag{3}
\end{equation}

We will check this by using the following definition of the nth Catalan number
\begin{equation}
C_{n} = \frac{(2n)!}{(n+1)! \, n!}
\label{eq:1608124}
\tag{4}
\end{equation}

Using the following Gamma function expressions
\begin{equation}
\Gamma(n+1) = n\Gamma(n), \quad
\Gamma\left(\frac{3}{2}\right) = \frac{\sqrt{\pi}}{2}, \quad
\Gamma\left(n + \frac{1}{2}\right) = \frac{(2n)!\sqrt{\pi}}{4^{n}n!}
\end{equation}

We have
\begin{align}
\frac{2^{2n+1}}{\pi} \mathrm{B}\left(n + \frac{1}{2}, \frac{3}{2} \right) & = \frac{2^{2n+1}}{\pi} \frac{\Gamma\left(n + \frac{1}{2}\right) \Gamma\left(\frac{3}{2}\right)}{\Gamma(n+2)} \\
& = \frac{2^{2n+1}}{\pi} \frac{(2n)!\sqrt{\pi}}{2^{2n}n!} \frac{\sqrt{\pi}}{2} \frac{1}{(n+1)!} \\
& = \frac{(2n)!}{(n+1)! \, n!}
\label{eq:1608125}
\tag{5}
\end{align}
thus equation \eqref{eq:1608123} is correct.

Derivation of Beta Function Expressions

In this post, I will derive some basic expressions of the beta function. I will follow the equation numbering of Higher Transcendental Functions (Bateman Manuscript), Volume 1, page 9 (print), page 35 (pdf).

We begin with the basic integral definition of the beta function

\begin{equation}
\mathrm{B}(x,y) = \int\limits^{1}_{0} t^{x-1} (1-t)^{y-1} \mathrm{d} t
\quad \mathrm{for} \,\, \mathrm{Re} \, x > 0 \,\, \mathrm{and} \,\, \mathrm{Re} \, y > 0
\label{eq:bf1}
\tag{1}
\end{equation}

\begin{equation}
\mathrm{B}(x,y) = \int\limits_{0}^{\infty} \frac{v^{x-1}}{(1+v)^{x+y}} \mathrm{d} v
\quad \mathrm{for} \,\, \mathrm{Re} \, x > 0 \,\, \mathrm{and} \,\, \mathrm{Re} \, y > 0
\label{eq:bf2}
\tag{2}
\end{equation}

To derive this equation, we begin with \eqref{eq:bf1} and make the substitution

\begin{equation}
t = \frac{v}{1+v}
\end{equation}

to obtain

\begin{equation}
\mathrm{B}(x,y) = \int\limits_{0}^{\infty} \frac{v^{x-1}}{(1+v)^{x-1}} \Big(1 – \frac{v}{1+v}\Big)^{y-1} \frac{1}{(1+v)^{2}} \mathrm{d} v
\end{equation}

simplification yields \eqref{eq:bf2}.

\begin{equation}
\mathrm{B}(x,y) = \int\limits_{0}^{1} \frac{(v^{x-1}+v^{y-1})}{(1+v)^{x+y}} \mathrm{d} v
\quad \mathrm{for} \,\, \mathrm{Re} \, x > 0 \,\, \mathrm{and} \,\, \mathrm{Re} \, y > 0
\label{eq:bf3}
\tag{3}
\end{equation}

To obtain \eqref{eq:bf3} we begin with \eqref{eq:bf2} and break up the integral

\begin{equation}
\mathrm{B}(x,y) = \int\limits_{0}^{1} \frac{v^{x-1}}{(1+v)^{x+y}} \mathrm{d} v + \int\limits_{1}^{\infty} \frac{v^{x-1}}{(1+v)^{x+y}} \mathrm{d} v
\end{equation}

and designate the last integral as I.

For I, we make the substitution \(w = v^{-1}\)

\begin{equation}
\mathrm{I} = \int\limits_{0}^{1} \frac{1}{w^{x-1}} \frac{w^{x+y}}{(1+w)^{x+y}} \frac{1}{w^{2}} \mathrm{d} w
\end{equation}

Simplifying and then making the substitution for I yields \eqref{eq:bf3}.

\begin{equation}
\mathrm{B}(x,y) = \mathrm{B}(y,x)
\label{eq:bf4}
\tag{4}
\end{equation}

Equation \eqref{eq:bf4} follows directly from equation \eqref{eq:bf3}.

\begin{equation}
\mathrm{B}(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x + y)}
\label{eq:bf5}
\tag{5}
\end{equation}

To derive equation \eqref{eq:bf5}, let us start with the basic integral definition of the gamma function and then make the substitution \(x = at\)

\begin{align}
\Gamma(z) & = \int\limits_{0}^{\infty} x^{z-1} \mathrm{e}^{-x} \mathrm{d} x \\
& = a^{z} \int\limits_{0}^{\infty} t^{z-1} \mathrm{e}^{-at} \mathrm{d} t \\
\end{align}

Rearranging terms yields
\begin{equation}
\frac{1}{a^{z}} = \frac{1}{\Gamma(z)} \int\limits_{0}^{\infty} t^{z-1} \mathrm{e}^{-at} \mathrm{d} t
\end{equation}

and making the substitutions \(z = \alpha + \beta\) and \(a = 1 + v\), we obtain

\begin{equation}
\frac{1}{(1+v)^{\alpha + \beta}} = \frac{1}{\Gamma(\alpha + \beta)} \int\limits_{0}^{\infty} t^{\alpha + \beta – 1} \mathrm{e}^{-(1+v)t} \mathrm{d} t
\end{equation}

Combining this with equation \eqref{eq:bf2}, we have

\begin{align}
\mathrm{B}(\alpha,\beta) & = \frac{1}{\Gamma(\alpha + \beta)} \int\limits_{0}^{\infty} \int\limits_{0}^{\infty} v^{\beta – 1} t^{\alpha + \beta – 1}
\mathrm{e}^{-t} \mathrm{e}^{-vt} \mathrm{d} t \mathrm{d} v \\
& = \frac{1}{\Gamma(\alpha + \beta)} \int\limits_{0}^{\infty} \Big[\int\limits_{0}^{\infty} t^{\alpha – 1} \mathrm{e}^{-t} \mathrm{d} t \Big] t^{\beta} v^{\beta – 1} \mathrm{e}^{-vt} \mathrm{d} v \\
& = \frac{\Gamma(\alpha)}{\Gamma(\alpha + \beta)} \int\limits_{0}^{\infty} t^{\beta} v^{\beta – 1} \mathrm{e}^{-vt} \mathrm{d} v \\
& = \frac{\Gamma(\alpha)\Gamma(\beta)}{\Gamma(\alpha + \beta)} \\
\end{align}

\begin{equation}
\mathrm{B}(x,y+1) = \frac{y}{x}\mathrm{B}(x+1,y) = \frac{y}{x+y}\mathrm{B}(x,y)
\label{eq:bf6}
\tag{6}
\end{equation}

To derive equation \eqref{eq:bf6}, use \eqref{eq:bf5} to convert the beta functions into gamma functions and use

\begin{equation}
\Gamma(z+1) = z\Gamma(z)
\end{equation}

\begin{align}
\mathrm{B}(x,y+1) & = \frac{\Gamma(x)\Gamma(y+1)}{\Gamma(x+y+1)} \\
& = \frac{y\Gamma(x)\Gamma(y)}{(x+y)\Gamma(x+y)} \\
& = \frac{y\mathrm{B}(x,y)}{x+y} \\
\end{align}

\begin{align}
\mathrm{B}(x+1,y) & = \frac{\Gamma(x+1)\Gamma(y)}{\Gamma(x+y+1)} \\
& = \frac{x\Gamma(x)\Gamma(y)}{(x+y)\Gamma(x+y)} \\
& = \frac{y\mathrm{B}(x,y)}{x+y} \\
\end{align}

\begin{equation}
\mathrm{B}(x,y)\mathrm{B}(x+y,z) = \mathrm{B}(y,z)\mathrm{B}(y+z,x) = \mathrm{B}(z,x)\mathrm{B}(x+z,y)
\label{eq:bf7}
\tag{7}
\end{equation}

For equation \eqref{eq:bf7} we convert the beta functions to gamma functions.
\begin{align}
\mathrm{B}(x,y)\mathrm{B}(x+y,z) & = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x + y)} \times \frac{\Gamma(x + y)\Gamma(z)}{\Gamma(x + y + z)} \times
\frac{\Gamma(y + z)}{\Gamma(y + z)} \\
& = \frac{\Gamma(y)\Gamma(z)}{\Gamma(y + z)} \times \frac{\Gamma(y + z)\Gamma(x)}{\Gamma(x + y + z)} \\
& = \mathrm{B}(y,z)\mathrm{B}(y+z,x) \\
\end{align}

\begin{align}
\mathrm{B}(x,y)\mathrm{B}(x+y,z) & = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x + y)} \times \frac{\Gamma(x + y)\Gamma(z)}{\Gamma(x + y + z)} \times
\frac{\Gamma(x + z)}{\Gamma(x + z)} \\
& = \frac{\Gamma(z)\Gamma(x)}{\Gamma(z + x)} \times \frac{\Gamma(x + z)\Gamma(y)}{\Gamma(x + y + z)} \\
& = \mathrm{B}(z,x)\mathrm{B}(x+z,y) \\
\end{align}

\begin{equation}
\mathrm{B}(x,y)\mathrm{B}(x+y,z)\mathrm{B}(x+y+z,u) = \frac{\Gamma(x)\Gamma(y)\Gamma(z)\Gamma(u)}{\Gamma(x + y + z + u)}
\label{eq:bf8}
\tag{8}
\end{equation}

Here, we use equation \eqref{eq:bf5}
\begin{equation}
\mathrm{B}(x,y)\mathrm{B}(x+y,z)\mathrm{B}(x+y+z,u) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x + y} \times \frac{\Gamma(x+y)\Gamma(z)}{\Gamma(x + y + z} \times \frac{\Gamma(x+y+z)\Gamma(u)}{\Gamma(x + y + z + u}
\end{equation}
The generalization of equation \eqref{eq:bf8} is evident.

\begin{equation}
\frac{1}{\mathrm{B}(n,m)} = m \binom{n+m-1}{n-1} = n \binom{n+m-1}{m-1} \,\, \mathrm{for} \,\, n,m \in \mathbb{Z}^{+}
\label{eq:bf9}
\tag{9}
\end{equation}

We use the following relationships and then invoke equation \eqref{eq:bf5}

\begin{equation}
n! = \Gamma(n+1), \quad n! = n(n-1)!, \quad \binom{n}{k} = \frac{n!}{k!(n-k)!}
\end{equation}

\begin{equation}
\frac{1}{\mathrm{B}(n,m)} = \frac{\Gamma(n + m)}{\Gamma(n)\Gamma(m)} = \frac{(n + m – 1)!}{(n – 1)!(m – 1)!} =
m\frac{(n + m – 1)!}{m!(n – 1)!} = m \binom{n+m-1}{n-1}
\end{equation}

We can do the same for the last part of equation \eqref{eq:bf9}.

Additional information about the beta function can be found at the following online references

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.

A Clever Integration Trick

This trick is from Integration for Engineers and Scientists by William Squire via The Handbook of Integration by Daniel Zwillinger.

Noting that
\begin{equation}
\frac{1}{x} = \int\limits_{0}^{\infty} \mathrm{e}^{-xt} \mathrm{d} t
\end{equation}
we can replace \(\frac{1}{x}\) in an integrand with its integral expression and reverse the order of integration to simplify evaluation of the integrals. Of course the integral must converge uniformly to allow us to reverse the order of integration and we must have \(t>0\).

Let us use this trick to evaluate
\begin{equation}
\int\limits_{0}^{\infty} \frac{\mathrm{e}^{-ax}-\mathrm{e}^{-bx}}{x} \mathrm{d} x
\end{equation}
for \(a,b > 0\).
Using our trick yields
\begin{align}
\int\limits_{0}^{\infty} \frac{\mathrm{e}^{-ax}-\mathrm{e}^{-bx}}{x} \mathrm{d} x & = \int\limits_{0}^{\infty}\int\limits_{0}^{\infty} \mathrm{e}^{-xt} (\mathrm{e}^{-ax}-\mathrm{e}^{-bx}) \mathrm{d} t \mathrm{d} x \\
& = \int\limits_{0}^{\infty}\int\limits_{0}^{\infty} \mathrm{e}^{-(a+t)x}-\mathrm{e}^{-(b+t)x} \mathrm{d} x \mathrm{d} t \\
& = -\int\limits_{0}^{\infty} \frac{\mathrm{e}^{-(a+t)x}}{a+t} – \frac{\mathrm{e}^{-(b+t)x}}{b+t} |_{0}^{\infty} \mathrm{d} t \\
& = \int\limits_{0}^{\infty} \frac{1}{a+t} – \frac{1}{b+t} \mathrm{d} t \\
& = \lim_{R \to \infty} \mathrm{ln}\frac{a+t}{b+t} |_{0}^{R} \\
& = \mathrm{ln}\left(\frac{b}{a}\right)
\end{align}

The conventional way to handle this integral is to recognize that it is the Frullani integral
\begin{equation}
\int\limits_{0}^{\infty} \frac{f(ax) – f(bx)}{x} \mathrm{d} x = [f(\infty) – f(0)]\mathrm{ln}\left(\frac{a}{b}\right)
\end{equation}
A simple substitution yields our result.

For the Frullani integral, we must have the existence of \(f(\infty)\) and \(f(0)\) using the appropriate limits. For other conditions on the integral as well as proofs, see

  1. On Cauchy-Frullani Integrals by A. M. Ostrowski. Use DOI 10.1007/BF02568143 with Sci-Hub to access the paper.
  2. On the Theorem of Frullani by Juan Arias-De-Reyna. Use DOI 10.2307/2048376 with Sci-Hub to access the paper.

Integrate \(\int_{0}^{\infty} \frac{\mathrm{ln}(x^{2}+a^{2})}{x^{2}+b^{2}} \mathrm{d} x\)

For \(a,b > 0\),

\begin{equation}
\int\limits_{0}^{\infty} \frac{\mathrm{ln}(x^{2}+a^{2})}{x^{2}+b^{2}} \mathrm{d} x = \frac{\pi}{b} \mathrm{ln}(a+b)
\label{eq:160806a1}
\tag{1}
\end{equation}

appeared on page 52 of Rediscovery of Malmsten’s integrals, their evaluation by contour integration methods and some related results by Iaroslav V. Blagouchine. This is a fascinating paper with many interesting results. In future blog posts, I will present some of Blagouchine’s results and solve some of the exercise problems that he proposed. For now, I will do this integral mainly to highlight a common trick used to evaluate contour integrals with logarithms of binomials.

The trick is to begin with a different integrand
\begin{equation}
f(z) = \frac{\mathrm{ln}(z+ia)}{z^{2}+b^{2}} = \frac{\mathrm{ln}(z+ia)}{(z-ib)(z+ib)}
\label{eq:160806a2}
\tag{2}
\end{equation}

Using the following contour

semi circle contour with pole on im axis

 

we note that a first order pole at \(z=ib\) is inside of the contour so we have
\begin{equation}
Res_{z=ib}[f(z)] = \frac{\mathrm{ln}(ib+ia)}{i2b} = \frac{\mathrm{ln}(i)+\mathrm{ln}(a+b)}{i2b} = \frac{i\frac{\pi}{2}+\mathrm{ln}(a+b)}{i2b}
\label{eq:160806a3}
\tag{3}
\end{equation}

\begin{align}
\oint\limits_{C} f(z) \mathrm{d} z & = i2\pi Res_{z=ib}[f(z)] = \frac{i\pi^{2}}{2b} + \frac{\pi}{b}\mathrm{ln}(a+b) \\
& = \lim_{R \to \infty} \int\limits_{-R}^{R} f(x) \mathrm{d} x + \int\limits_{C_{1}} f(z) \mathrm{d} z
\label{eq:160806a4}
\tag{4}
\end{align}

The second integral goes to 0 via the ML estimate. The first integral will be broken in half and we use the substitution \(y=-x\) to obtain
\begin{equation}
\int\limits_{-\infty}^{0} \frac{\mathrm{ln}(x+ia)}{x^{2}+b^{2}} \mathrm{d} x = \int\limits_{0}^{\infty} \frac{\mathrm{ln}(-y+ia)}{y^{2}+b^{2}} \mathrm{d} y
\label{eq:160806a5}
\tag{5}
\end{equation}

Adding the two halves of the integral together, we have the following in the numerator
\begin{equation}
\mathrm{ln}(-x+ia) + \mathrm{ln}(x+ia) = i\pi + \mathrm{ln}(x-ia) + \mathrm{ln}(x+ia) = \mathrm{ln}(x^{2}+a^{2})
\end{equation}

Now we have
\begin{equation}
\oint\limits_{C} f(z) \mathrm{d} z = \int\limits_{0}^{\infty} \frac{\mathrm{ln}(x^{2}+a^{2})}{x^{2}+b^{2}} \mathrm{d} x +
i\pi \int\limits_{0}^{\infty} \frac{1}{x^{2}+b^{2}} \mathrm{d} x
\label{eq:160806a6}
\tag{6}
\end{equation}

Equating real and imaginary parts of equations \eqref{eq:160806a6} and \eqref{eq:160806a4} yields our original result plus a bonus integral
\begin{equation}\int\limits_{0}^{\infty} \frac{1}{x^{2}+b^{2}} \mathrm{d} x = \frac{\pi}{2b}
\end{equation}
which we could have obtained via the inverse tangent function.

Note that the trick allowed the limits of the integral to work out with the semi circular contour and we recovered the original integrand. This is a standard trick but surprisingly I have read some complex analysis texts that do not cover it.

A Laplace Transform Proof of \(\mathrm{B}(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}\)

This proof appeared in Irresistible Integrals: Symbolics, Analysis and Experiments in the Evaluation of Integrals by George Boros and Victor Moll. Here, I fill in the steps of the proof.

We begin with 3 fundamental results of the Laplace transform: the basic definition, convolution, and the Laplace transform of a convolution.

\begin{equation}
\mathcal{L}[f(t)](s) = \int\limits_{0}^{\infty} \mathrm{e}^{-st} f(t) \mathrm{d} t
\label{eq:1608061}
\tag{1}
\end{equation}

\begin{equation}
(f*g)(t) = \int\limits_{0}^{t} f(\tau) g(t-\tau) \mathrm{d} \tau
\label{eq:1608062}
\tag{2}
\end{equation}

\begin{equation}
\mathcal{L}[f*g] = \mathcal{L}[f]\mathcal{L}[g]
\label{eq:1608063}
\tag{3}
\end{equation}

We begin with the following two functions
\begin{equation}
f(t) = t^{x-1} \quad \mathrm{and} \quad g(t) = t^{y-1}
\label{eq:1608064}
\tag{4}
\end{equation}

These functions were chosen for two reasons. First, they appear in the basic integral definition of the beta function
\begin{equation}
\mathrm{B}(x,y) = \int\limits_{0}^{1} t^{x-1} (1-t)^{y-1} \mathrm{d} t
\label{eq:1608065}
\tag{5}
\end{equation}
and, as we now show, their Laplace transforms result in gamma functions
\begin{align}
\mathcal{L}[f(t)] & = \mathcal{L}[t^{x-1}] = \int\limits_{0}^{\infty} \mathrm{e}^{-st} t^{x-1} \mathrm{d} t \\
& = \frac{1}{s^{x}} \int\limits_{0}^{\infty} \mathrm{e}^{-v} v^{x-1} \mathrm{d} v \\
& = \frac{\Gamma(x)}{s^{x}}
\label{eq:1608066}
\tag{6}
\end{align}
where we have used the substitution \(v = st\). Likewise, taking the Laplace transform of \(g(t)\) yields,
\begin{equation}
\mathcal{L}[g(t)] = \mathcal{L}[t^{y-1}] = \frac{\Gamma(y)}{s^{y}}
\label{eq:1608067}
\tag{7}
\end{equation}

Now we substitute equations \eqref{eq:1608067}, \eqref{eq:1608066}, and \eqref{eq:1608062} into \eqref{eq:1608063}
\begin{equation}
\frac{\Gamma(x)}{s^{x}} \frac{\Gamma(y)}{s^{y}} = \mathcal{L}\left[\int\limits_{0}^{t} \tau^{x-1} (t – \tau)^{y-1} \mathrm{d} \tau \right]
\label{eq:1608068}
\tag{8}
\end{equation}

To evaluate the integral, we let \(\tau = tu\)
\begin{align}
\int\limits_{0}^{t} \tau^{x-1} (t – \tau)^{y-1} \mathrm{d} \tau & = t^{x+y-1} \int\limits_{0}^{1} u^{x-1} (1 – u)^{y-1} \mathrm{d} u \\
& = t^{x+y-1} \mathrm{B}(x,y)
\label{eq:1608069}
\tag{9}
\end{align}

Thus, we have
\begin{align}
\mathcal{L}[t^{x+y-1} \mathrm{B}(x,y)] & = \frac{\Gamma(x)}{s^{x}} \frac{\Gamma(y)}{s^{y}} \\
& = \mathrm{B}(x,y) \int\limits_{0}^{\infty} \mathrm{e}^{-st} t^{x+y-1} \mathrm{d} t \\
& = \mathrm{B}(x,y) \frac{1}{s^{x+y}} \int\limits_{0}^{\infty} \mathrm{e}^{-v} v^{x+y-1} \mathrm{d} v \\
& = \mathrm{B}(x,y) \frac{\Gamma(x+y)}{s^{x+y}}
\label{eq:16080610}
\tag{10}
\end{align}

Combining the first and last results from the right hand side of the above equation yields our final result
\begin{equation}
\mathrm{B}(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}
\end{equation}

A Derivation of the Beta Function Representation \(\mathrm{B}(x,y) = 2^{1-x-y} \int_{0}^{1} (1+t)^{x-1}(1-t)^{y-1} + (1+t)^{y-1}(1-t)^{x-1} \mathrm{d} t\)

I used the beta function representation

\begin{equation}
\mathrm{B}(x,y) = 2^{1-x-y} \int\limits_{0}^{1} (1+t)^{x-1}(1-t)^{y-1} + (1+t)^{y-1}(1-t)^{x-1} \mathrm{d} t
\label{eq:1608051}
\tag{1}
\end{equation}

here to evaluate an integral. Now I will derive this result.

We begin with the basic integral definition of the beta function

\begin{equation}
\mathrm{B}(x,y) = \int\limits^{1}_{0} t^{x-1} (1-t)^{y-1} \mathrm{d} t
\label{eq:1608052}
\tag{2}
\end{equation}

then use the substitution \(t = \frac{z-a}{b-a}\), this yields

\begin{align}
\mathrm{B}(x,y) & = \frac{1}{b-a} \int\limits^{b}_{a} \left(\frac{z-a}{b-a}\right)^{x-1} \left(\frac{b-z}{b-a}\right)^{y-1} \mathrm{d} z \\
& = (b-a)^{-x-y+1} \int\limits^{b}_{a} (z-a)^{x-1} (b-z)^{y-1} \mathrm{d} z \\
& = 2^{-x-y+1} \int\limits_{-1}^{1} (z+1)^{x-1} (1-z)^{y-1} \mathrm{d} z \\
& = 2^{-x-y+1} \left[ \int\limits_{-1}^{0} (z+1)^{x-1} (1-z)^{y-1} \mathrm{d} z + \int\limits_{0}^{1} (z+1)^{x-1} (1-z)^{y-1} \mathrm{d} z \right]
\label{eq:1608053}
\tag{3}
\end{align}

Note that we let \(a=-1\) and \(b=1\).

For the rightmost integral, we let \(z=-w\) so that

\begin{equation}
\int\limits_{0}^{1} (z+1)^{x-1} (1-z)^{y-1} \mathrm{d} z = \int\limits_{0}^{1} (1-w)^{x-1} (1+w)^{y-1} \mathrm{d} w
\label{eq:1608054}
\tag{4}
\end{equation}

Substituting equation \eqref{eq:1608054} into equation \eqref{eq:1608053} yields equation \eqref{eq:1608051}.

The original substitution, \(t = \frac{z-a}{b-a}\) is a useful method of transforming the limits of integration from 0 to 1 into a to b.