\begin{equation} \int_0^\infty\frac{1-e^{-x}(1+x )}{x(e^{x}-1)(e^{x}+e^{-x})}dx \end{equation}

My colleague got this problem from his friend but he didn't know the answer so he asked my help. Unfortunately, after hours of tired effort I was unable to crack this integral. I was unable to find a way to evaluate it from online search either. I used to be good at solving this kind of problem but now I feel so embarrassed by my stupidity. I'm stuck and I badly need your help. It's a humbling request to ask people here being so kind to help me out. Thank you.

  • 21
    $\begingroup$ That is a lot of text not having with the problem to do. Please tell us instead what you have tried. $\endgroup$ – mickep Jun 7 '16 at 9:25
  • 8
    $\begingroup$ @mickep Thank for your comment but what kind of useless effort did you expect me to put in my answer? Even if I put it there, I'm afraid it's still of no use. $\endgroup$ – Sophie Agnesi Jun 7 '16 at 9:36
  • 5
    $\begingroup$ Well, you could for one thing mention that you are looking for answers in terms of elementary functions only, or perhaps with Beta and Polygamma functions. THAT would have been useful information. $\endgroup$ – mickep Jun 7 '16 at 11:16
  • 4
    $\begingroup$ I'm quite sure the use of the Hurwitz zeta function can be avoided after using substitution $y=e^{-x}$ and applying the Feynman's method as shown in @OlivierOloa's answer $\endgroup$ – Anastasiya-Romanova 秀 Jun 7 '16 at 11:29
  • $\begingroup$ @zyx Of course you may, feel free to edit it. $\endgroup$ – Sophie Agnesi Jun 9 '16 at 8:06

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.

  • 3
    $\begingroup$ I'm unhappy with the use of a special function like Hurwitz zeta function to evaluate this integral, but the answer is gratefully received nonetheless. Upvoted. $\endgroup$ – Sophie Agnesi Jun 7 '16 at 10:24
  • 3
    $\begingroup$ @Sophie, since $\gamma$ is involved in the final result, a path that avoids special functions seems unlikely. Olivier, nice use of Mellin! $\endgroup$ – J. M. is a poor mathematician Jun 7 '16 at 10:39
  • 4
    $\begingroup$ This is a beautiful and elegant solution, indeed. Thanks for providing it ! $\endgroup$ – Claude Leibovici Jun 7 '16 at 10:55
  • 1
    $\begingroup$ @SophieAgnesi Do note that you can click the checkmark button to mark this answer as "accepted". It's right below the up/down voting. $\endgroup$ – Simply Beautiful Art Jun 7 '16 at 21:01
  • 1
    $\begingroup$ @SimpleArt Why would I do that if this answer doesn't satisfy me?? Don't get me wrong Olivier, I do appreciate your answer. $\endgroup$ – Sophie Agnesi Jun 8 '16 at 2:01

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.

  • $\begingroup$ Thank you for your answer Claude. I really appreciate it but I cannot upvote your answer for the time being. $\endgroup$ – Sophie Agnesi Jun 7 '16 at 9:37
  • 2
    $\begingroup$ @SophieAgnesi. As I wrote, this is not an answer but just a result ! Cheers. $\endgroup$ – Claude Leibovici Jun 7 '16 at 9:44
  • $\begingroup$ Is gamma the Euler constant? $\endgroup$ – Vim Jun 7 '16 at 9:51
  • 5
    $\begingroup$ Wow, 7 upvotes for a result which is not answer! I've got to try that myself, too! $\endgroup$ – Alex M. Jun 7 '16 at 14:06
  • 1
    $\begingroup$ @AlexM. To my surprise, be sure ! As I said, I did not do anything. Cheers ... and try ! $\endgroup$ – Claude Leibovici Jun 7 '16 at 14:09

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}. $$

  • 1
    $\begingroup$ Only the integral for $\gamma$ is nonelementary here; well-done, you! $\endgroup$ – J. M. is a poor mathematician Jun 9 '16 at 10:33

I answer my own OP instead of improving it as a proof to user @mickep that I did give a try to this problem but I didn't want to post some useless efforts like "I tried substitution $x=\tan y$ then I failed... miserably". I consider putting this kind of effort is a a complete joke as shown in some posts with tag.

Okay, here is my try. Following user @Anastasiya-Romanova秀's suggestion, I use the substitution $y=e^{-x}$ and the original integral becomes

\begin{equation} \int_0^1\frac{y(y-1)-y^2\log y}{(1-y)(1+y^2)\log y}dy=-\int_0^1\frac{y}{1+y^2}\left(\frac{y}{1-y}+\frac{1}{\log y}\right)dy \end{equation}

Now, we consider the following parametric integral

\begin{equation} I(a):=\int_0^1\frac{y^{a-1}}{1+y^2}\left(\frac{y}{1-y}+\frac{1}{\log y}\right)dy \end{equation}

Differentiating $I(a)$ we get

\begin{align} I'(a)& =\int_0^1\left(\frac{\log y}{1-y}+1\right)\frac{y^{a-1}}{1+y^2}dy\\ &=\int_0^1\frac{y^{a}\log y}{1-y^4}dy+\int_0^1\frac{y^{a+1}\log y}{1-y^4}dy+\int_0^1\frac{y^{a-1}}{1+y^2}dy\\ &=\sum_{k=0}^\infty\int_0^1\left(y^{4k+a}\log y+y^{4k+a+1}\log y+(-1)^ky^{2k+a-1}\right)dy\\ &=\sum_{k=0}^\infty\left(-\frac{1}{(4k+a+1)^2}-\frac{1}{(4k+a+2)^2}+\frac{(-1)^k}{2k+a}\right)\\ &=\frac{1}{16}\left(-\psi_1\!\left(\frac{a+1}{4}\right)-\psi_1\!\left(\frac{a+2}{4}\right)+4\psi\!\left(\frac{a+2}{4}\right)-4\psi\!\left(\frac{a}{4}\right)\right) \end{align}

where I use the following relation

\begin{equation} \sum_{k=0}^\infty\frac{(-1)^k}{(z+k)^{m+1}}=\frac1{(-2)^{m+1}m!}\!\left(\psi_m\left(\frac{z}{2}\right)-\psi_m\!\left(\frac{z+1}{2}\right)\right) \end{equation}


\begin{equation} I(a)=\int_{\infty}^aI'(a)\ da=-\frac{1}{4}\psi\!\left(\frac{a+1}{4}\right)-\frac{1}{4}\psi\!\left(\frac{a+2}{4}\right)+\log\Gamma\!\left(\frac{a+2}{4}\right)-\log\Gamma\!\left(\frac{a}{4}\right) \end{equation}

Hence our considered problem is $\color{red}{-I(2)}$ which confirms user @ClaudeLeibovici's result.

\begin{align} \int_0^\infty\frac{1-e^{-x}(1+x )}{x(e^{x}-1)(e^{x}+e^{-x})}dx&=\frac{1}{4}\psi\!\left(\frac{3}{4}\right)+\frac{1}{4}\psi\!\left(1\right)+\log\Gamma\!\left(\frac{1}{2}\right)\\[10pt] &=\frac{1}{8}\left(\pi+\log\left(\frac{\pi ^4}{64}\right)-4\gamma\right) \end{align}

where I use special value of the digamma function

\begin{equation} \psi\!\left(\frac{1}{4}\right)=-\frac{\pi}{2}-3\log2-\gamma \end{equation}

and the reflection formula

\begin{equation} \psi\!\left(1-x\right)-\psi\!\left(x\right)=\pi\cot\pi x \end{equation}


  • $\begingroup$ nicely done! Where'd you to integrate like this? $\endgroup$ – clathratus Nov 5 '18 at 0:51

$$ \begin{align} \int_0^\infty\frac{1-e^{-x}(1+x)}{x(e^x-1)(e^x+e^{-x})}\,\mathrm{d}x &=\int_0^\infty\frac{e^x-(1+x)}{x(e^x-1)(e^{2x}+1)}\,\mathrm{d}x\tag{1}\\ &=\int_0^\infty\sum_{k=2}^\infty\frac{x^{k-1}}{k!}\frac1{(e^x-1)(e^{2x}+1)}\,\mathrm{d}x\tag{2}\\ &=\int_0^\infty\sum_{k=2}^\infty\frac{x^{k-1}}{k!}\,\frac12\left(\frac1{e^x-1}-\frac{1+e^x}{e^{2x}+1}\right)\mathrm{d}x\tag{3}\\ &=\int_0^\infty\sum_{k=2}^\infty\frac{x^{k-1}}{k!}\sum_{j=1}^\infty\left(e^{(1-4j)x}+e^{-4jx}\right)\mathrm{d}x\tag{4}\\ &=\sum_{j=1}^\infty\sum_{k=2}^\infty\left(\frac1{k(4j-1)^k}+\frac1{k(4j)^k}\right)\tag{5}\\ &=\sum_{j=1}^\infty\left[\log\left(\frac{4j-1}{4j-2}\right)-\frac1{4j-1}\right]\\ &+\sum_{j=1}^\infty\left[\log\left(\frac{4j}{4j-1}\right)-\frac1{4j}\right]\tag{6}\\ &=\sum_{j=1}^\infty\left[\log\left(\frac{j}{j-\frac12}\right)-\frac1{2j}+\frac14\left(\frac1j-\frac1{j-\frac14}\right)\right]\tag{7}\\[3pt] &=\log\left(\Gamma\left(\frac12\right)\right)-\frac\gamma2+\frac14H_{-1/4}\tag{8}\\[9pt] &=\frac12\log(\pi)-\frac\gamma2+\frac\pi8-\frac34\log(2)\tag{9} \end{align} $$ Explanation:
$(1)$: multiply numerator and denominator by $e^x$
$(2)$: expand $e^x-(1+x)$ into a power series
$(3)$: partial fractions
$(4)$: expand into a power series
$(5)$: perform the integration using the Gamma integral
$(6)$: use the power series for $\log(1+x)$
$(7)$: arithmetic
$(8)$: $\prod\limits_{k=1}^{n-1}(k+x)=\frac{\Gamma(n+x)}{\Gamma(1+x)}$, Gautschi's Inequality, $\lim\limits_{n\to\infty}\left(\sum\limits_{k=1}^n\frac1k-\log(n)\right)=\gamma$,
$\phantom{(8)\text{:}}$ and $(2)$ from this answer
$(9)$: $(11)$ from this answer

  • $\begingroup$ Thanks for your answer. This is pretty neat. (+1) $\endgroup$ – Sophie Agnesi Jun 9 '16 at 11:58
  • $\begingroup$ I really should post that transcript of Gautschi's paper, it's been years... :D $\endgroup$ – J. M. is a poor mathematician Jun 9 '16 at 13:01
  • $\begingroup$ @J.M.: That would be nice. I've been citing my answer; it would be nice to cite something in print. $\endgroup$ – robjohn Jun 10 '16 at 15:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.