# 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

• What you need is here math.stackexchange.com/questions/1550932/… as the user Thijs answered. Nov 10, 2017 at 20:26
• The problem is that the contour used by Thjis only goes up to $R + i\pi$ in the imaginary axis. This problem specifically requires the use of a contour that goes up to $R + i2\pi$ in the imaginary axis, which when I used Thjis's method resulted in a completely different answer Nov 11, 2017 at 0:16

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.
• Thanks for the answer, but I'm afraid I don't understand the first part, where you find that $\int_{0}^{+\infty}\frac{sin(ax)}{sinhx}dx = 2a\sum_{n \geq 0}\frac{1}{a^2+(2n+1)^2}$ I was able to get the geometric series representation of $\frac{1}{sinhx}$, but where do I go forward from there? Nov 11, 2017 at 11:40
• @D.Ashton: in a explicit way, $$\int_{0}^{+\infty}\frac{\sin(ax)}{\sinh(x)}\,dx = \int_{0}^{+\infty}2\sin(ax)e^{-x}\sum_{m\geq 0}e^{-2mx}\,dx\\ = 2\sum_{m\geq 0}\int_{0}^{+\infty}\sin(ax)e^{-(2m+1)x}\,dx = 2a\sum_{m\geq 0}\frac{1}{a^2+(2m+1)^2}.$$ Nov 11, 2017 at 12:55