Proving $\int_{0}^{\infty}\frac{x}{(x^2+1)(e^{2\pi x}+1)} dx=1-\frac{\gamma}{2}-\ln2$

$$\int_{0}^{\infty}\frac{x}{(x^2+1)(e^{2\pi x}+1)} dx=1-\frac{\gamma}{2}-\ln2$$

where $\gamma$ is The Euler–Mascheroni constant.

A Generalisation: \begin{align} \int^\infty_0\frac{x}{(x^2+w^2)(1+e^{2\pi x})}{\rm d}x\tag1 =&\int^\infty_0\frac{xe^{-x}}{(x^2+4\pi^2w^2)(1+e^{-x})}{\rm d}x\\ \tag2 =&\int^\infty_0\frac{x}{x^2+4\pi^2w^2}\left(\sum^\infty_{n=1}(-1)^{n-1}e^{-nx}\right){\rm d}x\\ \tag3 =&\int^\infty_0xe^{-x}\left(\sum^\infty_{n=1}\frac{(-1)^{n-1}}{x^2+4n^2\pi^2w^2}\right){\rm d}x\\ =&\int^\infty_0\frac{e^{-x}}{2x}-\frac{e^{-x}}{4w}\mathrm{csch}\left(\frac{x}{2w}\right){\rm d}x\tag4\\ =&-\frac{1}{2}\int^1_0\frac{1}{\ln{x}}+\frac{x^{1/2w}}{w(1-x^{1/w})}\ {\rm d}x\tag5\\ =&-\frac{1}{2}\int^1_0\frac{x^{w-1}}{\ln{x}}+\frac{x^{w-1/2}}{1-x}{\rm d}x\tag6\\ =&-\frac{1}{2}\int^0_\infty\int^1_0x^{t+w-1}+\frac{x^{t+w-1/2}\ln{x}}{1-x}\ {\rm d}x\ {\rm d}t\tag7\\ =&-\frac{1}{2}\int^0_\infty\frac{1}{t+w}-\psi_1\left(t+w+\frac{1}{2}\right)\ {\rm d}t\tag8\\ =&\boxed{\large{\color{blue}{\displaystyle\frac{1}{2}\psi_0\left(w+\frac{1}{2}\right)-\frac{1}{2}\ln{w}}}}\\ \end{align}

Explanation:

$(1)$: Substituted $x\mapsto\dfrac{x}{2\pi}$.
$(2)$: Expanded $\dfrac{1}{1+e^{-x}}$ as a geometric series.
$(3)$: Substituted $x\mapsto\dfrac{x}{n}$.
$(4)$: One can show that $\displaystyle\sum^\infty_{n=-\infty}\frac{(-1)^n}{x^2+4n^2\pi^2w^2}=\frac{1}{2wx}\mathrm{csch}\left(\frac{x}{2w}\right)$ using the residue theorem.
$(5)$: Substituted $x\mapsto-\ln{x}$.
$(6)$: Substituted $x\mapsto x^w$.
$(7)$: Used the fact that $\displaystyle\frac{1}{\ln{x}}=\int^0_\infty x^{t}\ {\rm d}t$.
$(8)$: Used the integral representation of the polygamma function.

The Integral:

Let $w=1$ to get $$\int^\infty_0\frac{x}{(x^2+1)(e^{2\pi x}+1)}{\rm d}x=\frac{1}{2}\psi_0\left(\frac32\right)=\boxed{\large{\color{red}{\displaystyle 1-\frac{\gamma}{2}-\ln{2}}}}$$

• Nice Answer, i know that this would work out this way. But i was wondering about a contour integration method for this problem, but failed. Dec 18, 2014 at 16:53
• Excellent answer! Thank you for your detailed answer and thank you very [email protected]. Dec 18, 2014 at 17:00
• @mnce i thought about that, but i thought the arcs will not vanish fast enough for $\Re[z]$ goes to $-\infty$ Dec 18, 2014 at 17:07

Here is an elementary way to evaluate the integral without involving any special functions or advance formulas. Notice that $$\int_0^\infty e^{-y}\sin(xy)\;\mathrm dy=\frac{x}{1+x^2}$$ Hence we have \begin{align} \int_0^\infty \frac{x}{\left(1+x^2\right)\left(e^{2\pi x}+1\right)}\,\mathrm dx&=\int_0^\infty\int_0^\infty \frac{e^{-y}\sin(xy)}{e^{2\pi x}+1}\mathrm dy\;\mathrm dx\\[7pt] &=\int_0^\infty e^{-y}\int_0^\infty \frac{\sin(xy)}{e^{2\pi x}+1}\mathrm dx\;\mathrm dy \end{align} One may use the following technique to evaluate the inner integral \begin{align} \int_0^\infty \frac{\sin(xy)}{e^{2\pi x}+1}\mathrm dx&=\int_0^\infty \frac{e^{-2\pi x}\sin(xy)}{1+e^{-2\pi x}}\mathrm dx\\[7pt] &=\sum_{k=1}^\infty(-1)^{k-1}\int_{0}^{\infty} e^{-2\pi kx}\sin (xy)\;\mathrm dx\\[7pt] &=\sum_{k=1}^\infty(-1)^{k-1}\frac{y}{4\pi^2k^2+y^2}\\[7pt] &=\frac{1}{4}\left[\frac{2}{y}-\operatorname{csch}\left(\frac{y}{2}\right)\right] \end{align} then we obtain \begin{align} \int_0^\infty \frac{x}{\left(1+x^2\right)\left(e^{2\pi x}+1\right)}\,\mathrm dx&=\frac{1}{4}\int_{0}^{\infty} e^{- y}\left[\frac{2}{y}-\operatorname{csch}\left(\frac{y}{2}\right)\right]\mathrm dy\\[7pt] &=\frac{1}{2}\int_{0}^{\infty} e^{- y}\left[\frac{1}{y}-\frac{e^{-y/2}}{1-e^{-y}}\right]\mathrm dy\\[7pt] &=\frac{1}{2}\int_{0}^{\infty} e^{- y}\left[\frac{1}{y}-\frac{1}{1-e^{-y}}+\frac{e^{y/2}}{1+e^{y/2}}\right]\mathrm dy\\[7pt] &=\frac{1}{2}\underbrace{\int_{0}^{\infty} \left[\frac{e^{- y}}{y}-\frac{1}{e^{y}-1}\right]\mathrm dy}_{\large\color{blue}{(*)}}+\frac{1}{2}\int_{0}^{\infty} \frac{e^{-y/2}}{1+e^{y/2}}\mathrm dy\\[7pt] &=-\frac{\gamma}{2}+\frac{1}{2}\int_{0}^{\infty} \left[e^{-y/2}-\frac{e^{-y/2}}{1+e^{-y/2}}\right]\mathrm dy\\[7pt] &=\bbox[5pt,border:3px #FF69B4 solid]{\color{red}{\large1-\frac{\gamma}{2}-\ln2}} \end{align} where $\color{blue}{(*)}$ is the integral representation of the Euler–Mascheroni constant.

• $\displaystyle+\left\lfloor\frac\pi2\right\rfloor$ Wow! Dec 18, 2014 at 17:15
• Excellent! At first, I want to do it with double integral,but failed. Now,I know how to do it with double integral. Thank you very much@Venus. Dec 18, 2014 at 17:54
• @gcy-rolle You're welcome. I just come late to the party Dec 18, 2014 at 17:55
• I got my first downvote in my answer on Math SE. Not only one, but two downvotes. LOL Dec 19, 2014 at 14:55

Hint: make use of the Binet's second formula http://mathworld.wolfram.com/BinetsLogGammaFormulas.html. $$\int_{0}^{\infty}\frac{x}{(x^2+1)(e^{2\pi x}+1)} dx$$ $$=\int_{0}^{\infty}\frac{x}{(x^2+1)(e^{2\pi x}-1)} dx-2\int_{0}^{\infty}\frac{x}{(x^2+1)(e^{4\pi x}-1)} dx$$ $$=\int_{0}^{\infty}\frac{x}{(x^2+1)(e^{2\pi x}-1)} dx-\frac{1}{2}\int_{0}^{\infty}\frac{x}{((x/2)^2+1)(e^{2\pi x}-1)} dx$$

Now, we see that

$$\frac{\partial}{\partial z}\left(\int_0^{\infty} \frac{\arctan(x/z)}{e^{2 \pi x}-1} \ dx\right)=-\int_0^{\infty}\frac{x}{\displaystyle \left(e^{2 \pi x}-1\right) z^2 \left(\frac{x^2}{z^2}+1\right)} \ dx$$

Can you take it from here?

• $+1$ For converting $-1$ to $+1$ Dec 18, 2014 at 15:51
• Awesome! I know what you mean and we can get the integral by your method,thank you very much@Chris's sis. Dec 18, 2014 at 16:43

$\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle} \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace} \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack} \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,} \newcommand{\dd}{{\rm d}} \newcommand{\ds}[1]{\displaystyle{#1}} \newcommand{\dsc}[1]{\displaystyle{\color{red}{#1}}} \newcommand{\expo}[1]{\,{\rm e}^{#1}\,} \newcommand{\fermi}{\,{\rm f}} \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,} \newcommand{\half}{{1 \over 2}} \newcommand{\ic}{{\rm i}} \newcommand{\iff}{\Longleftrightarrow} \newcommand{\imp}{\Longrightarrow} \newcommand{\Li}[1]{\,{\rm Li}_{#1}} \newcommand{\norm}[1]{\left\vert\left\vert\, #1\,\right\vert\right\vert} \newcommand{\pars}[1]{\left(\, #1 \,\right)} \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}} \newcommand{\pp}{{\cal P}} \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,} \newcommand{\sech}{\,{\rm sech}} \newcommand{\sgn}{\,{\rm sgn}} \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}} \newcommand{\ul}[1]{\underline{#1}} \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$ \begin{align}&\color{#66f}{\large% \int_{0}^{\infty}{x\,\dd x \over \pars{x^{2} + 1}\pars{\expo{2\pi x} + 1}}\,\dd x} \\[5mm]&=\int_{0}^{\infty}{x \over \pars{x^{2} + 1}} \pars{{1 \over \expo{2\pi x} + 1} - {1 \over \expo{2\pi x} - 1}}\,\dd x +\int_{0}^{\infty}{x\,\dd x \over \pars{x^{2} + 1}\pars{\expo{2\pi x} - 1}} \\[5mm]&=-2\int_{0}^{\infty} {x\,\dd x \over \pars{x^{2} + 1}\pars{\expo{4\pi x} - 1}} +\int_{0}^{\infty}{x\,\dd x \over \pars{x^{2} + 1}\pars{\expo{2\pi x} - 1}} \\[5mm]&=-2\int_{0}^{\infty} {x\,\dd x \over \pars{x^{2} + 4}\pars{\expo{2\pi x} - 1}} +\int_{0}^{\infty}{x\,\dd x \over \pars{x^{2} + 1}\pars{\expo{2\pi x} - 1}} \end{align}

With identity ${\bf 6.3.21}$: $$\int_{0}^{\infty}{x\,\dd x \over \pars{x^{2} + z^{2}}\pars{\expo{2\pi x} - 1}} =\half\bracks{\ln\pars{z} - {1 \over 2z} - \Psi\pars{z}}$$ we'll get

\begin{align}&\color{#66f}{\large% \int_{0}^{\infty}{x\,\dd x \over \pars{x^{2} + 1}\pars{\expo{2\pi x} + 1}}\,\dd x} \\[5mm]&=-2\braces{% \half\bracks{\ln\pars{z} - {1 \over 2z} - \Psi\pars{z}}_{z\ =\ 2}} +\half\bracks{\ln\pars{z} - {1 \over 2z} - \Psi\pars{z}}_{z\ =\ 1} \\[5mm]&=-\ln\pars{2} + {1 \over 4} +\ \overbrace{\Psi\pars{2}}^{\dsc{\Psi\pars{1} + 1}} -{1 \over 4} - \half\ \overbrace{\Psi\pars{1}}^{\dsc{-\gamma}} =\color{#66f}{\large 1 - {\gamma \over 2} - \ln\pars{2}} \end{align}

• @MathNoob Please check my new answer. Thanks for call my attention to my mistake. Dec 20, 2014 at 4:33
• Nice answer. Thank you very much@ Felix Marin. Dec 20, 2014 at 7:52
• @gcy-rolle You're welcome. It's nice it was useful for you. Dec 20, 2014 at 8:56

I give a proof of
$$\int^{\infty}_{0}\frac{x}{x^2+a^2}\frac{1}{e^{2\pi x}-1}dx=-\frac{1}{2}\psi(a)-\frac{1}{4a}+\frac{\log(a)}{2}$$

We use the sine Fourier transforms: $$\frac{x}{x^2+a^2}\leftrightarrow \sqrt{\frac{\pi}{2}}e^{-aw}$$ and $$\frac{1}{e^{2\pi x}-1}\leftrightarrow \frac{1}{\sqrt{2 \pi}}\frac{-1+w\coth(w/2)}{2w}$$ Then we can write $$I=\int^{\infty}_{0}\frac{x}{x^2+a^2}\frac{1}{e^{2\pi x}-1}dx=$$ $$=\int^{\infty}_{0}\frac{w\coth(w/2)-2}{4w}e^{-a w}dw=$$ $$=-\frac{1}{4a}-\frac{1}{2}\frac{\Gamma'(a)}{\Gamma(a)}+\frac{\log(a)}{2}.$$ Since $$\int^{\infty}_{h}\frac{e^{-a w}}{w}dw=\int^{\infty}_{ah}\frac{e^{-t}}{t}dt=-e^{-ah}\log(ah)+\int^{\infty}_{ah}e^{-t}\log(t)dt\textrm{ : }\textrm{(1)}$$ and $$\frac{1}{4}\int^{\infty}_{h}\coth(w/2)e^{-aw}dw=\frac{1}{4}\int^{e^{-h}}_0\frac{t^{a-1}(1+t)}{1-t}dt=$$ $$=\frac{1}{4}\int^{e^{-h}}_{0}\left(\frac{t^{a-1}}{1-t}-\frac{1}{1-t}\right)dt+\frac{1}{4}\int^{e^{-h}}_{0}\left(\frac{t^a}{1-t}-\frac{1}{1-t}\right)dt-\frac{1}{2}\log\left(1-e^{-h}\right)=$$ $$=\frac{1}{4}\sum^{\infty}_{k=0}\left(\frac{e^{-(k+a)h}}{k+a}-\frac{e^{-(k+1)h}}{k+1}\right) +\frac{1}{4}\sum^{\infty}_{k=0}\left(\frac{e^{-(k+a+1)h}}{k+a+1}-\frac{e^{-(k+1)h}}{k+1}\right)-$$ $$-\frac{1}{2}\log\left(1-e^{-h}\right)\textrm{ : }\textrm{(2)}$$ From (1) and (2) we have (taking $h\rightarrow 0$): $$I=\frac{-1}{4}\{\gamma+\psi(a)+\gamma+\psi(a+1)\}-\frac{1}{2}\lim_{h\rightarrow 0}\left(\log(1-e^{-h})-e^{-ah}\log(ah)\right)+\frac{\gamma}{2}=$$ $$=-\frac{1}{2}\psi(a)-\frac{1}{4a}+\frac{\log(a)}{2}.$$ Where we have used $\int^{\infty}_{0}e^{-t}\log(t)dt=-\gamma$.