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.

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

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

\mathcal{M}[f(x)](s) = \int\limits_{0}^{\infty} x^{s-1} f(x) \mathrm{d} x
\label{eq:160813a2}
\tag{2}

where

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}

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

\mathrm{B}(s,2-s) = \frac{\Gamma(s)\Gamma(2-s)}{\Gamma(2)} = \Gamma(s)\Gamma(2-s)
\label{eq:160813a6}
\tag{6}

To take derivatives, we note that

\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)

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

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

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

Let us evaluate it via the Mellin transform

\mathcal{M}[f(x)](s) = \int\limits_{0}^{\infty} x^{s-1} f(x) \mathrm{d} x
\label{eq:1608132}
\tag{2}

where

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

Applying the Mellin transform, yields

\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}

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

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

We begin with the substitution $$x=\mathrm{e}^{-y}$$ so our integral becomes

-\int\limits_{0}^{\infty} \frac{y^{3}}{1+\mathrm{e}^{\,y}} \mathrm{d} y
\label{eq:160812a2}
\tag{2}

This integral is a Mellin transform of the function

f(y) = \frac{1}{1+\mathrm{e}^{\,y}}
\label{eq:160812a3}
\tag{3}

where the Mellin transform is defined as

\mathcal{M}[f(x)](s) = \int\limits_{0}^{\infty} x^{s-1} f(x) \mathrm{d} x
\label{eq:160812a4}
\tag{4}

From Tables of Integral Transforms (Bateman Manuscript) Volume 1, we have

\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}

With $$s = 4$$ and $$\alpha = 1$$ we have

-\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}

Thus

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

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

\eta(s) = (1-2^{1-s}) \zeta(s) = \sum\limits_{n=1}^{\infty} \frac{(-1)^{n-1}}{n^{s}}

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

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}

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

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}

We will check this by using the following definition of the nth Catalan number

C_{n} = \frac{(2n)!}{(n+1)! \, n!}
\label{eq:1608124}
\tag{4}

Using the following Gamma function expressions

\Gamma\left(n + \frac{1}{2}\right) = \frac{(2n)!\sqrt{\pi}}{4^{n}n!}

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

\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}

\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}

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

t = \frac{v}{1+v}

to obtain

\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

simplification yields \eqref{eq:bf2}.

\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}

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

\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

and designate the last integral as I.

For I, we make the substitution $$w = v^{-1}$$

\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

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

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

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

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

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

\frac{1}{a^{z}} = \frac{1}{\Gamma(z)} \int\limits_{0}^{\infty} t^{z-1} \mathrm{e}^{-at} \mathrm{d} t

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

\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

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}

\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}

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

\Gamma(z+1) = z\Gamma(z)

\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}

\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}

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}

\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}

Here, we use equation \eqref{eq:bf5}

\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}

The generalization of equation \eqref{eq:bf8} is evident.

\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}

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

\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}

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

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

There 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

\gamma := \lim_{n \to \infty} H_{n} – \mathrm{ln}(n)
\label{eq:1608112}
\tag{2}

where $$H_{n}$$ are the harmonic numbers defined as

H_{n} = \displaystyle\sum_{k=1}^{n} \frac{1}{k}
\label{eq:1608113}
\tag{3}

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

1. Exercise 9.3.1 – Prove

\int\limits_{0}^{1} \frac{1-(1-x)^{n}}{x} \mathrm{d} x = H_{n}
\label{eq:1608114}
\tag{4}

\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 $$\frac{1}{1-y} = \displaystyle\sum_{k=0}^{\infty} y^{k}$$
• 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

\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}

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

\mathrm{e}^{\pm x} = \lim_{n \to \infty} \left(1 \pm \frac{x}{n} \right)^{n}

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.

\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}

Integrating $$\mathrm{I}_{2}$$ by parts and applying the appropriate limit yields

\mathrm{I}_{2} = \int\limits_{1}^{\infty} \frac{\mathrm{e}^{-x}}{x} \mathrm{d} x
\label{eq:1608119}
\tag{9}

For $$\mathrm{I}_{1}$$ use the substitution

\mathrm{e}^{-x} = -\frac{\mathrm d}{\mathrm d x} (\mathrm{e}^{-x} – 1),

integrate by parts and apply the appropriate limit to obtain

\mathrm{I}_{1} = -\int\limits_{0}^{1} \frac{\mathrm{e}^{-x} – 1}{x} \mathrm{d} x
\label{eq:16081110}
\tag{10}

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

\frac{1}{x} = \int\limits_{0}^{\infty} \mathrm{e}^{-xt} \mathrm{d} t

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

\int\limits_{0}^{\infty} \frac{\mathrm{e}^{-ax}-\mathrm{e}^{-bx}}{x} \mathrm{d} x

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

\int\limits_{0}^{\infty} \frac{f(ax) – f(bx)}{x} \mathrm{d} x = [f(\infty) – f(0)]\mathrm{ln}\left(\frac{a}{b}\right)

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$$,

\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}

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

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}

Using the following contour

we note that a first order pole at $$z=ib$$ is inside of the contour so we have

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}

\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

\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}

Adding the two halves of the integral together, we have the following in the numerator

\mathrm{ln}(-x+ia) + \mathrm{ln}(x+ia) = i\pi + \mathrm{ln}(x-ia) + \mathrm{ln}(x+ia) = \mathrm{ln}(x^{2}+a^{2})

Now we have

\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}

Equating real and imaginary parts of equations \eqref{eq:160806a6} and \eqref{eq:160806a4} yields our original result plus a bonus integral
\int\limits_{0}^{\infty} \frac{1}{x^{2}+b^{2}} \mathrm{d} x = \frac{\pi}{2b}

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.

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

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

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

We begin with the following two functions

\label{eq:1608064}
\tag{4}

These functions were chosen for two reasons. First, they appear in the basic integral definition of the beta function

\mathrm{B}(x,y) = \int\limits_{0}^{1} t^{x-1} (1-t)^{y-1} \mathrm{d} t
\label{eq:1608065}
\tag{5}

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,

\mathcal{L}[g(t)] = \mathcal{L}[t^{y-1}] = \frac{\Gamma(y)}{s^{y}}
\label{eq:1608067}
\tag{7}

Now we substitute equations \eqref{eq:1608067}, \eqref{eq:1608066}, and \eqref{eq:1608062} into \eqref{eq:1608063}

\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}

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

\mathrm{B}(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}

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

\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}

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

We begin with the basic integral definition of the beta function

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

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

\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}

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.