# Evaluate $\int_{-\infty}^{\infty}\frac{\sinh(a x)}{\sinh(b x)}\,dx$ with $a<b$

With $a$ and $b$ real and $a<b$. Use Cauchy's residue theorem to evaluate: $$\int_{-\infty}^{\infty}\frac{\sinh(ax)}{\sinh(bx)}\,dx.$$

Let $f(x)=\frac{\sinh(ax)}{\sinh(bx)}.$ I evaluate $\lim_{x\to 0}f(x)=\frac{a}{b}$, this implies that $f(x)$ has no poles. I try to integrate around the semicircle and the rectangular contour but I am stuck at this point.

• wouldn't this be real analysis? – Jacob Claassen Jun 2 '17 at 4:25

By a change of variable it is enough to be able to integrate $\frac{\sinh(a x)}{\sinh(x)}$ over the real line for any $a\in(-1,1)$. This is an even function, hence it is enough to consider $$\int_{0}^{+\infty}\frac{e^{ax}-e^{-ax}}{e^{x}-e^{-x}}\,dx = \int_{0}^{+\infty}\frac{e^{(a-1)x}-e^{-(a+1)x}}{1-e^{-2x}}\,dx$$ and by performing a geometric series expansion the RHS equals $$g(a)=\sum_{m\geq 0}\left(\frac{1}{2m+1-a}-\frac{1}{a+1-2m}\right)=\sum_{m\geq 0}\frac{2a}{(2m+1)^2-a^2}.$$ By Herglotz' trick, or by considering the logarithmic derivative of the Weierstrass product for the cosine function, we may easily see that the last series is related with the tangent function: $$g(a) = \frac{\pi}{2}\,\tan\frac{\pi a}{2}$$ hence it follows that for any $0<a<b$ we have: $$\boxed{\int_{-\infty}^{+\infty}\frac{\sinh(ax)}{\sinh(bx)}\,dx = \color{red}{\frac{\pi}{b}\,\tan\left(\frac{\pi a}{2b}\right)}}$$

We may assume that $b>0$. By the Residue Theorem, if $Rb/\pi$ is not an integer then for $t>0$, $$\int_{\gamma_R}\frac{\sinh(az)e^{itz}}{\sinh(bz)}dz=2\pi i \sum_{1\leq n\leq Rb/\pi} \mbox{Res}\left(\frac{\sinh(az)e^{itz}}{\sinh(bz)},\frac{\pi i n}{b}\right)$$ where $\gamma_R$ is the closed curve given by the upper semicircle of radius $R$ and the segment $[-R,R]$. It follows that, as $R\to +\infty$, we obtain \begin{align*} \int_{-\infty}^{+\infty}\frac{\sinh(ax)}{\sinh(bx)}e^{itx}dx &=2\pi i \sum_{n=1}^{\infty} \mbox{Res}\left(\frac{\sinh(az)e^{itz}}{\sinh(bz)},\frac{\pi i n}{b}\right)\\ &=\frac{2\pi i}{b} \sum_{n=1}^{\infty} \frac{\sinh(a\pi in/b)e^{-\pi n t/b}}{\cosh(\pi i n)} =-\frac{2\pi}{b} \sum_{n=1}^{\infty} (-1)^n\sin(a\pi n/b)e^{-\pi n t/b}\\ &=-\frac{2\pi}{b} \, \mbox{Im}\left(\sum_{n=1}^{\infty} (-1)^ne^{\pi n(-t+ia )/b}\right)=-\frac{2\pi}{b} \, \mbox{Im}\left(\frac{1}{1+e^{\pi(ia+t)/b}}\right). \end{align*} By taking the limit as $t\to 0^+$, we get $$\int_{-\infty}^{\infty}\frac{\sinh(ax)}{\sinh(bx)}\,dx =\frac{\pi}{b}\cdot\frac{\sin(a\pi/b)}{\cos(a\pi/b)+1}.$$


This answer is a 'real' approach which is an interesting alternative to the 'complex contour' integration.

\begin{align} \mbox{Note that}\quad\left.\int_{-\infty}^{\infty}{\sinh\pars{ax} \over \sinh\pars{bx}}\,\dd x\, \right\vert_{\ \substack{a, b\ \in\ \mathbb{R} \\[0.5mm] b\ \not=\ 0}} & = \mrm{sgn}\pars{ab}\int_{-\infty}^{\infty}{\sinh\pars{\verts{a}x} \over \sinh\pars{\verts{b}x}}\,\dd x \\[5mm] \stackrel{x\ =\ {\large{t \over 2\verts{b}}}}{=}&\ {\mrm{sgn}\pars{a} \over 2b} \bbox[10px,#ffe]{\ds{\int_{-\infty}^{\infty}{\sinh\pars{\mu t/2} \over \sinh\pars{t/2}}\,\dd t}}\ \mbox{where}\ \mu \equiv \verts{a \over b}\label{1}\tag{1} \end{align}

The following integral converges whenever $\ds{0 \leq \mu < 1 \implies 0 \leq \verts{a} < \verts{b}}$.

\begin{align} \bbox[15px,#ffe]{\ds{\int_{-\infty}^{\infty}{\sinh\pars{\mu t/2} \over \sinh\pars{t/2}}\,\dd t}} & = 2\int_{0}^{\infty} {\expo{\pars{\mu - 1}t/2} - \expo{-\pars{\mu + 1}t/2}\over 1 - \expo{-t}}\,\dd t \\[5mm] \stackrel{\expo{-t}\ \mapsto\ t}{=}\,\,\,& 2\int_{1}^{0} {t^{\pars{1 - \mu}/2} - t^{\pars{\mu + 1}/2} \over 1 - t} \pars{-\,{\dd t \over t}} \\[5mm] = &\ 2\bracks{\int_{0}^{1}{1 - t^{\pars{\mu - 1}/2} \over 1 - t}\,\dd t - \int_{0}^{1}{1 - t^{-\pars{1 + \mu}/2} \over 1 - t}\,\dd t} \\[5mm] = &\ 2\bracks{H_{\pars{\mu - 1}/2} - H_{\pars{-\mu - 1}/2}}\qquad \pars{~H_{z}:\ Harmonic\ Number~} \\[5mm] = &\ 2\bracks{\pi\cot\pars{\pi\,{1 - \mu \over 2}}} = 2\pi\tan\pars{\pi\mu \over 2} \quad\pars{~\substack{Euler\\[0.5mm]Reflection\ Formula}~} \\[5mm] = &\ 2\pi\,\mrm{sgn}\pars{a \over b}\tan\pars{\pi a \over 2b}\label{2}\tag{2} \end{align}

With \eqref{1} and \eqref{2}:

$$\bbx{\ds{% \left.\int_{-\infty}^{\infty}{\sinh\pars{ax} \over \sinh\pars{bx}}\,\dd x\, \right\vert_{\ \substack{a, b\ \in\ \mathbb{R} \\[0.5mm] b\ \not=\ 0}} = {\pi \over \verts{b}}\tan\pars{\pi a \over 2b}}}\,,\qquad 0 \leq \verts{a} < \verts{b}$$