I came across the following identity,
$$ \int_{-\infty} ^\infty dx \frac{e^{-i kx}}{e^{-ax} +1} = \frac{2\pi i}{a} \sum_{n=0}^{\infty} e^{-\frac{(2n+1)\pi k}{a}} = \frac{\pi i }{a\mathrm{sinh}\frac{k \pi}{a}} $$ I can to some extent see the first equality by doing the contour integration in the lower half plane which has poles at $\frac{i\pi(2 n +1)}{a}$. I however get the summation for negative integers as well, $$ \int_{-\infty} ^\infty dx \frac{e^{-i kx}}{e^{-ax} +1} = \frac{2\pi i}{a} \sum_{n=-\infty}^{\infty} e^{-\frac{(2n+1)\pi k}{a}} $$. I however have no idea how one can get the second equality. I am actually more interested in a slightly different integral, $\int_{-\infty} ^\infty dx \frac{e^{-i kx}}{e^{-ax} -1} $. Any help as to how one can obtain these identities is appreciated.
The second equality can be proven by writing the summation as a geometric progression.
\begin{align} \sum_{n=0}^\infty e^{-(2n+1)\frac{\pi k}{a}}&= e^{-\frac{\pi k}{a}}\sum_{n=0}^\infty\big(e^{\frac{-2\pi k}{a}}\big)^n \\&=\frac{e^\frac{-\pi k}{a}}{1-e^\frac{-2\pi k}{a}} \\ &= \frac{1}{e^{\frac{\pi k}{a}}-e^{-\frac{\pi k}{a}}} \\ &= \frac{1}{2\sinh{\frac{\pi k}{a}}} \end{align}
Note that the infinite summation converges only if $\frac{k}{a} > 0$.