Integral $\int_0^\infty \log(1+x^2)\frac{\cosh{\frac{\pi x}{2}}}{\sinh^2{\frac{\pi x}{2}}}\mathrm dx=2-\frac{4}{\pi}$ Hi I am trying to show$$
I:=\int_0^\infty \log(1+x^2)\frac{\cosh{\frac{\pi x}{2}}}{\sinh^2{\frac{\pi x}{2}}}\mathrm dx=2-\frac{4}{\pi}.
$$
Thank you.
What a desirable thing to want to prove!  It is a work of art this one.  I wish to prove this in as many ways as we can find. 
Note I tried writing
$$
I=\int_0^\infty \log(1+x^2)\coth \frac{\pi x}{2} \sinh^{-2} \frac{\pi x}{2}\mathrm dx
$$
but this didn't help me much.  We can also try introducing a parameter as follows
$$
I(\alpha)=\int_0^\infty \log(1+x^2)\frac{\cosh{\frac{\alpha \pi x}{2}}}{\sinh^2{\frac{\pi x}{2}}}\mathrm dx,
$$
But this is where I got stuck.  How can we calculate I?  Thanks.
 A: You can also use Fourier methods here, just as was done here, beginning from the form discussed above derived after an integration by parts.  Note that
$$\int_{-\infty}^{\infty} dx \, x \operatorname{csch}{(\pi x/2)} \, e^{i k x} = 2 \operatorname{sech^2}{\left ( k \right )} $$
Therefore, Parseval's equality implies that
$$I = \frac1{2 \pi} \int_0^{\infty} dk \, \pi \, e^{-k} 2 \operatorname{sech^2}{\left ( k \right )} $$
Integrate by parts to get that
$$I = \int_0^{\infty} dk \, e^{-k} \, \tanh{k} = \int_0^{\infty} dk \, e^{-k} \frac{1-e^{-2k}}{1+e^{-2k}}$$
Expand the denominator to evaluate the integral in terms of a sum:
$$I = \sum_{n=0}^{\infty} (-1)^n \int_0^{\infty} dk \, \left (e^{-(2 n+1) k}-e^{-(2 n+3) k} \right ) = \sum_{n=0}^{\infty} (-1)^n \left (\frac1{2 n+1}-\frac1{2 n+3} \right ) \\ = \frac{\pi}{4} - \left ( 1-\frac{\pi}{4} \right ) = \frac{\pi}{2}-1$$
as was to be shown.
ADDENDUM
It's only fair that I at least outline a proof of the first equation.  In fact, one uses symmetry to rewrite the integral as
$$\int_{-\infty}^{\infty} dx \, x \operatorname{csch}{(\pi x/2)} \, e^{i k x} = 2 \operatorname{Re}{\left [\int_0^{\infty} dx \, x \operatorname{csch}{(\pi x/2)} \, e^{i k x} \right ]} $$
Then use the definition of csch to turn the integral into a sum equal to
$$4 \sum_{n=0}^{\infty} \frac{\pi^2 (n+1/2)^2 - k^2}{[\pi^2 (n+1/2)^2 + k^2]^2} = \frac{2}{\pi^2} \sum_{n=-\infty}^{\infty} \frac{ (n+1/2)^2 - k^2/\pi^2}{[(n+1/2)^2 + k^2/\pi^2]^2}$$
The sum on the RHS may be evaluated using the Residue theorem; the sum is then equal to
$$-\frac{2}{\pi} \sum_{\pm} \left [\frac{d}{dz} \frac{[(z+1/2)^2-k^2/\pi^2] \cot{\pi z}}{(z+1/2\pm i k/\pi)^2} \right ]_{z=-\frac12 \pm i \frac{k}{\pi}} $$
which leads to the stated result.
A: $\newcommand{\+}{^{\dagger}}
 \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{\down}{\downarrow}
 \newcommand{\ds}[1]{\displaystyle{#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{\isdiv}{\,\left.\right\vert\,}
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}
 \newcommand{\ol}[1]{\overline{#1}}
 \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}
 \newcommand{\wt}[1]{\widetilde{#1}}$
$\ds{I\equiv\int_{0}^{\infty}\ln\pars{1 + x^{2}}\,
    {\cosh\pars{\pi x/2} \over \sinh^{2}\pars{\pi x/2}}\,\dd x = 2 - {4 \over \pi}:\
    {\large ?}}$

\begin{align}
I&=-\,{1 \over \pi}\int_{x\ \to\ -\infty}^{x\ \to\ \infty}\ln\pars{1 + x^{2}}
\,\dd\bracks{1 \over \sinh\pars{\pi x/2}}
={2 \over \pi}\int_{-\infty}^{\infty}
{1 \over \sinh\pars{\pi x/2}}\,{x \over x^{2} + 1}\,\dd x
\\[3mm]&={2 \over \pi}\bracks{%
2\pi\ic\sum_{n = 1}^{\infty}
{1 \over \pi\cosh\pars{n\pi\ic}/2}\,{2n\ic \over \pars{2n\ic}^{2} + 1}
+ 2\pi\ic\,{1 \over \sinh\pars{\pi\ic/2}}\,{\ic \over 2\ic}}
\\[3mm]&={16 \over \pi}\sum_{n = 1}^{\infty}\pars{-1}^{n}{n \over 4n^{2} - 1} + 2
=2 + {4 \over \pi}\bracks{%
\sum_{n = 1}^{\infty}{\pars{-1}^{n} \over 2n - 1}
+\sum_{n = 1}^{\infty}{\pars{-1}^{n} \over 2n + 1}}
\\[3mm]&=2 + {4 \over \pi}\bracks{%
-\sum_{n = 0}^{\infty}{\pars{-1}^{n} \over 2n + 1}
+\sum_{n = 1}^{\infty}{\pars{-1}^{n} \over 2n + 1}}
=2 + {4 \over \pi}\bracks{-1%
-\sum_{n = 1}^{\infty}{\pars{-1}^{n} \over 2n + 1}
+\sum_{n = 1}^{\infty}{\pars{-1}^{n} \over 2n + 1}}
\\[3mm]&=2 - {4 \over \pi}
\end{align}

$$\color{#00f}{\large%
\int_{0}^{\infty}\ln\pars{1 + x^{2}}\,
{\cosh\pars{\pi x/2} \over \sinh^{2}\pars{\pi x/2}}\,\dd x}=
\color{#00f}{\large 2 - {4 \over \pi}} \approx 0.7268
$$
A: As Lucian stated in the comments, integrating by parts shows that the integral is equivalent to showing that $$ \int_{0}^{\infty} \frac{x}{1+x^{2}} \frac{1}{\sinh \frac{\pi x}{2}} \ dx = \frac{\pi}{2}-1 .$$
Let $ \displaystyle f(z) = \frac{z}{1+z^{2}} \frac{1}{\sinh \frac{\pi z}{2}} $
and integrate around a rectangle with vertices at $\pm N$ and $\pm N+ i (2N+1)$ where $N$ is some positive integer.
As $N$ goes to infinity through the integers, the integral vanishes on the left and right sides of the rectangle and along the top of the rectangle.
In particular, the absolute value of the integral along the top of the rectangle is bounded by $$\frac{3N+1}{(2N+1)^{2}-1}\int_{-\infty}^{\infty} \frac{1}{\cosh \frac{\pi x}{2}} \ dx = \frac{6N+2}{(2N+1)^{2}-1} \to 0 \ \text{as} \ N \to \infty .$$
Then
$$\int_{-\infty}^{\infty} \frac{x}{1+x^{2}} \frac{1}{\sinh \frac{\pi x}{2}} \ dx = 2 \pi i \left(\text{Res}[f(z),i]+ \sum_{k=1}^{\infty} \text{Res}[f(z),2ki] \right)$$
where
$$ \text{Res}[f(z),i] = \lim_{z \to i} \frac{z}{z+i} \frac{1}{\sinh \frac{\pi x}{2}} =\frac{1}{2i}$$
and
$$ \text{Res}[f(z),2ki] = \lim_{z \to 2ki} \frac{z}{2z \sinh \frac{\pi z}{2}+(1+z^{2}) \frac{\pi}{2} \cosh \frac{\pi z}{2}} = \frac{4i}{\pi} \frac{(-1)^{k} k}{1-4k^{2}} . $$
And notice that
$$ \begin{align} \sum_{k=1}^{\infty} \frac{(-1)^{k} k}{1-4k^{2}} &= -\frac{1}{4} \sum_{k=1}^{\infty} \left( \frac{(-1)^{k}}{2k+1} + \frac{(-1)^{k}}{2k-1} \right) \\ &= -\frac{1}{4} \left(\arctan(1)-1 - \arctan(1) \right) \\ &= \frac{1}{4} . \end{align}$$
Therefore,
$$ \int_{-\infty}^{\infty} \frac{x}{1+x^{2}} \frac{1}{\sinh \frac{\pi x}{2}} \ dx = 2 \pi i \left(\frac{1}{2i} + \frac{i}{\pi} \right) = \pi - 2$$
which implies 
$$  \int_{0}^{\infty} \frac{x}{1+x^{2}} \frac{1}{\sinh \frac{\pi x}{2}} \ dx = \frac{\pi}{2} -1 .$$
A: I will solve the general form
\begin{align}\int^\infty_0\frac{x}{x^2+1}\frac{dx}{\sinh(ax)}&=\int^\infty_0\frac{x}{x^2+a^2}\frac{dx}{\sinh(x)}
\\&=\int^\infty_0 \int^\infty_0e^{-at} \frac{\sin(xt)}{\sinh(x)}\,dt \, dx\\&=\int^\infty_0 e^{-at}\int^\infty_0 \frac{\sin(xt)}{\sinh(x)} \, dx\,dt
 \\&=\frac{\pi}{2} \int^\infty_0 e^{-at}\tanh\left(\frac{\pi}{2} t\right)\,dt\\&=\int^\infty_0 e^{-zx}\tanh(x)\,dt \,\,\,\,; z=\frac{2}{\pi}a\\&=\int^\infty_0\frac{e^{-zx}(1-e^{-2x})}{e^{-2x}+1}\,dx\end{align}
By splitting the integral we have
\begin{align} \int^\infty_0\frac{e^{-zx}}{e^{-2x}+1}\,dx &= \sum_{n\geq 0}\int^\infty_0e^{-x(2n+z)}\,dx\\&=\sum_{n\geq 0}\frac{(-1)^n}{2n+z}\\&=\frac{1}{4}\left (\psi \left(\frac{1}{2}+\frac{z}{4}\right)-\psi \left(\frac{z}{4} \right) \right)\end{align}
\begin{align}-\int^\infty_0\frac{-e^{-x(z+2)}}{e^{-2x}+1}\,dx&=-\sum_{n\geq0}\frac{(-1)^n}{z+2+2n}\\&=-\frac{1}{4}\left(-\psi \left(\frac{1}{2}+\frac{z}{4}\right)+\psi\left(1+\frac{z}{4} \right) \right)\end{align}
Hence we have
\begin{align}\int^\infty_0\frac{x}{x^2+1}\frac{dx}{\sinh(ax)}&=\frac{1}{4}\left (2\psi \left(\frac{1}{2}+\frac{z}{4}\right)-\psi \left(1+\frac{z}{4}\right)-\psi \left(\frac{z}{4} \right) \right)\\&=\frac{1}{2}\psi \left(\frac{1}{2}+\frac{z}{4}\right)-\frac{1}{2}\psi \left(\frac{z}{4} \right)-z \\&=\frac{1}{2}\psi \left(\frac{1}{2}+\frac{a}{2\pi}\right)-\frac{1}{2}\psi \left(\frac{a}{2\pi} \right)-\frac{2}{\pi}a \end{align}
Let $a=\pi/2$
\begin{align}\int^\infty_0\frac{x}{x^2+1}\frac{dx}{\sinh(\frac{\pi}{2}x)}&=\frac{1}{2}\psi \left(\frac{1}{2}+\frac{1}{4}\right)-\frac{1}{2}\psi \left(\frac{1}{4} \right)-1\\&=\frac{\pi}{2} \cot(\pi/4)-1\\&=\frac{\pi}{2}-1\end{align}
