This is a question on contour integration. The particular problem has a (simple) pole on the contour which prohibits a direct application of Cauchy's Residue Theorem.
Daniel Fischer commented as follows
Not really. [...] if the contour is smooth at the pole, it's as if half of the pole lies inside the contour and half outside. If the contour has a corner at the pole, with (inner) angle $\alpha$, the fraction is $\alpha2\pi$, so you get $\alpha i$ times the residue of the pole instead of $2\pi i$ times as for singularities properly enclosed by the contour.
The same result is mentioned in this question.
Unfortunately, Daniel didn't know a reference for this (generalised) result. Can anyone point me to a book/paper/recourse which covers this result? I'd like to see a proof and some maths underlying this intuition.
Thank you very much!