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

How to evaluate

I = \int\limits_{0}^{\infty} \frac{\ln(x)}{1+e^{ax}} \mathrm{d}x
\tag{1}
\label{eq:161008-1}

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

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)

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.

## Evaluate the Integral $$\int_{-\infty}^{\infty} \frac{\sin(ax)}{\mathrm{e}^{x/2}-\mathrm{e}^{-x/2}}\mathrm{d}x$$

How to prove

I=\int\limits_{-\infty}^{\infty} \frac{\sin(ax)}{\mathrm{e}^{x/2}-\mathrm{e}^{-x/2}}\mathrm{d}x = \pi \tanh(\pi a)
\tag{1}
\label{eq:sinsinh-1}

was a question on Mathematics Stack Exchange. I will provide a solution similar to one at MSE but more fully worked out. Also, I will show an interesting relation between the digamma function and the tangent function due to another solution at MSE.

\begin{align}
I &= -i \int\limits_{0}^{\infty} \frac{\mathrm{e}^{iax}-\mathrm{e}^{-iax}}{\mathrm{e}^{x/2}-\mathrm{e}^{-x/2}}\mathrm{d}x \\
&= -i \int\limits_{0}^{\infty} \mathrm{e}^{-x/2} \frac{\mathrm{e}^{iax}-\mathrm{e}^{-iax}}{1-\mathrm{e}^{-x}}\mathrm{d}x \\
&= -i \int\limits_{0}^{\infty} \mathrm{e}^{-x/2} \left( \mathrm{e}^{iax}-\mathrm{e}^{-iax} \right) \sum\limits_{n=0}^{\infty} \mathrm{e}^{-nx}\mathrm{d}x \\
&= -i \int\limits_{0}^{\infty} \Big[\sum\limits_{n=0}^{\infty} \mathrm{e}^{-x(1/2+n-ia)} \,-\, \sum\limits_{n=0}^{\infty} \mathrm{e}^{-x(1/2+n+ia)} \Big] \mathrm{d}x \\
\tag{2}
\label{eq:sinsinh-2}
&= -i \Big[\sum\limits_{n=0}^{\infty} \frac{1}{1/2+n-ia} \,-\, \sum\limits_{n=0}^{\infty} \frac{1}{1/2+n+ia}\Big] \\
&= 2a \sum\limits_{n=0}^{\infty} \frac{1}{(n+1/2)^{2}+a^{2}}
\end{align}

The Mittag-Leffler expansion of the hyperbolic tangent function is

\tanh(z) = 2z \sum\limits_{n=0}^{\infty} \frac{1}{n^{2}(\pi/2)^{2}+z^{2}}
\tag{3}
\label{eq:sinsinh-3}

For $$z=a\pi$$ we have our final result

\int\limits_{-\infty}^{\infty} \frac{\sin(ax)}{\mathrm{e}^{x/2}-\mathrm{e}^{-x/2}}\mathrm{d}x = 2a \sum\limits_{n=0}^{\infty} \frac{1}{(n+1/2)^{2}+a^{2}} = \pi \tanh(\pi a)

Now, let us examine equation \eqref{eq:sinsinh-2} and use it to recover a definition of the tangent in terms of the digamma function.

Using a series definition of the digamma function:

\psi(z) = -\gamma + \sum\limits_{n=0}^{\infty} \left( \frac{1}{n+1} – \frac{1}{n+z} \right)
\tag{4}
\label{eq:sinsinh-4}

we have

\psi\left(\frac{1}{2}+ia\right) = -\gamma + \sum\limits_{n=0}^{\infty} \left( \frac{1}{n+1} – \frac{1}{(n+1/2)+ia} \right)
\tag{5a}
\label{eq:sinsinh-5a}

and

\psi\left(\frac{1}{2}-ia\right) = -\gamma + \sum\limits_{n=0}^{\infty} \left( \frac{1}{n+1} – \frac{1}{(n+1/2)-ia} \right)
\tag{5b}
\label{eq:sinsinh-5b}

Subtracting equation \eqref{eq:sinsinh-5b} from \eqref{eq:sinsinh-5a} and multiplying the result by $$-i$$ yields equation \eqref{eq:sinsinh-2} which is equal to equation \eqref{eq:sinsinh-1}.

Making the substitution $$z=\frac{1}{2}+ia$$ yields
\begin{align}
-i\big[\psi(z)-\psi(1-z)\big] &= \pi \tanh\Big[-i\pi\left(z-\frac{1}{2}\right)\Big] \\
&= -i \pi \tan\Big[\pi\left(z-\frac{1}{2}\right)\Big] \\
&= -i \pi \cot(\pi z)
\end{align}

Rearrangement yields

\psi(z)-\psi(1-z) = \frac{-\pi}{\tan(\pi z)}

an expression which can be found here.

## Laplace Transform of the Gudermannian Function

How to find the Laplace transform of the Gudermannian function was a question on Mathematics Stack Exchange. Here is my solution.

\mathcal{L}[\mathrm{gd}(x)](s) = \int\limits_{0}^{\infty} \mathrm{e}^{-sx}\mathrm{gd}(x)\mathrm{d} x

Integration by parts yields
\begin{align}
\int\limits_{0}^{\infty} \mathrm{e}^{-sx}\mathrm{gd}(x)\mathrm{d} x & =
\frac{-1}{s}\mathrm{gd}(x)\mathrm{e}^{-sx}\big|_{0}^{\infty} +
\frac{1}{s}\int\limits_{0}^{\infty} \mathrm{e}^{-sx}\mathrm{sech}(x)\mathrm{d} x \\
& = 0 + \frac{1}{s}\mathcal{L}[\mathrm{sech}(x)](s) \\
& = \frac{1}{2s}\left[\psi\left(\frac{s+3}{4}\right) – \psi\left(\frac{s+1}{4}\right) \right]
\end{align}
for $$Re(s) > 0$$ due to evaluating the limit at $$x = \infty$$, while $$Re(s) > -1$$ for the Laplace transform of the hyperbolic secant.

Notes:

1. $$\frac{\mathrm{d}}{\mathrm{d}x}\mathrm{gd}(x) = \mathrm{sech}(x)$$
2. $$\mathrm{gd}(0) = 0\,$$ and $$\,\mathrm{gd}(\infty) = \frac{\pi}{2}$$
3. $$\psi(s)$$ is the digamma function.

## Integrate $$\int_{0}^{\infty} \frac{x}{\sqrt{\mathrm{e}^{x}-1}} \mathrm{d} x$$

How to evaluate

\int\limits_{0}^{\infty} \frac{x}{\sqrt{\mathrm{e}^{x}-1}} \mathrm{d} x

was a question on Mathematics Stack Exchange. Here is another solution method.

Let $$z=\mathrm{e}^{x}-1$$, so that we have

\int\limits_{0}^{\infty} \frac{\mathrm{ln}(z+1)}{\sqrt{z}}\frac{1}{z+1} \mathrm{d} z

Let us consider

I(a) = \int\limits_{0}^{\infty} \frac{(z+1)^{a}}{\sqrt{z}} \mathrm{d} z = \mathrm{B}\left(\frac{1}{2}, -\frac{1}{2}-a\right)
= \frac{\Gamma\left(\frac{1}{2}\right) \Gamma\left(-\frac{1}{2}-a\right)}{\Gamma(-a)}

so that

\lim_{a \to -1} \frac{\partial I(a)}{\partial a} = \int\limits_{0}^{\infty} \frac{\mathrm{ln}(z+1)}{\sqrt{z}}\frac{1}{z+1} \mathrm{d} z =
\int\limits_{0}^{\infty} \frac{x}{\sqrt{\mathrm{e}^{x}-1}} \mathrm{d} x

Then,

\frac{\partial I(a)}{\partial a} = \Gamma\left(\frac{1}{2}\right)\left[\frac{-\Gamma(-a)\Gamma\left(-\frac{1}{2}-a\right)\psi^{0}\left(-\frac{1}{2}-a\right) + \Gamma\left(-\frac{1}{2}-a\right)\Gamma(-a)\psi^{0}(-a)}{\Gamma(-a)\Gamma(-a)} \right]

\begin{align}
\lim_{a \to -1} \frac{\partial I(a)}{\partial a} & = \frac{-\Gamma\left(\frac{1}{2}\right)\Gamma\left(\frac{1}{2}\right)}{\Gamma(1)}
\left[\psi^{0}\left(\frac{1}{2}\right) – \psi^{0}(1)\right] \\
& = -\pi[(-\gamma-\mathrm{ln}4) -(- \gamma)] \\
& = \pi\mathrm{ln}4 \\
& = \int\limits_{0}^{\infty} \frac{x}{\sqrt{\mathrm{e}^{x}-1}} \mathrm{d} x
\end{align}

## Integrals from Blagouchine’s Malmsten Integral Paper

Here I evaluate problem 18a from page 43 from Rediscovery of Malmsten’s integrals, their evaluation by contour integration methods and some related results by Iaroslav V. Blagouchine as well as a bonus integral. The integral in question is

\int\limits_{0}^{\infty} \frac{x^{a}\mathrm{ln}(x)}{\mathrm{e}^{bx}-1} \mathrm{d} x
\label{eq:160817-1}
\tag{1}

We will evaluate this integral using two methods. First, taking the hint given by Blagouchine, we expand the function

f(x) = \frac{1}{\mathrm{e}^{bx}-1}
\label{eq:160817-2}
\tag{2}

and then integrate term by term.

f(x) = \frac{1}{\mathrm{e}^{bx}-1} = \frac{\mathrm{e}^{-bx}}{1-\mathrm{e}^{-bx}} = \sum\limits_{n=0}^{\infty} \mathrm{e}^{-(1+n)bx}
\label{eq:160817-3}
\tag{3}

We commence with

I = \int\limits_{0}^{\infty} \frac{x^{a}}{\mathrm{e}^{bx}-1} \mathrm{d} x = \int\limits_{0}^{\infty} x^{a} \sum\limits_{n=0}^{\infty} \mathrm{e}^{-(1+n)bx} \mathrm{d} x
= \sum\limits_{n=0}^{\infty} \int\limits_{0}^{\infty} x^{a} \mathrm{e}^{-(1+n)bx} \mathrm{d} x
\label{eq:160817-4}
\tag{4}

Making the substitution $$y = (1+n)bx$$ yields
\begin{align}
I & = \sum\limits_{n=0}^{\infty} \frac{1}{(1+n)^{a+1}b^{a+1}} \int\limits_{0}^{\infty} y^{a} \mathrm{e}^{-y} \mathrm{d} y
= \frac{\Gamma(a+1)}{b^{\,a+1}} \sum\limits_{n=0}^{\infty} \frac{1}{(1+n)^{a+1}} \\
& = \frac{\Gamma(a+1)}{b^{\,a+1}} \sum\limits_{k=1}^{\infty} \frac{1}{k^{a+1}} \\
& = \frac{\Gamma(a+1)\zeta(a+1)}{b^{\,a+1}}
\label{eq:160817-5}
\tag{5}
\end{align}

So we have our first result

\int\limits_{0}^{\infty} \frac{x^{a}}{\mathrm{e}^{bx}-1} \mathrm{d} x = \frac{\Gamma(a+1)\zeta(a+1)}{b^{\,a+1}}
\label{eq:160817-6}
\tag{6}

We can evaluate this integral quite simply if we recognize that it can be written as a Mellin transform

\mathcal{M}[f(x)](s) = \int\limits_{0}^{\infty} \frac{x^{s-1}}{\mathrm{e}^{bx}-1} \mathrm{d} x = \frac{\Gamma(s)\zeta(s)}{b^{s}}
\label{eq:160817-7}
\tag{7}

Letting $$s = a+1$$ yields our result.

To evaluate the integral in \eqref{eq:160817-1} we differentiate equation \eqref{eq:160817-6} with respect to $$a$$ and note that

\frac{d\Gamma(z)}{dz} = \Gamma(z)\psi^{(0)}(z)

\begin{align}
\int\limits_{0}^{\infty} \frac{x^{a}\mathrm{ln}(x)}{\mathrm{e}^{bx}-1} \mathrm{d} x & = \frac{-\mathrm{ln}(b)}{b^{\,a+1}} \Gamma(a+1)\zeta(a+1) + \frac{\Gamma'(a+1)\zeta(a+1)}{b^{\,a+1}} + \frac{\Gamma(a+1)\zeta'(a+1)}{b^{\,a+1}} \\
& = \frac{\Gamma(a+1)}{b^{\,a+1}} \left[ \psi^{(0)}(a+1)\zeta(a+1) + \zeta'(a+1) – \zeta(a+1)\mathrm{ln}(b) \right]
\label{eq:160817-8}
\tag{8}
\end{align}

Note that $$\mathrm{Re}(a) > 0$$.

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

I derived the expression

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

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.

\int\limits_{0}^{\infty} \mathrm{e}^{-x} x^t \mathrm{d} x = \Gamma(t+1)
\label{eq:1608162}
\tag{2}

Differentiate with respect to $$t$$

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

Taking the limit of equation \eqref{eq:1608163}, $$t \to 0$$ yields

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

## 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.