What happens when $\lvert\omega\rvert =1$? If this is a duplicate in any way, I'm very sorry.
I'm brushing up on some Complex Analysis with Special Functions in mind. Here's a problem I'm stuck on.

Evaluate the integral $$I=\frac{1}{2\pi i}\oint_{\lvert z\rvert=1}f(z)\, dz$$ over the counterclockwise oriented unit circle centred at $0$, where $$f(z)=\frac{2z}{z^2+\omega^2}$$ for $\omega\in\Bbb{C}$.

I'm pretty sure I know what happens when $\lvert \omega\rvert\neq 1$; it's simple: break it down into the two obvious cases. But what happens when $\lvert\omega\rvert =1$?

What I've done so far is let $z=\gamma (t)=e^{it}$ for $t\in [0, 2\pi ]$ and arrived at $$\frac{1}{\pi}\int_0^{2\pi}{\frac{dt}{1+\left(\frac{\omega}{e^{it}}\right)^2}},$$ hoping to use the derivative of $\operatorname{arctan}$, which isn't going to work, of course.
I'd like a few hints please :)
A hunch: I'm tempted to say that the integral does not exist for $\lvert\omega\rvert=1$ but I've no idea why.
 A: 
I'm tempted to say that the integral does not exist for $\lvert\omega\rvert = 1$

Yes. And sort of no. The integral exists in the principal value sense for $\lvert \omega\rvert = 1$, but not as a proper Lebesgue or Riemann integral. For $\lvert \omega\rvert = 1$, you have two simple poles (in $z = \pm i\omega$) on the contour, these are non-integrable singularities, but since the poles are simple, the values on each side of the pole on the circle are essentially the negative of the other, and the principal value of the integral exists.

But what happens when $\lvert\omega\rvert = 1$?

As a result, you can view the poles on the circle each as half inside, half outside the contour, so the integral is $\pi i$ times the sum of the two residues instead of $2\pi i$ times. From another point of view, you can take the mean of approaching $\lvert \omega\rvert = 1$ from inside and outside the unit circle.
More formally, you omit small symmetrical arcs around the two poles from the contour, and let the holes shrink to a point each, taking the limit. To compute that, close the contour by replacing the omitted arcs by semicircles (almost) centered in the poles to get a closed contour in order to evaluate that integral with the residue theorem. Then you subtract the integrals over the two small semi(almost)circles, which tend, for the radius shrinking to $0$, to $\pm \pi i$ times the residue in the pole. The sign depends on whether you choose the semicircles inside the unit circle or outside.
A: It's been a while since my complex class so someone else correct me if I'm wrong.
The integral is evaluated by using the generalized Cauchy Integral Formula. Using Fundamental Theorem of Algebra, which states any degree polynomial also has the same number of complex root, we can break down the bottom of the fraction $z^2 + w^2$ to be $(z+z_1)(z-z_2)$ and go from there. I don't think the fact that $\lvert\omega\rvert = 1$ plays any role here.
There are a few more steps from breaking down the polynomial to $(z+z_1)(z-z_2)$ to the final answer. Let me know if you need more hints.
