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?
 A: 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}$$
A: 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$.
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\bbox[10px,#ffd]{\ds{%
\int_{0}^{\infty}{x\,\dd x \over \pars{1 + x^{2}}\pars{1 + \expo{\pi x}}}}} =
\\[5mm] = &\
\int_{0}^{\infty}{x \over 1 + x^{2}}
\pars{{1 \over \expo{\pi x} + 1} - {1 \over \expo{\pi x} - 1}}\dd x +
\int_{0}^{\infty}{x \over 1 + x^{2}}
{1 \over \expo{\pi x} - 1}\dd x
\\[5mm] = &\
-2\int_{0}^{\infty}{x \over 1 + x^{2}}
{1 \over \expo{2\pi x} - 1}\dd x +
\int_{0}^{\infty}{x \over 1/4 + x^{2}}
{1 \over \expo{2\pi x} - 1}\dd x
\\[5mm] = &\
\int_{0}^{\infty}\pars{{x \over 1/4 + x^{2}} - {2x \over 1 + x^{2}}}
{1 \over \expo{2\pi x} - 1}\dd x
\\[5mm] = &\
-\,{1 \over 2}\bracks{-2\,\Im\int_{0}^{\infty}\pars{{2 \over 1 + x\ic} - {1 \over 1/2 + x\ic}}
{1 \over \expo{2\pi x} - 1}\dd x}
\end{align}

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
\begin{equation}
\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}
\end{equation}
where $\ds{H_{z}}$ is a Harmonic Number, $\ds{\gamma}$ is the
Euler-Mascheroni Constant and
\begin{equation}
\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}
\end{equation}


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}$.
A: Using Fourier sine transform and generalized method:
$$\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))}$$
