Cauchy Integral Formula (When f(z) is not analytic everywhere inside C) 
Let $\alpha$ be a given complex number satisfying $0<|\alpha|<1$, and let $\gamma$ be
the circle $|z|=2$ oriented in the counterclockwise direction. Determine the value of
$$
\int_{\gamma} \frac{\operatorname{Im} z}{z-\alpha} d z
$$
in terms of $\alpha .$ Here as usual, $\operatorname{Im} z$ denotes the imaginary part of $z$.

For the question, I have thought about it for a long time.
My idea is as follow:
C (|z| = 2) is a positively oriented simple connected contour. The point $\alpha$ is also within C.
$|z|^2 = 4$
Since Im(z) = $\frac{1}{2i}$($z - \bar z$) and $|z|^2 = z\bar z$, we can express Im(z) as:
Im(z) = $\frac{1}{2i}(z - \frac{4}{z})$ = $\frac{z}{2i} - \frac{2}{iz}$
So f(z) = Im(z) = $\frac{z}{2i} - \frac{2}{iz}$
I am confident to use the Contour integral formula to evaluate for the part $\frac{z}{2i}$, because it is analytic everywhere within or in C ($|z| = 2$).
However, there is a singular point z = 0 for $\frac{2}{iz}$ within C ($|z| = 2$).
Can I still use the contour integral formula?
The only way I can think of is:
$\int_y \frac{Im(z)}{z - \alpha}dz = 2\pi i f(\alpha) = \frac{\alpha}{2i} - \frac{2}{i \alpha}$
But I still feel that something is wrong because f(z) is not analytic at z = 0.
Can someone please give me some advice on this question?
 A: You are on the right track.  We have
$$\begin{align}
\oint_{|z|=2}\frac{\text{Im}(z)}{z-\alpha}\,dz&=\oint_{|z|=2}\frac{1}{2i}\frac{z-\bar z}{z-\alpha}\,dz\\\\
&=\frac{1}{2i}\oint_{|z|=2}\left(\frac{z}{z-\alpha}\right)\,dz-\frac{1}{2i}\oint_{|z|=2}\left(\frac{\bar z}{z-\alpha}\right)\,dz\\\\
&=\frac{1}{2i}\oint_{|z|=2}\left(\frac{z}{z-\alpha}\right)\,dz-\frac{1}{2i}\oint_{|z|=2}\left(\frac{|z|^2}{z(z-\alpha)}\right)\,dz\\\\
&=\frac{1}{2i}\oint_{|z|=2}\left(\frac{z}{z-\alpha}\right)\,dz-\frac{1}{2i}\oint_{|z|=2}\left(\frac{4}{z(z-\alpha)}\right)\,dz\\\\
&=\frac{1}{2i}\oint_{|z|=2}\left(\frac{z}{z-\alpha}\right)\,dz-\frac{2}{i\alpha}\oint_{|z|=2}\left(\frac{1}{z-\alpha}-\frac{1}{z}\right)\,dz\\\\
&=\frac{1}{2i}\oint_{|z|=2}\left(\frac{z}{z-\alpha}\right)\,dz-\frac{2}{i\alpha}\oint_{|z|=2}\left(\frac{1}{z-\alpha}\right)\,dz+\frac{2}{i\alpha}\oint_{|z|=2}\left(\frac{1}{z}\right)\,dz\\\\
&=\frac{1}{2i\alpha}\oint_{|z|=2}\left(\frac{\alpha z-4}{z-\alpha}\right)\,dz+\frac{2}{i\alpha}\oint_{|z|=2}\left(\frac{1}{z}\right)\,dz
\end{align}$$
Can you finish the problem now?
A: More of a real-variable approach: The integral equals
$$\int_0^{2\pi} \frac{(2\sin t) 2ie^{it}}{2e^{it}-\alpha}\,dt = 2i\int_0^{2\pi} \frac{\sin t }{1-(\alpha/2)e^{-it}}\,dt$$ $$\tag 1= 2i\int_0^{2\pi} \sin t\, [1+(\alpha/2)e^{-it} + (\alpha/2)^2e^{-2it} + \cdots ]\,dt.$$
We have all the convergence we need to interchange integral and sum in $(1).$ Recall that over $[0,2\pi],$ $\sin t$ is orthogonal to all the functions in the infinite sum, except for $(\alpha/2)e^{-it}.$ So $(1)$ equals
$$2i\int_0^{2\pi} (\sin t) (\alpha/2)(\cos t -i\sin t)\,dt = \alpha\int_0^{2\pi} \sin^2 t\, dt = \alpha \pi.$$
