$$\int_{|z|=3} \frac{1}{z^2+2},dz$$
I got this on a quiz today, and I proceeded as follows.
I substituted $3e^{iθ}$ for z to get $$\int_{-π}^{0} \frac{i3e^{iθ}}{(3e^{iθ})^2+2},dz+\int_{0}^{π} \frac{i3e^{iθ}}{(3e^{iθ})^2+2},dz$$
Then I used u substitution to get $$\int_{-3}^{0} \frac{1}{u^2+2},du + \int_{0}^{-3} \frac{1}{u^2+2},du = 0$$
I have a strong feeling that the u-substitution was illegal, but I plugged the integral into wolfram alpha and got 0. I'm not sure what the canonical approach here should be.
Note that $z^2+2=(z+\sqrt2i)(z-\sqrt2i)$, so there are 2 poles, namely $\sqrt2i$ and $-\sqrt2i$, both of which are inside the circle of radius $\sqrt3.$ Let's find the residue of $\frac{1}{(z-r_2)(z-r_1)}$ at $r_1$ by expressing $\frac{1}{(z-r_2)(z-r_1)}$ as a Laurent series in $z-r_1$ and finding the coeffient of $(z-r_1)^{-1}$. $$\frac{1}{(z-r_2)(z-r_1)}=\frac{1}{(z-r_1+r_1-r_2)(z-r_1)}$$ $$=\frac{1}{(r_1-r_2)(1+\frac{z-r_1}{r_1-r_2})(z-r_1)}$$ $$=\frac{1-(\frac{z-r_1}{r_1-r_2})+(\frac{z-r_1}{r_1-r_2})^2-...}{(r_1-r_2)(z-r_1)}$$ The coefficient of $(z-r_1)^{-1}$ in the Laurent series is $\frac{1}{r_1-r_2}$. Do this at each pole, add up and apply the appropriate theorem from complex analysis.