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.