Evaluate the following: $\int_{0}^{\infty}\frac{\sin(ax)}{\sinh(x)}dx$ and $\int_{0}^{\infty}\frac{x\cos(ax)}{\sinh(x)}dx$ using rectangular contour A problem I'm currently working on asks to evaluate the following integrals:
$\int_{0}^{\infty}\frac{\sin(ax)}{\sinh(x)}dx\;$ and $ \  \int_{0}^{\infty}\frac{x\cos(ax)}{\sinh(x)}dx$ 
I've seen previous questions around here that show how to do the evaluation via contour integration 
(Evaluating $\int_{0}^{\infty}\frac{\sin(ax)}{\sinh(x)}dx$ with a rectangular contour and show that $\int_{0}^{\infty}\frac{x\cos ax}{\sinh x}dx=\frac{\pi^2}{4} \operatorname{sech}^2 \left(\frac{a\pi}{2}\right) $)
but this particular problem requires that I use the following contour:

I tried applying the previous two methods using this contour, but the final answer I end up with keeps ending up as a completely different form and I am unable to prove that the answer I got is exactly the same as the answers using the different methods linked above.
Any help would be greatly appreciated 
 A: For any $n\in\mathbb{N}^+$ and $a>0$ we have $\int_{0}^{+\infty}\sin(ax)e^{-nx}\,dx = \frac{a}{a^2+n^2}$ by integration by parts or by writing $\sin(ax)$ as $\operatorname{Im}\exp(iax)$. By expanding $\frac{1}{\sinh x}=\frac{2e^{-x}}{1-e^{-2x}}$ as a geometric series in $e^{-x}$ we get
$$\int_{0}^{+\infty}\frac{\sin(ax)}{\sinh x}\,dx = 2a\sum_{n\geq 0}\frac{1}{a^2+(2n+1)^2}. $$ 
On the other hand, by applying $\frac{d}{dx}\log(\cdot)$ to both sides of
$$ \cosh\left(\frac{\pi x}{2}\right)=\prod_{n\geq 0}\left(1+\frac{x^2}{(2n+1)^2}\right) $$
(Weierstrass product for the hyperbolic cosine function) we get:
$$ \frac{\pi}{2}\,\tanh\left(\frac{\pi x}{2}\right)= 2x\sum_{n\geq 0}\frac{1}{x^2+(2n+1)^2}$$
so:
$$ \boxed{\forall a\in\mathbb{R},\qquad \int_{0}^{+\infty}\frac{\sin(ax)}{\sinh x}\,dx =\frac{\pi}{2}\,\tanh\left(\frac{\pi a}{2}\right).}\tag{1} $$
In a similar way, from
$$ \int_{0}^{+\infty} x\cos(ax)e^{-nx}\,dx = \frac{n^2-a^2}{(n^2+a^2)^2}$$
by applying $\frac{d^2}{dx^2}\log(\cdot)$ to both sides of the previous Weierstrass product we get:
$$ \boxed{\forall a\in\mathbb{R},\qquad \int_{0}^{+\infty}\frac{x\cos(ax)}{\sinh(x)}\,dx = \frac{\pi^2}{4}\,\operatorname{sech}\left(\frac{\pi a}{2}\right)^2.}\tag{2}$$
You do not really need contour integration, it is already "encoded" in the mentioned Weierstrass product. See also the Herglotz trick.
A: $\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{\on}[1]{\operatorname{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\sr}[2]{\,\,\,\stackrel{{#1}}{{#2}}\,\,\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
& \color{#44f}{\int_{0}^{\infty}{\sin\pars{ax} \over \sinh\pars{x}}
\,\dd x} =
\int_{0}^{\infty}{\pars{\expo{\ic ax} - \expo{-\ic ax}}/\pars{2\ic} \over \pars{\expo{x} - \expo{-x}}/2}\,\dd x =
-\ic\int_{0}^{\infty}{\expo{-\pars{1 - \ic a}x} - \expo{-\pars{1 + \ic a}x} \over 1 - \expo{-2x}}\,\dd x
\\[5mm] = & \
-\,{\ic \over 2}\int_{0}^{\infty}{\expo{-\pars{1/2\ -\ \ic a/2}x}\,\, - \expo{-\pars{1/2\ +\ \ic a/2}x}\,\,\, \over 1 - \expo{-x}}\,\dd x
\\[5mm] = & \
{\ic \over 2}\bracks{\int_{0}^{\infty}{\expo{-x} - \expo{-\pars{1/2\ -\ \ic a/2}x}\,\, \over 1 - \expo{-x}}\,\dd x -
\int_{0}^{\infty}{\expo{-x} - \expo{-\pars{1/2\ +\ \ic a/2}x}\,\, \over 1 - \expo{-x}}\,\dd x}
\\[5mm] = & \
{\ic \over 2}\bracks{\Psi\pars{{1 \over 2} - {a \over 2}\ic} - \Psi\pars{{1 \over 2} + {a \over 2}\ic}} =
{\ic \over 2}\pi\cot\pars{\pi\bracks{{1 \over 2} + {a \over 2}\ic}} =
{\ic \over 2}\pi\bracks{-\ic \tanh\pars{\pi a \over 2}}
\\[5mm] = & \ \bbx{\color{#44f}{{\pi \over 2}\tanh\pars{\pi a \over 2}}}
\qquad\mbox{Note that}\ \totald{\bracks{\pi\tanh\pars{\pi a/2}/2}}{a} =
{\pi^{2} \over 4}\on{sech}^{2}\pars{\pi a \over 2} \\ &
\end{align}
