# 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.

• May 15, 2013 at 16:44
• @i707107 yes thanks!! May 15, 2013 at 17:04

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}$$

• thank you very much for your effort. I was having trouble with $4-$th integral. I have few similar question, I hope I'll be able to solve. May 17, 2013 at 19:06
• @MulaKoSaag: What is the problem? Rewrite, break into real and imaginary parts. The real part is a nightmare, but we can throw it away because we are taking imaginary parts. The imaginary part is an easy integral, because the factor of $\sin{\pi y}$ cancels in the integrand. May 17, 2013 at 19:09
• sure ... I will try this trick with others!! May 17, 2013 at 19:13
• Dear Ron, I saw this on your blog as well. Didn't know where you would prefer to be asked a question (maybe neither - but hope not since you are always so generous). Sorry to be a serial questioner, yet your work is so compelling. Could I please ask you how you applied the residue theorem to get from the fifth and sixth integrals to the "combine to form" line. On second thought, this is the better place to ask so I can +50 for this and your untiring generosity in helping others. All the best, Andrew
– user12802
Feb 19, 2014 at 21:17
• @96Tears aka Andrew: again, you are too kind. Really, the fifth and sixth integrals are evaluated by taking $\epsilon \to 0$. In those cases, Taylor expand the exponentials inside the integrals, e.g., $e^y \sim 1+y$. Then note all the nifty cancellations, and you end up with something independent of $\epsilon$, and essentially an integral over a constant. It's essential that the integrals be set up correctly (esp. with the right signs), but once that's done, the rest is a cakewalk. Feb 19, 2014 at 21:23

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}$$

• Hi ... could you help me with method of contour too? I tried it but couldn't. Also the answer is $$\frac{1}{4}\coth\left(\frac{a}{2}\right) -\frac{1}{2a}$$ May 17, 2013 at 10:44
• @MulaKoSaag The $\tt\mbox{@Caran-d'Ache}$ result is correct. Jun 7, 2014 at 22:15


${\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.


\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}