I am trying to argue that if $C$ is a simple, closed curve in the complex plane, $p(z),q(z)$ polynomials with $q(z)$'s zeroes interior to $C$ and the degree of $q$ is at least two more than that of $p$, then
$$\int_C\frac{p(z)}{q(z)}dz=0$$
I have seen proofs that use limit arguments, deforming the curve $C$ into circles with radii that go to infinity, and that's fine and convincing. But I get the feeling there should be a simpler, more direct proof just using the fact that
$$\int_Cf(z)dz=2\pi i Res_{z=0}\left(\frac{1}{z^2}f(1/z)\right)$$
I know that $z\mapsto 1/z$ sends points interior to $C$ to points exterior to the image of $C$ and therefore the integral over this "inverted" function over this "inverted" curve will be 0, but that doesn't obviously relate back to the integral that I'm computing. Still it seems like the fact that $q(1/z)$ lacks certain roots in a region implies something about $p(1/z)/q(1/z)$ I just can't say what that is.
This works fine, but some care is needed. Let's stick to circles centred at zero. Making the change of variables $w=1/z$ in $$\int_{\gamma_r}f(z)\,dz$$ where $\gamma_r$ is the circle centre $0$ and radius $r$ gives $$\int_{\gamma_r}f(z)\,dz=\int_{\gamma_r'}f(1/w)\frac{dw}{(-w^2)}$$ where $\gamma_r'$ is the image of $\gamma_r$ under $z\mapsto 1/z$. But this contour is now traversed in the negative (clockwise) direction. So $$\int_{\gamma_r}f(z)\,dz=\int_{\gamma_{1/r}}f(1/w)\frac{dw}{w^2}$$ where, as usual, the circles are traversed in the positive (anticlockwise) direction.
In your example $r$ is large enough for $\gamma_r$ to encircle all the zeros of $f$ in the complex plane, so this final contour will only contain a singularity at $w=0$, so the residue there will determine the integral.
This works just as well, even if $f$ is not a rational function, but if $f$ is meromorphic on $\Bbb C$ with only finitely many poles.