TITLE: Find the value of $\int\limits_0^{+\infty} \frac{(\coth x-1)(x\coth x-1)}{x} dx$
QUESTION [6 upvotes]: Recently I went across an interesting integral $$\int\limits_0^{+\infty} \frac{(\coth x-1)(x\coth x-1)}{x} dx,$$
which numerically seems to equal $1+\gamma-\ln(2\pi)$. How can we prove it? I tried using the expansion $$\coth x=\frac1x+\sum_{n=1}^\infty\frac{2x}{x^2+\pi^2n^2},$$ but didn't succeed. Any other ways to approach this?

REPLY [7 votes]: Another approach using the limits of Gamma and Zeta functions: 
$$ \coth{x}=\frac{e^{x}+e^{-x}}{e^{x}-e^{-x}}=\frac{e^{2x}+1}{e^{2x}-1}=1+\frac{2}{e^{2x}-1} $$ 
Hence: 
$$ 
\begin{align} 
I&=\int_{0}^{\infty}\left(\coth{x}-1\right)\left(\coth{x}-1/x\right)\,dx \\[2mm] 
&=\int_{0}^{\infty}\coth^2{x}-\coth{x}-\coth{x}/x+1/x\,\,\,dx \\[2mm] 
&=\int_{0}^{\infty}\frac{4}{(e^{2x}-1)^2}+\frac{2-2/x}{e^{2x}-1}\,\,\,dx =\int_{0}^{\infty}\frac{2}{(e^x-1)^2}+\frac{1-2/x}{e^x-1}\,\,\,dx \\[2mm] 
&=\int_{0}^{\infty}\frac{2}{(e^x-1)^2}+\frac{1-2/x}{e^x-1}\,+\frac{2e^x-2e^x}{(e^x-1)^2}+\frac{2-2}{x^2}+\frac{1-1}{xe^x}\,\,\,dx \\[2mm] 
&=\color{red}{\int_{0}^{\infty}\left(\frac{2e^x}{(e^x-1)^2}-\frac{2}{x^2}\right)\,dx} -\color{blue}{\int_{0}^{\infty}\left(\frac{1}{e^x-1}-\frac{1}{xe^x}\right)\,dx} -\color{magenta}{\int_{0}^{\infty}\frac1x\left(\frac{2}{e^x-1}-\frac{2}{x}+\frac{1}{e^x}\right)\,dx} \\[2mm] 
&=\color{red}{\lim_{x\to0}\left[2\Gamma(x+1)\zeta(x)\right]} -\color{blue}{\lim_{x\to0}\left[\Gamma(x+1)\zeta(x+1)-\Gamma(x)\right]} -\color{magenta}{\lim_{x\to0}\left[2\Gamma(x)\zeta(x)+\Gamma(x)\right]} \\[2mm] 
&=\color{red}{-1}\color{blue}{-\gamma}\color{magenta}{+\log{2\pi}} 
\end{align} 
$$ 

Where $\,\displaystyle{\Gamma(s)\zeta(s)=\int_{0}^{\infty}x^{s-1}\left(\frac{1}{e^x-1}-\frac{1}{x}\right)dx\space\colon\space\Re{s}\in(0,1)}\,$
& IBP $\,\displaystyle{\left\{u=\frac{1}{e^x-1}-\frac{1}{x},\,dv=x^{s-1}\right\}}\,$ gives the first (red) term.