TITLE: Evaluate $\int_0^{\infty } \Bigl( 2qe^{-x}-\frac{\sinh (q x)}{\sinh \left(\frac{x}{2}\right)} \Bigr) \frac{dx}x$
QUESTION [8 upvotes]: Gradshteyn&Ryzhik $3.554.5$ states that:
$$\int_0^{\infty } \frac1x \biggl( 2qe^{-x}-\frac{\sinh (q x)}{\sinh \left(\frac{x}{2}\right)} \biggr) \, dx=\log\bigl(\cos (\pi  q) \bigr)+2 \log \left(\Gamma \bigl(q+\frac12 \bigr)\right)-\log (\pi )~, \quad q^2<\frac{1}{4}$$
It seems like to have sth to do with the Binet  representation of log-gamma function, but I haven't figured out how to solve it. Any kind of help will be appreciated.

REPLY [2 votes]: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
With $\ds{q \in \mathbb{R}}$, note that
\begin{align}
&\bbox[10px,#ffd]{\left.\int_{0}^{\infty}{1 \over x}\bracks{2q\expo{-x} -
{\sinh\pars{qx} \over \sinh\pars{x/2}}}\dd x
\,\right\vert_{{\large q\ \in\ \mathbb{R}} \atop
{\large q^{2}\ <\ 1/4}}}
\\[5mm] = &\
\left.\mrm{sgn}\pars{q}\int_{0}^{\infty}{1 \over x}
\bracks{2\verts{q}\expo{-x} -
{\sinh\pars{\verts{q}x} \over \sinh\pars{x/2}}}\dd x
\,\right\vert_{\ \verts{q}\ <\ 1/2}
\label{1}\tag{1}
\end{align}
The last integral becomes:
\begin{align}
&\!\!\!\!\!\!\!\!\!\!\bbox[10px,#ffd]{\int_{0}^{\infty}{1 \over x}\bracks{2\verts{q}\expo{-x} -
{\expo{-\pars{1/2 - \verts{q}}x} - \expo{-\pars{1/2 + \verts{q}}x} \over 1 - \expo{-x}}}\dd x}
\\[5mm] \stackrel{x\ =\ -\ln\pars{t}}{=} &\
\int_{1}^{0}{1 \over -\ln\pars{t}}\pars{2\verts{q}t -
{t^{1/2 - \verts{q}} -  t^{1/2 + \verts{q}} \over 1 - t}}
\pars{-\,{\dd t \over t}}
\\[5mm] = &\  \!\!\!\!
\int_{0}^{1}\!\!\underbrace{\bracks{-\,{1 \over \ln\pars{t}}}}
_{\ds{\int_{1}^{\infty}t^{\xi - 1}\,\dd\xi}}
{2\verts{q} - 2\verts{q}t - t^{-1/2 - \verts{q}} +  t^{-1/2 + \verts{q}}
\over 1 - t}\,
\dd t
\\[5mm] = &\!\!\!
\int_{1}^{\infty}\!\!\!\!\int_{0}^{1}\!\!
{2\verts{q}t^{\xi - 1} - 2\verts{q}t^{\xi} - t^{\xi - 3/2 - \verts{q}} +  t^{\xi - 3/2 + \verts{q}} \over 1 - t}\,\dd t\,\dd\xi
\\[5mm] = &\
\int_{1}^{\infty}\int_{0}^{1}\left[%
2\verts{q}\int_{0}^{1}{1 - t^{\xi} \over 1 - t}\,\dd t -
2\verts{q}\int_{0}^{1}{1 - t^{\xi - 1} \over 1 - t}\,\dd t\right.
\\[2mm] &\ \left. +\int_{0}^{1}{1 - t^{\xi - 3/2 - \verts{q}} \over 1 - t}\,\dd t -
\int_{0}^{1}{1 - t^{\xi - 3/2 + \verts{q}} \over 1 - t}\,\dd t
\right]\dd\xi
\\[5mm] = &\
\int_{1}^{\infty}\left[\vphantom{\huge A}\,%
2\verts{q}\Psi\pars{\xi + 1} - 2\verts{q}\Psi\pars{\xi}\right.
\\[2mm] & \phantom{\int_{1}^{\infty}\left[\right.}
\left. +\ \Psi\pars{\xi - {1 \over 2} - \verts{q}} -
\Psi\pars{\xi - {1 \over 2} + \verts{q}}\right]\dd\xi
\label{2}\tag{2}
\\[5mm] = &
\overbrace{\lim_{\xi \to \infty}\bracks{
2\verts{q}\ln\pars{\xi} + \ln\pars{\Gamma\pars{\xi - 1/2 - \verts{q}} \over \Gamma\pars{\xi - 1/2 + \verts{q}}}}}
^{\ds{=\ 0}}
\\[2mm] &\
+\ln\pars{\Gamma\pars{1/2 + \verts{q}} \over \Gamma\pars{1/2 - \verts{q}}}
\\[5mm] = &\
\ln\pars{\Gamma^{\, 2}\pars{1/2 + \verts{q}} \over
\Gamma\pars{1/2 + \verts{q}}\Gamma\pars{1/2 - \verts{q}}}
\\[5mm] = &\
\ln\pars{\Gamma^{\, 2}\pars{1/2 + \verts{q}} \over
\pi/\sin\pars{\pi\bracks{1/2 + q}}}\label{3}\tag{3}
\\[5mm] = &\
\bbx{\ln\pars{\cos\pars{\pi\verts{q}}} +
2\ln\pars{\Gamma\pars{\verts{q} + {1 \over 2}}}
- \ln\pars{\pi}}\label{4}\tag{4} \\ &
\end{align}
(\ref{2}): I used an integral representation
( see $\ds{\color{black}{\bf 6.3.22}}$ in A & S Table ) of the digamma $\ds{\mbox{function}\ \Psi}$.

(\ref{3}): Euler Reflection Formula. See
$\ds{\color{black}{\bf 6.1.17}}$ in A & S Table.

Finally, with (\ref{1}) and (\ref{4}):
\begin{align}
&\bbox[10px,#ffd]{\left.\int_{0}^{\infty}{1 \over x}\bracks{2q\expo{-x} -
{\sinh\pars{qx} \over \sinh\pars{x/2}}}\dd x
\,\right\vert_{{\large q\ \in\ \mathbb{R}} \atop
{\large q^{2}\ <\ 1/4}}}
\\[5mm] = &\
\bbox[25px,#ffd,border:1px groove navy]{\mrm{sgn}\pars{q}\bracks{\ln\pars{\cos\pars{\pi\verts{q}}} +
2\ln\pars{\Gamma\pars{\verts{q} + {1 \over 2}}}
- \ln\pars{\pi}}}
\\ &\
\end{align}