Definite integral: $\int_0^\infty \frac{x dx}{(1+x^2)(1+e^{\pi x})}$

I need help computing the value of the following definite improper integral: $$\int_0^\infty \frac{x dx}{(1+x^2)(1+e^{\pi x})}=\text{?}$$ Here are my thoughts and attempts:

• I tried using the Laplace Transform identity for definite integrals, with no luck (since I can only compute the Laplace Transform of $\frac{1}{e^{\pi x}+1}$ in terms of the digamma function... yuck)
• I can't use the residue theorem, since the integral is from $0$ to $\infty$ and the integrand is not an even function
• I would like to expand $\frac{x}{1+x^2}=\frac{1/x}{1-(-1/x^2)}$ as a geometric series, but it wouldn't always converge since $x$ goes from $0$ to $\infty$

CONTEXT: The integral came up in Jack D'Aurizio's answer to this question.

Any ideas?

• Did you try integration by parts, like he suggests.. – mathworker21 Mar 15 '18 at 23:21
• @mathworker21 Haha yes, of course, but to no avail. It gives me the integral $$\frac{\pi}{2}\int_0^\infty \frac{e^{\pi x}\ln(x^2+1)}{(e^{\pi x}+1)^2}dx$$ ... which seems even nastier than the original problem. IBP with the opposite $u$ and $v$ also fails to produce anything simpler. – Franklin Pezzuti Dyer Mar 15 '18 at 23:23
• Just to clarify, we expect it to be $\frac{\ln(2)-\gamma}{2}$, right? – mathworker21 Mar 15 '18 at 23:28
• @Winther As already explained, expanding $\frac{1}{1+x^2}$ can't really be done w/o splitting up my integral, since the geometric series doesn't converge on $(0,\infty)$. Also, I'd prefer not to expand $\frac{1}{e^{\pi x}(1+e^{-\pi x})}$, because, as indicated by the link in my question, I'm actually trying to use this integral to calculate the value of the series that would result, so expansion would just be circular. – Franklin Pezzuti Dyer Mar 15 '18 at 23:28
• Yes you are right – Winther Mar 15 '18 at 23:29

We use the formula (valid for $\Re (z) > 0$): $$\psi(z) = \ln z - \frac{1}{2z} - 2 \int_0^\infty \frac{x}{(x^2+1)(e^{2\pi xz}-1)} dx$$ which $\psi(z)$ is the digamma function, this follows from differentiating Binet's second formula.

Since $$\int_0^\infty \frac{x dx}{(1+x^2)(1+e^{\pi x})} = \int_0^\infty \frac{x dx}{(1+x^2)(e^{\pi x}-1)} - 2\int_0^\infty \frac{x dx}{(1+x^2)(e^{2\pi x}-1)}$$

applying the formula gives the result: $$\int_0^\infty \frac{x dx}{(1+x^2)(1+e^{\pi x})} = \frac{\ln 2 - \gamma}{2}$$

• (+1) I agree that differentiating Binet's second $\log\Gamma$ formula is a slick idea, this probably is an underestimated trick. – Jack D'Aurizio Apr 4 '18 at 3:50

You were on a promising track. By the Laplace transform

$$A_k=\int_{0}^{+\infty}\frac{x}{1+x^2}e^{-\pi k x}\,dx =(-1)^k\int_{k\pi}^{+\infty}\frac{\cos x}{x}\,dx=(-1)^k\int_{k}^{+\infty}\frac{\cos(\pi x)}{x}\,dx\tag{1}$$ hence $$\int_{0}^{+\infty}\frac{x\,dx}{(1+x^2)(e^{\pi x}+1)}=\sum_{k\geq 1}(-1)^{k+1}A_k=-\sum_{k\geq 1}\int_{k}^{+\infty}\frac{\cos(\pi x)}{x}\,dx \\=-\frac{1}{\pi}\int_{1}^{+\infty}\frac{\lfloor x\rfloor \sin(\pi x) }{x}\,dx\tag{2}$$ and the claim follows by exploiting the Fourier sine series of $\lfloor x\rfloor-\frac{1}{2}$, Dirichlet's integral $\int_{0}^{+\infty}\frac{\sin(mx)}{x}\,dx=\frac{\pi}{2}$, its generalization $\int_{0}^{+\infty}\frac{\sin(\pi x)\sin(\pi m x)}{x}\,dx =\frac{1}{2}\log\frac{m+1}{m-1}$ granted by the complex version of Frullani's theorem, the series definition of $\gamma$.


With the Abel-Plana Formula:

\begin{align} &\bbox[10px,#ffd]{\ds{% \int_{0}^{\infty}{x\,\dd x \over \pars{1 + x^{2}}\pars{1 + \expo{\pi x}}}}} = \\[5mm] = &\ -\,{1 \over 2}\,\lim_{N \to \infty}\bracks{% \sum_{k = 0}^{N}\pars{{2 \over k + 1} - {1 \over k + 1/2}} - \int_{0}^{N}\pars{{2 \over x + 1} - {1 \over x + 1/2}}\,\dd x} \label{1}\tag{1} \end{align}

Note that $$\left\{\begin{array}{rclcl} \ds{\sum_{k = 0}^{N}{2 \over k + 1}} & \ds{=} & \ds{2\sum_{k = 0}^{\infty}\pars{{1 \over k + 1} - {1 \over k + N + 2}}} & \ds{=} & \ds{2\pars{H_{N + 1} + \gamma}} \\[1mm] \ds{\sum_{k = 0}^{N}{1 \over k + 1/2}} & \ds{=} & \ds{\sum_{k = 0}^{\infty}\pars{{1 \over k + 1/2} - {1 \over k + N + 3/2}}} & \ds{=} & \ds{H_{N + 1/2} + \gamma + 2\ln\pars{2}} \end{array}\right. \label{2}\tag{2}$$ where $\ds{H_{z}}$ is a Harmonic Number, $\ds{\gamma}$ is the Euler-Mascheroni Constant and $$\int_{0}^{N}\pars{{2 \over x + 1} - {1 \over x + 1/2}}\,\dd x = 2\ln\pars{N + 1} - \ln\pars{N + {1 \over 2}} - \ln\pars{2} \label{3}\tag{3}$$

With \eqref{1}, \eqref{2} and \eqref{3}:

$$\bbx{\int_{0}^{\infty}{x\,\dd x \over \pars{1 + x^{2}}\pars{1 + \expo{\pi x}}} = {1 \over 2}\bracks{\ln\pars{2} - \gamma}} \approx 0.0580$$ where we used the $\ds{H_{z}}$ asymptotic behaviour as $\ds{\verts{z} \to \infty}$.

$$\color{Blue}{\int_0^{\infty } \frac{x}{\left(1+x^2\right) (1+\exp (\pi x))} \, dx}=\\\int_0^{\infty } \text{FourierSinTransform}\left[\frac{x}{1+x^2},x,s\right] \text{FourierSinTransform}\left[\frac{1}{1+\exp (\pi x)},x,s\right] \, ds=\\\int_0^{\infty } \left(\frac{e^{-s}}{2 s}-\frac{1}{2} e^{-s} \text{csch}(s)\right) \, ds=\color{blue}{\\\frac{1}{2} (-\gamma +\ln (2))}$$