Evaluation of $\int\limits ^{\infty }_{0}\frac{x}{\left( x^{2} +1\right)^2\left( e^{tx} +1\right)} dx$

We first modifiy the integral to be calculated, by remarking that, changing $x=-u$, \begin{align} I&=\int^{\infty }_{0}\frac{x}{\left( x^{2} +1\right)^2\left( e^{tx} +1\right)}\,dx\\ &=-\int_{-\infty }^{0}\frac{u}{\left( u^{2} +1\right)^2\left( e^{-tu} +1\right)}\,du\\ &=-\int_{-\infty }^{0}\frac{ue^{tu} }{\left( u^{2} +1\right)^2\left( e^{tu} +1\right)}\,du\\ &=-\int_{-\infty }^{0}\frac{u}{\left( u^{2} +1\right)^2}\,du+\int_{-\infty }^{0}\frac{u}{\left( u^{2} +1\right)^2\left( e^{tu} +1\right)}\,du\\ &=\frac{1}{2}+I^- \end{align} where \begin{equation} I^-=\int_{-\infty }^{0}\frac{u}{\left( u^{2} +1\right)^2\left( e^{tu} +1\right)}\,du \end{equation} Then, we have \begin{align} I&=I^-+\frac{1}{2}\\ I+I^-&=\int_{-\infty }^{\infty}\frac{u}{\left( u^{2} +1\right)^2\left( e^{tu} +1\right)}\,du \end{align} Thus, \begin{equation} I=\frac{1}{4}+\frac{1}{2}\int_{-\infty }^{\infty}\frac{u}{\left( u^{2} +1\right)^2\left( e^{tu} +1\right)}\,du \end{equation} This integral is evaluated by the residue method, by closing the contour with the upper half circle. It can easily be verified that the half-circle contribution vanishes. Interior poles lie at

  • $u=i$ with residue \begin{align} R_i&=\frac{it\exp(it)}{4(1+\exp(it))^2}\\ &=\frac{it}{16\cos^2\left( t/2 \right)}\\ &=\frac{it}{4}\sum_{n=-\infty}^\infty\frac{1}{\left( t+\pi(2n+1) \right)^2}\\ &=\frac{it}{2}\sum_{n\ge0}\frac{t^2+\pi^2(2n+1)^2}{\left( t^2-\pi^2(2n+1)^2 \right)^2} \end{align} (using the series representation for $\sec^2(z)$).
  • $u=i(2n+1)\pi/t$, where $n=0,1,2,\ldots$ with residues \begin{align} R_n&=\frac{-i\pi\left( 2n+1\right)t^2 }{\left(\left( (2n+1)i\pi \right)^2+t^2\right)^2}\\ &=\frac{-i\pi\left( 2n+1\right)t^2 }{\left(t^2-\pi^2(2n+1)^2\right)^2} \end{align} Then \begin{align} I&=\frac{1}{4}+\frac{1}{2}2i\pi\frac{it}{2} \sum_{n\ge0}\left[\frac{t^2+\pi^2(2n+1)^2}{\left( t^2-\pi^2(2n+1)^2 \right)^2}-\frac{2\pi\left( 2n+1\right)t }{\left(t^2-\pi^2(2n+1)^2\right)^2} \right]\\ &=\frac{1}{4}-\frac{\pi t}{2}\sum_{n\ge0}\frac{\left( t-\pi(2n+1) \right)^2}{\left( t^2-\pi^2(2n+1)^2 \right)^2}\\ &=\frac{1}{4}-\frac{\pi t}{2}\sum_{n\ge0}\frac{1}{\left( t+\pi(2n+1) \right)^2} \end{align} The summation can be written as \begin{align} I&=\frac{1}{4}-\frac{ t}{8\pi}\sum_{n\ge0}\frac{1}{\left( \frac{t}{2\pi}+n+\frac{1}{2} \right)^2}\\ &=\frac{1}{4}-\frac{ t}{8\pi}\psi^{(1)}\left( \frac{t}{2\pi}+\frac{1}{2} \right) \end{align} From the classical identity \begin{equation} \psi\left(2z\right)=\tfrac{1}{2}\left(\psi\left(z\right)+\psi\left(z+\tfrac{1}{2}\right)\right)+\ln 2 \end{equation} we obtain, after differentiation \begin{equation} \psi^{(1)}\left(z+\tfrac{1}{2}\right)=4\psi^{(1)}\left(2z\right)-\psi^{(1)}\left(z\right) \end{equation} and thus \begin{equation} I=\frac{1}{4}-\frac{t}{8\pi}\left[4\psi^{(1)}\left( \frac{t}{\pi}\right)-\psi^{(1)}\left( \frac{t}{2\pi}\right)\right] \end{equation} as expected.

$\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}$ $\ds{\bbox[10px,#ffd]{\left.\int_{0}^{\infty}{x \over \pars{x^{2} + 1}^{2}\pars{\expo{tx} + 1}}\,\dd x \,\right\vert_{\ t\ >\ 0} = {t \over 8\pi}\bracks{\Psi\, '\pars{t \over 2\pi} - 4\Psi\, '\pars{t \over \pi}} + {1 \over 4}}:\ {\Large ?}}$.


\begin{align} &\bbox[10px,#ffd]{\left.\int_{0}^{\infty}{x \over \pars{x^{2} + 1}^{2}\pars{\expo{tx} + 1}}\,\dd x\,\right\vert_{\ t\ >\ 0}} \\[5mm] = &\ \int_{0}^{\infty}{x \over \pars{x^{2} + 1}^{2}\pars{\expo{tx} - 1}}\,\dd x - \int_{0}^{\infty}{x \over \pars{x^{2} +1}^{2}}\pars{{1 \over \expo{tx} - 1} - {1 \over \expo{tx} + 1}}\,\dd x \\[5mm] = &\ \int_{0}^{\infty}{x \over \pars{x^{2} +1}^{2}\pars{\expo{tx} - 1}}\,\dd x - 2\int_{0}^{\infty}{x \over \pars{x^{2} + 1}^{2}\pars{\expo{2tx} - 1}}\,\dd x \end{align} In the first integral I'll set $\ds{tx\ \mapsto\ 2\pi x}$ while in the second one I'll set $\ds{2tx\ \mapsto\ 2\pi x}$. Then, \begin{align} &\bbox[10px,#ffd]{\left.\int_{0}^{\infty}{x \over \pars{x^{2} +1}^{2}\pars{\expo{tx} + 1}}\,\dd x\,\right\vert_{\ t\ >\ 0}} \\[5mm] = &\ \pars{t \over 2\pi}^{2}\int_{0}^{\infty}{x \over \braces{x^{2} + \bracks{t/\pars{2\pi}}^{2}}^{2}\pars{\expo{2\pi x} - 1}} \,\dd x \\[2mm] - &\ 2\pars{t \over \pi}^{2}\int_{0}^{\infty}{x \over \bracks{x^{2} + \pars{t/\pi}^{2}}^{2}\pars{\expo{2\pi x} - 1}}\,\dd x \\[5mm] = &\ \mathcal{F}\pars{t \over 2\pi} - 2\,\mathcal{F}\pars{t \over \pi}\label{1}\tag{1} \end{align} where \begin{align} \mathcal{F}\pars{y} & \equiv y^{2}\int_{0}^{\infty}{x \over \pars{x^{2} + y^{2}}^{2}\pars{\expo{2\pi x} - 1}}\,\dd x = {1 \over 4}\bracks{y\,\Psi\, '\pars{y} - {1 \over 2y} - 1} \label{2}\tag{2} \end{align}

(\ref{2}) is derived from Binet Second Formula. The final result (\ref{2}) is derived here.


(\ref{1}) and (\ref{2}) yield the coveted result $$ \bbox[10px,#ffd]{\left.\int_{0}^{\infty}{x \over \pars{x^{2} + 1}^{2}\pars{\expo{tx} + 1}}\,\dd x \,\right\vert_{\ t\ >\ 0} = {t \over 8\pi}\bracks{\Psi\, '\pars{t \over 2\pi} - 4\Psi\, '\pars{t \over \pi}} + {1 \over 4}} $$

NB This is not the problem posed by the OP. That said, the problem I did solve, with only a single factor of $x^2+1$ in the denominator, posed a special challenge and I feel the solution is worth keeping.


This one can be done using symmetry and the residue theorem. First observe that

$$\frac{x}{e^{\pi x}+1} = \frac{x}{2} - \frac{x}{2} \tanh{\left ( \frac{\pi}{2} x \right )} $$

That is, the integrand may be broken up into odd and even pieces. Note also, that each of these pieces, when broken into respective component integrals, produce divergent component integrals. But because I have faith in the system, lets consider

$$\begin{align} \int_0^{\infty} dx \frac{x}{(x^2+1) (e^{\pi x}+1)} &= \lim_{R \to \infty} \int_0^R dx \frac{x}{(x^2+1) (e^{\pi x}+1)} \\ &= \lim_{R \to \infty} \left [\frac12 \int_0^R dx \frac{x}{x^2+1} - \frac12 \int_0^R dx \frac{x}{x^2+1} \frac{e^{\pi x}-1}{e^{\pi x}-1} \right ] \\ &= \lim_{R \to \infty} \left [\frac14 \log{\left ( R^2+1 \right )} - \frac14 \int_{-R}^R dx \frac{x}{x^2+1} \frac{e^{\pi x}-1}{e^{\pi x}-1} \right ] \end{align}$$

Note that, in the last step, we were able to exploit the evenness of the integrand. (Note also that we used the exponential representation of $\tanh$.)

To evaluate that last integral, we use the residue theorem. Consider the contour integral

$$\oint_C dz \, \frac{z}{z^2+1} \frac{e^{\pi z}-1}{e^{\pi z}+1} $$

where $C$ is a semicircular arc centered at the origin and having a radius $R$. The contour integral is equal to

$$\int_{-R}^R dx \frac{x}{x^2+1} \frac{e^{\pi x}-1}{e^{\pi x}-1} + i R \int_0^{\pi} d\theta \, e^{i \theta} \frac{R e^{i \theta}}{R^2 e^{i 2 \theta}+1} \frac{e^{\pi R e^{i \theta}}-1}{e^{\pi R e^{i \theta}}+1}$$

I will show below that, as $R \to \infty$, the second integral vanishes. We may take that the first integral is, by the residue theorem, equal to $i 2 \pi$ times the sum of the residues of the poles of the integrand of the contour integral. In this case, the integrand has a double pole at $z=i$ and simple poles at $z=i (2 k+1)$ for $k \in \mathbb{N}$. The residues of these poles are as follows:

$$z_0 = -\frac{i}{2 \pi}$$ $$z_k = -\frac{i}{2 \pi} \frac{2 k+1}{k (k+1)} $$

Accordingly,

$$\begin{align}\int_{-R}^R dx \frac{x}{x^2+1} \frac{e^{\pi x}-1}{e^{\pi x}-1} &= 1+2 \sum_{k=1}^{N(R)} \frac1{k+1} + \sum_{k=1}^{N(R)} \left ( \frac1{k} - \frac1{k+1} \right )\\ &= 2 H_{N(R)+1} - \frac{2}{N(R)+1} \end{align}$$

where $H_n$ is the $n$th harmonic number and $N(R) = \frac12 (R-1)$ is the number of poles inside $C$. Note then, as $R \to \infty$ that

$$\begin{align} H_{N(R)+1} &= \log{(N(R)+1)} + \gamma - \frac1{2 (N(R)+1)} + O \left ( \frac1{R^2} \right ) \\ &= \log{\left ( \frac12 (R-1)+1 \right )} + \gamma - \frac1{2 (N(R)+1)} + O \left ( \frac1{R^2} \right ) \\ &= \log{\left ( R+\frac12 \right )} + \gamma - \log{2} - \frac1{2 (N(R)+1)} + O \left ( \frac1{R^2} \right ) \end{align}$$

where $\gamma$ is the Euler-Mascheroni constant. Now we can plug this back into the original limit above. The result is

$$\begin{align} \int_0^{\infty} dx \frac{x}{(x^2+1) (e^{\pi x}+1)} &= \lim_{R \to \infty} \left [\frac14 \log{\left ( R^2+1 \right )} - \frac14 \int_{-R}^R dx \frac{x}{x^2+1} \frac{e^{\pi x}-1}{e^{\pi x}-1} \right ] \\ &= \lim_{R \to \infty} \left [\frac12 \log{R} - \frac12 (\gamma - \log{2}) + \frac1{4 R} - \frac12 \log{R} - \frac1{4 R} - \frac1{R} + O \left ( \frac1{R^2} \right ) \right ] \end{align}$$

And therefore...

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

Note that my faith in the system was rewarded because the singular pieces canceled. This result has been verified independently by Mathematica.

To complete this, I must show that the integral over the large arc vanishes as $R \to \infty$. This may be done by expanding the integral into real and imaginary parts as follows:

$$\int_0^{\pi} d\theta \, \frac{R^2 \left(\left(R^2+\cos (\theta)\right) \sinh (\pi R \cos (\theta))-\sin (\theta) \sin (\pi R \sin (\theta))\right)}{\left(R^4+2 R^2 \cos (\theta)+1\right) (\cos (\pi R \sin (\theta))+\cosh (\pi R \cos (\theta)))} \\ + i \int_0^{\pi} d\theta \, \frac{R^2 \left(\sin (\pi R \sin (\theta)) \left(R^2+\cos (\theta)\right)+\sin (\theta) \sinh (\pi R \cos (\theta))\right)}{\left(R^4+2 R^2 \cos (\theta)+1\right) (\cos (\pi R \sin (\theta))+\cosh (\pi R \cos (\theta)))} $$

For the real part, the integrand is dominated by the $R^4 \sinh (\pi R \cos (\theta))$ term in the numerator and the $R^4 \cos(\pi R \cos (\theta))$ in the denominator. As $\cos (\theta)$ is odd over the integration interval, the integrand is odd over the integration interval and the real part of the integral therefore vanishes as $R \to \infty$.

For the imaginary part, the integrand is dominated by the $R^2 \sin (\theta) \sinh (\pi R \cos (\theta))$ in the numerator and the $R^4 \cos(\pi R \cos (\theta))$ in the denominator. In this case, the integral vanishes as a constant times $1/R^2$ as $R \to \infty$ and the imaginary part vanishes in this limit as well. Accordingly, the above result is verified.