Integrate: $\int_0^{\infty} \frac{\sin (ax)}{e^{\pi x} \sinh(\pi x)}dx$ How to evaluate the following 
$$\int_0^{\infty} \frac{\sin (ax)}{e^{\pi x} \sinh(\pi x)} dx $$
Given hints says to construct a rectangle $0\to R\to R+i\to i \to 0$ and consider $\displaystyle f(z):=\frac{e^{iaz}}{e^{2\pi z}-1} $ and evaluate around it but that does not help.
ADDED:: I need to evaluate it with method of contour.
Particularly using given hint on book, when I integrate $i \to 0$, the integral does not converge. Also, real part of $\displaystyle f(z):=\frac{e^{iaz}}{e^{2\pi z}-1} $ does not converge around $0$.
Also I considered $\displaystyle f(z):=\frac{e^{iaz}-e^{-iaz}}{e^{2\pi x}-1} $, and integrate from $-R \to R \to R+i \to -R+ i \to R$ and I get $\displaystyle \int_{-\infty}^\infty f(z) dz$ but the function is not symmetric about $0$. 
If I consider $\displaystyle f(z):=\frac{e^{iaz}}{e^{2\pi x}-1} $ around the path $-R - i \to R - i \to R + i \to -R +i \to -R -i $, I again end up with $\displaystyle \int_{-\infty}^{\infty}f(z) dz$ and I cannot extract $\int_0^{\infty}$ due to  function is not symmetric at $0$ because of $e^{2\pi z}$ at the denominator.
Please help!! 
 A: For the contour you describe in your text, you have to indent about the poles at $z=0$ and $z=1$.  In that case, the contour integral
$$\oint_C dz \frac{e^{i a z}}{e^{2 \pi z}-1}$$
is split into $6$ segments:
$$\int_{\epsilon}^R dx \frac{e^{i a x}}{e^{2 \pi x}-1} + i \int_{\epsilon}^{1-\epsilon} dy \frac{e^{i a R} e^{-a y}}{e^{2 \pi R} e^{i 2 \pi y}-1} + \int_R^{\epsilon} dx \frac{e^{-a} e^{i a x}}{e^{2 \pi x}-1} \\+ i \int_{1-\epsilon}^{\epsilon} dy \frac{ e^{-a y}}{e^{i 2 \pi y}-1} + i \epsilon \int_{\pi/2}^0 d\phi \:e^{i \phi} \frac{e^{i a \epsilon e^{i \phi}}}{e^{2 \pi \epsilon e^{i \phi}}-1}+ i \epsilon \int_{2\pi}^{3 \pi/2} d\phi\: e^{-a} e^{i \phi} \frac{e^{i a \epsilon e^{i \phi}}}{e^{2 \pi \epsilon e^{i \phi}}-1}$$
The first integral is on the real axis, away from the indent at the origin.  The second integral is along the right vertical segment. The third is on the horizontal upper segment.  The fourth is on the left vertical segment.  The fifth is around the lower indent (about the origin), and the sixth is around the upper indent, about $z=i$.
We will be interested in the limits as $R \rightarrow \infty$ and $\epsilon \rightarrow 0$.  The first and third integrals combine to form, in this limit,
$$(1-e^{-a}) \int_0^{\infty} dx \frac{e^{i a x}}{e^{2 \pi x}-1}$$
The fifth and sixth integrals combine to form, as $\epsilon \rightarrow 0$:
$$\frac{i \epsilon}{2 \pi \epsilon} \left ( -\frac{\pi}{2}\right) + e^{-a} \frac{i \epsilon}{2 \pi \epsilon} \left ( -\frac{\pi}{2}\right) = -\frac{i}{4} (1+e^{-a}) $$
The second integral vanishes as $R \rightarrow \infty$.  The fourth integral, however, does not, and must be evaluated, at least partially.  We rewrite it, as $\epsilon \rightarrow 0$:
$$-\frac{1}{2} \int_0^1 dy \frac{e^{-a y} e^{- i \pi y}}{\sin{\pi y}} = -\frac{1}{2} PV\int_0^1 dy \: e^{-a y} \cot{\pi y} + \frac{i}{2} \frac{1-e^{-a}}{a}$$
where
$$PV\int_0^1 dy \: e^{-a y} \cot{\pi y} = \lim_{\epsilon \to 0} \int_{\epsilon}^{1-\epsilon} dy \: e^{-a y} \cot{\pi y}$$
is the Cauchy principal value of that integral.  By Cauchy's theorem, the contour integral is zero because there are no poles within the contour.  Thus,
$$(1-e^{-a}) \int_0^{\infty} dx \frac{e^{i a x}}{e^{2 \pi x}-1} -\frac{i}{4} (1+e^{-a}) -\frac{1}{2} PV \int_0^1 dy \: e^{-a y} \cot{\pi y} + \frac{i}{2} \frac{1-e^{-a}}{a}=0$$
Now take the imaginary part of the above equation - note that the nasty Cauchy PV integral drops out - and get
$$(1-e^{-a}) \int_0^{\infty} dx \frac{\sin{ a x}}{e^{2 \pi x}-1} = \frac{1}{4} (1+e^{-a})-\frac{1}{2} \frac{1-e^{-a}}{a}$$
or, after a little algebra and simplifying things, we get:
$$\int_0^{\infty} dx \frac{\sin{ a x}}{e^{2 \pi x}-1} = \frac14 \coth{\left (\frac{a}{2}\right )} - \frac{1}{2 a}$$
A: Well, it's not the direct answer on you questions (because you were given a direct hint in the link above), but an alternative way.
You can look at it like the Laplace transform:
$$\int_0^{\infty} \frac{\sin (ax)}{e^{\pi x} \sinh(\pi x)} dx=2\int_0^{\infty} \frac{\sin (ax)}{1-e^{-2\pi x}}e^{-2\pi x} dx=2\int_0^{\infty} f(x)e^{-sx} dx$$
with $f(x)=\frac{\sin (ax)}{1-e^{-2\pi x}}$ and $s=2\pi$.
The Laplace transform for $f(x)$ (valid when $\left| \Im(a)\right| <2 \pi$):
$$ \mathcal{L}\left\{\frac{\sin (ax)}{1-e^{-2\pi x}}\right\}=\frac{\psi ^{(0)}\left(\frac{i a+s}{2 \pi }\right)-\psi ^{(0)}\left(\frac{-i a+s}{2 \pi }\right)}{4 \pi  i}$$ 
where $\psi ^{(0)}(\cdot)$ is the digamma function.
Setting $s=2\pi$, multiplying by 2 and simplifying one can obtain:
$$\int_0^{\infty} \frac{\sin (ax)}{e^{\pi x} \sinh(\pi x)} dx=\frac{1}{2}\coth\left(\frac{a}{2}\right) -\frac{1}{a}$$
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{\int_{0}^{\infty}{\sin\pars{ax} \over \expo{\pi x}\sinh\pars{\pi x}}\,\dd x
     :\ {\large ?}}$

\begin{align}
&\bbox[#ffd,5px]{%
\int_{0}^{\infty}{\sin\pars{ax} \over
\expo{\pi x}\sinh\pars{\pi x}}\,\dd x} =
2\int_{0}^{\infty}{\sin\pars{ax} \over
\expo{2\pi x} - 1}\,\dd x
\\[5mm] = &\
2\sgn\pars{a}\int_{0}^{\infty}{%
{\expo{-\verts{a}\pars{\ic x}} -
\expo{-\verts{a}\pars{-\ic x}}} \over -2\ic}\,
{\dd x \over \expo{2\pi x} - 1}
\\[5mm]= &\
\sgn\pars{a}\bracks{\ic\int_{0}^{\infty}
{\fermi\pars{\ic x} - \fermi\pars{-\ic x} \over \expo{2\pi x} - 1}\,\dd x}
\\[2mm] &\
\mbox{where}\
\fermi\pars{x} \equiv \expo{-\verts{a}x}
\end{align}
Now, we use Abel-Plana Formula to reduce the integration in a simple fashion:
\begin{align}
&\bbox[#ffd,5px]{%
\int_{0}^{\infty}{\sin\pars{ax} \over
\expo{\pi x}\sinh\pars{\pi x}}\,\dd x}
\\[5mm] = &\
\sgn\pars{a}\bracks{%
\sum_{n = 0}^{\infty}\fermi\pars{n} -\int_{0}^{\infty}\fermi\pars{x}\,\dd x
-\half\,\fermi\pars{0}}
\\[5mm] = &\
\sgn\pars{a}\bracks{\sum_{n = 0}^{\infty}\expo{-\verts{a}n}
-\int_{0}^{\infty}\expo{-\verts{a}x}\,\dd x
-\half\,\pars{\expo{-\verts{a}x}}_{x = 0}}
\\[5mm] = &\
\sgn\pars{a}\bracks{%
{1 \over 1 - \expo{-\verts{a}}} - {1 \over \verts{a}} - \half}
\\[5mm] = &\
\sgn\pars{a}\bracks{%
{1 + \expo{-\verts{a}} \over 2\pars{1 - \expo{-\verts{a}}}} - {1 \over \verts{a}}}
\\[5mm] = &\
\sgn\pars{a}\bracks{%
\half\,{\expo{\verts{a}/2} + \expo{-\verts{a}/2} \over \expo{\verts{a}/2} - \expo{-\verts{a}}} - {1 \over \verts{a}}}
\\[5mm] = &\
\sgn\pars{a}\bracks{\half\,\coth\pars{\verts{a} \over 2} - {1 \over \verts{a}}}
\end{align}

\begin{align}
&\bbox[#ffd,5px]{%
\int_{0}^{\infty}{\sin\pars{ax} \over
\expo{\pi x}\sinh\pars{\pi x}}\,\dd x} =
\bbox[10px,border:1px groove navy]{ -\,{1 \over a} + \half\,\coth\pars{a \over 2}} \\ &
\end{align}
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{\int_{0}^{\infty}{\sin\pars{ax} \over \expo{\pi x}\sinh\pars{\pi x}}\,\dd x
     :\ {\large ?}}$

${\tt\mbox{Besides}}$ my previous answer,
  ${\tt\mbox{we'll show another method to evaluate this integral.}}$

\begin{align}&\color{#c00000}{%
\int_{0}^{\infty}{\sin\pars{ax} \over \expo{\pi x}\sinh\pars{\pi x}}\,\dd x}
=-\ic\sgn\pars{a}\int_{0}^{\infty}\expo{-\pars{2\pi\ -\ \verts{a}\ic}x}\,{%
1 - \expo{-2\verts{a}x\ic} \over 1 - \expo{-2\pi x}}\,\dd x
\end{align}

Set $\ds{\expo{-2\pi x} \equiv t\quad\imp\quad x = -\,{\ln\pars{t} \over 2\pi}}$:
  \begin{align}
&\color{#c00000}{%
\int_{0}^{\infty}{\sin\pars{ax} \over \expo{\pi x}\sinh\pars{\pi x}}\,\dd x}
=-\ic\sgn\pars{a}\int_{1}^{0}t^{1\ -\ \verts{a}\,\ic/\pars{2\pi}}\,
{1 - t^{\verts{a}\ic/\pi} \over 1 - t}\,\pars{-\,{\dd t \over 2\pi t}}
\\[3mm]&=-\ic\,{\sgn\pars{a} \over 2\pi}\int_{0}^{1}
{t^{-\verts{a}\ic/\pars{2\pi}} - t^{\verts{a}\ic/\pars{2\pi}} \over 1 - t}\,\dd t
\\[3mm]&=-\ic\,{\sgn\pars{a} \over 2\pi}\,\bracks{%
\int_{0}^{1}{1 - t^{\verts{a}\ic/\pars{2\pi}} \over 1 - t}\,\dd t
-
\int_{0}^{1}{1 - t^{-\verts{a}\ic/\pars{2\pi}} \over 1 - t}\,\dd t}
\\[3mm]&=-\ic\,{\sgn\pars{a} \over 2\pi}\,\bracks{2\ic\,\Im
\int_{0}^{1}{1 - t^{\verts{a}\ic/\pars{2\pi}} \over 1 - t}\,\dd t}
={\sgn\pars{a} \over \pi}\,\Im\int_{0}^{1}
{1 - t^{\verts{a}\ic/\pars{2\pi}} \over 1 - t}\,\dd t\tag{1}
\end{align}

Now, we'll use the identity ${\bf\mbox{6.3.22}}$ ( $\ds{\gamma}$ is the Euler-Mascheroni Constant  ${\bf\mbox{6.1.3}}$ ):
$$
\Psi\pars{z} + \gamma = \int_{0}^{1}{1 - t^{z - 1} \over 1 - t}\,\dd t
\tag{${\bf\mbox{6.3.22}}$} 
$$
\begin{align}
&\color{#c00000}{%
\int_{0}^{\infty}{\sin\pars{ax} \over \expo{\pi x}\sinh\pars{\pi x}}\,\dd x}
={\sgn\pars{a} \over \pi}\,\Im\Psi\pars{1 + {\verts{a} \over 2\pi}\,\ic}
\end{align}
With identity ${\bf\mbox{6.3.13}}$
$\ds{\Im\Psi\pars{1 + \ic y}=
     -\,{1 \over 2y} + {\pi \over 2}\,\coth\pars{\pi y}}$, where
$\ds{y \in {\mathbb R}}$,
\begin{align}
&\color{#c00000}{%
\int_{0}^{\infty}{\sin\pars{ax} \over \expo{\pi x}\sinh\pars{\pi x}}\,\dd x}
={\sgn\pars{a} \over \pi}\,\braces{-\,{1 \over 2\bracks{\verts{a}/\pars{2\pi}}} + {\pi \over 2}\,\coth\pars{\pi\,{\verts{a} \over 2\pi}}}
\end{align}

$$
\color{#66f}{\large%
\int_{0}^{\infty}{\sin\pars{ax} \over \expo{\pi x}\sinh\pars{\pi x}}\,\dd x
=-\,{1 \over a} + \half\,\coth\pars{a \over 2}}
$$

Also, after an integration by parts, the last integral in $\pars{1}$ can be evaluated in terms of PolyLogarithm Functions.
