Evaluate $\int_0^\infty\frac{1-e^{-x}(1+x )}{x(e^{x}-1)(e^{x}+e^{-x})}dx$

Solution 1:

Hint. An approach. One may consider $$ I(s):=\int_0^\infty x^{s-1}\frac{1-e^{-x}(1+x )}{(e^{x}-1)(e^{x}+e^{-x})}dx,\quad s>0, \tag1 $$ which one may rewrite as $I_1(s)+I_2(s)$ with

$$ \begin{align} I_1(s):=&\frac12\int_0^\infty x^{s-1}\frac{1-e^{-x}(1+x )}{(e^{x}-1)}dx\\\\ I_2(s):=&-\frac12\int_0^\infty x^{s-1}\frac{\left(1-e^{-x}(1+x )\right)(1-e^{-x})}{(e^{x}+e^{-x})}dx \end{align} $$ each of the preceding integrals is a linear combination of the standard evaluations $$ \begin{align} a(s,r)=&\int_0^\infty x^{s-1}\frac{e^{-rx}}{(e^{x}-1)}dx=\Gamma(s)\zeta(s,r+1) \\\\ b(s,r)=&\int_0^\infty x^{s-1}\frac{e^{-rx}}{(e^{x}+e^{-x})}dx=\Gamma(s) \left(4^{-s}\zeta\left(s,\frac{1+r}{4}\right)-4^{-s}\zeta\left(s,\frac{3+r}{4}\right)\right) \end{align} $$ where $\zeta(\cdot,\cdot)$ is the Hurwitz zeta function.

Finally one gets that $2I(s)$ is equal to $$ a(s,0)-a(s,1)-a(s+1,1)-b(s,0)+2b(s,1)+b(s+1,1)-b(s,2)-b(s+1,2) $$ which as $s \to 0^+$ gives $I(0)=I$:

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

confirming @Claude Leibovici's announced result, where $\gamma$ is the Euler-Mascheroni constant.

Solution 2:

This is not an answer but just a result.

Being unable to crack this integral, I made a numerical evaluation and I gave the result to the inverse symbolic calculator. The result is apparently $$\frac{1}{8} \left(\pi +\log \left(\frac{\pi ^4}{64} \right)-4 \gamma\right)$$ ($\gamma$ being Euler's constant).

This is correct at least for $500$ significant figures.

Now, I am curious to see how the problem could be tackled.

Solution 3:

Here is an elementary way:

Denote the wanted integral by $I$. First we note that we can write your integrand as $$ \frac{2+x+xe^x}{2x(1+e^{2x})}-\frac{1}{2}\frac{1}{e^x-1}. $$ Now, we have two diverging parts, but since $$ \gamma=\int_0^{+\infty}\frac{1}{e^x-1}-\frac{1}{xe^x}\,dx, $$ we add and subtract with $1/(2xe^x)$. We get $$ I=-\frac{\gamma}{2}+\int_0^{+\infty}\frac{x(e^{-x}+e^{-2x})-(e^{-x}-e^{-2x})+(e^{-2x}-e^{-3x})}{2x(1+e^{-2x})}\,dx. $$ With $$ \frac{1}{1+e^{-2x}}=\sum_{k=0}^{+\infty}(-1)^ke^{-2kx}, $$ we find that $I+\gamma/2$ equals (no problem with convergence, so we can change order of integration and summation) $$ \frac{1}{2}\sum_{k=0}^{+\infty}(-1)^k\int_0^{+\infty} e^{-(1+2k)x}+e^{-(2+2k)x}-\frac{e^{-(1+2k)x}-e^{-(2+2k)x}}{x}+\frac{e^{-(2+2k)x}-e^{-(3+2k)x}}{x}\,dx. $$ All integrals are easily calculated (exponentials and Frullani), and we find that $I+\gamma/2$ equals $$ \frac{1}{2}\sum_{k=0}^{+\infty}(-1)^k\Bigl[\frac{1}{1+2k}+\frac{1}{2+2k}-\log\frac{2+2k}{1+2k}+\log\frac{3+2k}{2+2k}\Bigr] $$ The first two parts should be known from Maclaurin series of $\arctan x$ and $\log(1+x)$. The second two terms are combined and calculated using the Wallis product formula). The result of the series is $$ \frac{\pi}{8}+\frac{1}{4}\log 2+\frac{1}{2}\log\frac{\pi}{4}. $$ Thus, we have found that $$ I=\int_0^{+\infty}\frac{1-e^{-x}(1+x)}{x(e^x-1)(e^x+e^{-x})}\,dx=-\frac{\gamma}{2}+\frac{\pi}{8}+\frac{1}{4}\log 2+\frac{1}{2}\log\frac{\pi}{4}. $$