I've been reading parts of the book 'Ultracold Quantum Fields' by Henk Stoof and in Chapter 7 I came across something which I don't understand.
This chapter is about the functional-integral formalism and how this can be used to understand the Ideal Quantum Gas. In the part of the Matsubara Expansion they want to show that the following holds:
$$\lim_ {\eta \downarrow 0 } \frac{1}{\hbar \beta} \sum_{n}\frac{e^{i \omega_n \eta}}{i \omega_n - (\epsilon - \mu)/\hbar}= \mp \frac{1}{e^{\beta(\epsilon - \mu)} \mp 1}.$$ According to the book this can be done by contour integration. They first note that $\hbar \beta / (e^{\hbar \beta z} \mp 1)$ has simple poles at the even and odd Matsubara frequencies ($\omega_n = \pi (2n) / \hbar \beta$ for bosons and $\omega_n = \pi (2n+1)/\hbar \beta)$. These poles I can see, but then they say that the residue at the poles is given by $\pm 1$. This I don't see, furthermore I don't understand how this function might help showing that the relation holds. They say that applying the residue theorem gives
$$\lim_ {\eta \downarrow 0 } \frac{1}{2 \pi i} \int _C dz \frac{e^{\eta z}}{z - (\epsilon - \mu)/\hbar} \frac{\pm 1}{e^{\hbar \beta z}\mp 1} = \lim_ {\eta \downarrow 0 }\frac{1}{\hbar \beta}\sum_{n}\frac{e^{i \omega_n \eta}}{i \omega_n - (\epsilon - \mu)/\hbar}.$$
I've been trying for a while to see how I should apply contour integration and the residue theorem to show this, but I don't understand how to do it.