TITLE: Integrate: $\int_0^{\infty}\frac{\sinh (ax)}{\sinh x} \cos (bx) dx$
QUESTION [5 upvotes]: Q: If $|a|< 1$ and $b>0$, show that
  $$\int_0^{\infty}\frac{\sinh (ax)}{\sinh x} \cos (bx) dx = \frac{\pi  \sin (\pi  a)}{2 (\cos (\pi  a)+\cosh (\pi  b))}$$

I need to evaluate the above integral by method of contour. I tried to use this contour on this question but at $2\pi i$, $\sinh(ax)$ changes to $\sinh(ax+2a\pi i)$ and I have difficulty taking out $\sinh(ax)$. Please give hints on which contour to use.Thanks in advance!! 
ADDED::
Considering $-R \to R \to R + \pi i \to -R + \pi i \to -R$ with a bump on $0$ and $\pi i$ to avoid singularity.
$$(1 + e^{(a+ib)\pi i}) \int_{-\infty}^{\infty}\frac{e^{(a+bi)x}}{\sinh x}dx = -\pi i(1 - e^{(a+ib)\pi i}) \hspace{1 cm}(1)$$
$$(1 + e^{(-a+ib)\pi i}) \int_{-\infty}^{\infty}\frac{e^{(-a+bi)x}}{\sinh x}dx = -\pi i(1 - e^{(-a+ib)\pi i}) \hspace{1 cm}(2)$$
With a bit of algebra, we get 
\begin{align*}
\int_{-\infty}^{\infty}\frac{e^{ax}-e^{-ax}}{\sinh x}e^{ibx}dx &= 2\pi i \left( \frac{1}{1 + e^{(a+bi)\pi i}} -  \frac{1}{1 + e^{(-a+bi)\pi i}} \right)\\ 
 &= 2 \pi \frac{\sin (a\pi)}{\cosh (b\pi) + \sin(a\pi)}
\end{align*}
From which we get the desired result.

REPLY [6 votes]: Consider 
$$f(z) = \frac{\sinh(ax)e^{ibx}}{\sinh(x)}$$
so that the function we want integrated is $\Re f$.  Let us find
$$I = \int_{-\infty}^\infty f(z)\,dz$$
which is twice the integral in question.  Let $C$ be this integral, indented to avoid the pole at $z=0$:

The integral around the large arc disappears as $R\to\infty$, and as $\epsilon\to 0$, the integral around the small arc becomes:
$$\pi i \operatorname*{Res}_{z=0} f(z) = 0$$
Then we have, seeing that $f$ has poles in $C$ at $z_n = \pi i n$ for $n \ge 1$.
$$\operatorname*{Res}_{z=\pi in} f(z) = \lim_{z\to \pi i n}\frac{\sinh(ax)e^{ibx}}{\cosh(x)} = i(-1)^n e^{-b\pi n}\sin(\pi a n)$$
Then summing:
$$
I=\oint_C f(z)\, dz =\\
\Re\, 2\pi i \sum_{n=1}^\infty \operatorname*{Res}_{z=\pi i n} f(z) = \\
-2\pi\Im \sum_{n=1}^\infty (-1)^n e^{-b\pi n+\pi i a n} = \\
-2 \pi \Im \frac{1}{1+e^{-b\pi +\pi i a }} = \\
\frac{\pi\sin(a\pi)}{\cos(a\pi)+\cosh(b\pi)}
$$
Divide by two and the answer is obtained.