Calculating $\text{PV}\int_{-\infty}^{+\infty}\frac{e^{\alpha x}}{e^{2x}-1}\mathrm d x$ I am trying to show that for $0 < \alpha < 2$:
$$
{\rm P.V.}\int_{-\infty}^{\infty}\frac{{\rm e}^{\alpha x}}
{{\rm e}^{2x} - 1}\,{\rm d}x
=
-\frac{\pi}{2}\,\cot\left(\frac{\alpha\pi}{2}\right )
\tag{$\star$}
$$
to gain some familiarity with the concept of Principal Value.

My attempts

*

*First of all I started by expanding the integral. Let $R>0$ be a positive real number. Then
$$
\begin{align}
\int_{-R}^R\frac{e^{\alpha x}}{e^{2x}-1}\mathrm dx &=  
\int_{-R}^R e^{\alpha x}\left (\sum_{n\ge 1}e^{-2nx}\right )\mathrm dx=\sum_{n\ge 1}\int_{-R}^R e^{(\alpha-2n)x}\mathrm d x
\\[5mm]
& =
\sum_{n\ge 1}\left .\frac{e^{(\alpha-2n)x}}{\alpha-2n} \right |^{x=R}_{x=-R}=\sum_{n\ge 1}\frac{1}{\alpha-2n}\left ( e^{(\alpha-2n)R} -e^{-(\alpha-2n)R}\right)
\end{align}
$$
but I don't know how to continue from here. I tried evaluating the series through complex analytic methods but I was not successful.


*I tried substituting $e^{2x}=u$. The integral becomes
$$\int_{-R}^R\frac{e^{2x\frac{\alpha}{2}}}{e^{2x}-1}\mathrm dx=\frac{1}{2}\int_{e^{-2R}}^{e^{2R}}\frac{u^{\frac{\alpha}{2}-1}}{u-1}\mathrm du$$
but this doesn't look very promising. I was unable to manipulate this expression to evaluate the integral.


Question: How can I evaluate the principal value $(\star)$?

 A: $$\begin{eqnarray*}\text{PV}\int_{-\infty}^{+\infty}\frac{e^{\alpha x}}{e^{2x}-1}\,dx &=& \int_{0}^{+\infty}\left(\frac{e^{\alpha x}}{e^{2x}-1}+\frac{e^{-\alpha x}}{e^{-2x}-1}\right)\,dx\\&=&\int_{0}^{+\infty}\frac{\sinh((\alpha-1)x)}{\sinh x}\,dx\\(\text{De Moivre})&=&\sum_{n\geq 0}\left(\frac{1}{2-\alpha+2n}-\frac{1}{\alpha+2n}\right)\\(\text{Herglotz})&=&-\frac{\pi}{2}\cot\left(\frac{\pi \alpha}{2}\right)\end{eqnarray*} $$
since the meromorphic functions $\sum_{n\geq 0}\left(\frac{1}{2-\alpha+2n}-\frac{1}{\alpha+2n}\right)$ and $-\frac{\pi}{2}\cot\left(\frac{\pi \alpha}{2}\right)$ have simple poles at the same points with the same residues. Herglotz' trick is summarized here.
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{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
\mrm{P.V.}\int_{-\infty}^{\infty}{\expo{\alpha x} \over \expo{2x} - 1}\,\dd x & =
\int_{0}^{\infty}\pars{%
{\expo{\alpha x} \over \expo{2x} - 1} + {\expo{-\alpha x} \over \expo{-2x} - 1}}
\,\dd x
\\[5mm] = & \
\int_{0}^{\infty}
{\expo{-\pars{1 - \alpha/2}2x} - \expo{-\pars{\alpha/2}2x} \over 1 - \expo{-2x}}\,\dd x
\\[5mm] &
\stackrel{x\ =\ -\ln\pars{t}/2}{=}\,\,\,
\int_{1}^{0}{t^{1 - \alpha/2} - t^{\alpha/2} \over 1 - t}
\,\pars{-\,{1 \over 2t}}\dd t
\\[5mm] & =
-\,{1 \over 2}\pars{\int_{0}^{1}{1 - t^{-\alpha/2} \over 1 - t}\,\dd t -
\int_{0}^{1}{1 - t^{-1 + \alpha/2} \over 1 - t}\,\dd t}
\\[5mm] & =
-\,{1 \over 2}\pars{H_{-\alpha/2} - H_{\alpha/2 - 1}}\qquad
\pars{~H_{z}:\ Harmonic Number~}
\\[5mm] & =
-\,{1 \over 2}\bracks{\pi\cot\pars{\pi\,{\alpha \over 2}}}\qquad
\pars{~Euler\ Reflection\ Formula~}
\\[5mm] & =
\bbx{-\,{\pi \over 2}\,\cot\pars{\alpha\pi \over 2}} \\ &
\end{align}
A: Note that
$$\eqalign{\int_{|x|>\epsilon}\frac{e^{ax}}{e^{2x}-1}dx&=
\int_{\epsilon}^\infty\frac{e^{ax}}{e^{2x}-1
}dx+\int_{-\infty}^{-\epsilon}\frac{e^{ax}}{e^{2x}-1}dx\cr
&=\int_{\epsilon}^\infty\frac{e^{ax}}{e^{2x}-1
}dx+\int_\epsilon^{\infty}\frac{e^{-ax}}{e^{-2x}-1}dx\cr
&=\int_{\epsilon}^\infty\frac{e^{ax}-e^{(2-a)x}}{e^{2x}-1
}dx
}$$
The integrand on the right can be extended by continuity at $x=0$ so
$$V.P \int_{-\infty}^{\infty}\frac{e^{ax}}{e^{2x}-1}dx=\lim_{\epsilon\to0}\int_{|x|>\epsilon}\frac{e^{ax}}{e^{2x}-1}dx=\int_{0}^\infty\frac{e^{ax}-e^{(2-a)x}}{e^{2x}-1
}dx$$
Now, the last integral can be evaluated as follows:
$$\eqalign{\int_{0}^\infty\frac{e^{ax}-e^{(2-a)x}}{e^{2x}-1
}dx&=\int_{0}^\infty(e^{ax}-e^{(2-a)x})\left(\sum_{n=1}^\infty e^{-2n x}\right)dx\cr
&=\sum_{n=1}^\infty\left(\frac{1}{2n-a}-\frac{1}{2n+a-2}\right)\cr
&=-\frac1a-\sum_{n=1}^\infty\frac{a}{a^2-4n^2}=-\frac{\pi}{2}\cot\frac{\pi a}{2}
}$$
