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

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.


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


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?