# Residue Theorem: Inside vs. Outside

My lecturer told me that when I use the residue theorem, it does not matter if I sum over the residues of the poles on the inside or the outside of a positively oriented simple closed curve $\gamma$. However, in my opinion the sign should change: $$\oint_\gamma f(z)\,\mathrm{d}z = 2\pi i \sum_{a\in D_i}\operatorname{Res}_a f = -2\pi i \sum_{a\in D_o}\operatorname{Res}_a f$$ where $D_i$ and $D_o$ denote the sets of poles inside and outside the region enclosed by $\gamma$. Unfortunately I only found examples online where the residues are $0$, so that does not really help. My reasoning is that on the Riemann sphere, the winding number is $-1$ for the poles outside, which is where the sign comes from. Is that correct?

• This only works if $f$ is a rational function. – Lord Shark the Unknown Jan 28 '18 at 12:57
• It works for a bit more than rational functions, we may have essential singularities, but the integrand needs to be holomorphic except for isolated singularities on the entire sphere. And you are right, you must take orientation into account, so it's $-2\pi i$ times the sum of the residues outside. – Daniel Fischer Jan 28 '18 at 13:09