TITLE: Integral $\int_0^\infty \frac{\sin^2 ax}{x(1-e^x)}dx=\frac{1}{4}\log\left( \frac{2a\pi}{\sinh 2a\pi}\right)$
QUESTION [5 upvotes]: How can we prove this ${\it{interesting}}$ integral
$$
I:=\int_0^\infty \frac{\sin^2 ax}{x(1-e^x)}dx=\frac{1}{4}\log\left( \frac{2a\pi}{\sinh 2a\pi}\right)
$$
I to write
$$
I=\frac{1}{2}\int_0^\infty \frac{(1-\cos a x)}{x}dx \sum_{n=0}^\infty e^{nx}
$$
simplifying
$$
I=\frac{1}{2} \int_0^\infty \sum_{n=0}^\infty e^{nx}\frac{dx}{x} -\frac{1}{2}\int_0^\infty \frac{\cos a x}{x}dx \sum_{n=0}^\infty e^{nx}
$$
but didn't help much.  Thank you

REPLY [4 votes]: $\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}{\sin^{2}\pars{ax} \over x\pars{1 - \expo{x}}}\,\dd x
     ={1 \over 4}\,\ln\pars{2a\pi \over \sinh\pars{2a\pi}}:\ {\large ?}}$

\begin{align}
I&=\half\,\Re\int_{0}^{\infty}
{1 - \expo{2\ic ax} \over 1 - \expo{x}}\,\int_{0}^{\infty}\expo{-xt}\,\dd t\,\dd x
=-\,\half\,\Re\int_{0}^{\infty}
\int_{0}^{\infty}{\pars{1 - \expo{2\ic ax}}\expo{-x} \over 1 - \expo{-x}}\,
\expo{-tx}\,\dd x\,\dd t
\\[3mm]&=-\,\half\,\Re\int_{0}^{\infty}
\sum_{n = 0}^{\infty}\int_{0}^{\infty}\bracks{%
\expo{-\pars{n + 1 + t}x} - \expo{-\pars{n + 1 + t - 2\ic a}x}}\,\dd x\,\dd t
\\[3mm]&=-\,\half\,\Re\int_{0}^{\infty}\sum_{n = 0}^{\infty}\bracks{%
{1 \over n + 1 + t} - {1 \over n + 1 + t - 2\ic a}}\,\dd x\,\dd t
\\[3mm]&=-\,\half\,\Re\int_{0}^{\infty}\bracks{{1 \over -2\ic a}
\sum_{n = 0}^{\infty}{1 \over \pars{n + 1 + t}\pars{n + 1 + t - 2\ic a}}}\,\dd t
\\[3mm]&=\half\,\Re\int_{0}^{\infty}\bracks{\Psi\pars{1 + t} - \Psi\pars{1 + t - 2\ic a}}
\,\dd t
\end{align}
  where $\ds{\Psi\pars{z} \equiv \totald{\ln\pars{\Gamma\pars{z}}}{z}}$ is the
  Digamma Function ${\bf\mbox{6.3.1}}$ and we have used the identity ${\bf\mbox{6.3.16}}$. $\ds{\Gamma\pars{z}}$ is the
  Gamma Function ${\bf\mbox{6.1.1}}$.

With Stirling Asymptotic Formula
${\bf\mbox{6.1.41}}$:
$$
I=\half\,\bracks{\overbrace{%
\Re\lim_{t \to \infty}\ln\pars{\Gamma\pars{1 + t} \over \Gamma\pars{1 + t - 2\ic a}}}
^{\ds{=\ 0}}
+\Re\ln\pars{\Gamma\pars{1 - 2\ic a}}}
$$

With identities
  ${\bf\mbox{6.1.28}}$ and ${\bf\mbox{6.1.29}}$:
  \begin{align}
I&=\half\,{\ln\pars{\Gamma\pars{1 - 2\ic a}\Gamma\pars{1 + 2\ic a}} \over 2}
={1 \over 4}\,
\ln\pars{\pars{-2\ic a}\Gamma\pars{-2\ic a}\pars{2\ic a}\Gamma\pars{2\ic a}}
\\[3mm]&={1 \over 4}\,\ln\pars{4a^{2}\verts{\Gamma\pars{2\ic a}}^{2}}
={1 \over 4}\,\,\ln\pars{4a^{2}\,{\pi \over 2a\sinh\pars{2\pi a}}}
\end{align}

$$\color{#00f}{\large%
I\equiv\int_{0}^{\infty}{\sin^{2}\pars{ax} \over x\pars{1 - \expo{x}}}\,\dd x={1 \over 4}\,\ln\pars{2a\pi \over \sinh\pars{2a\pi}}}
$$