Complex integral of product of two polynomial powers 
Compute $$\int_{|z|=1}z^n\left(z-\dfrac{1}{2}\right)^mdz$$ where $m,n$ are integers.

If $m,n\geq 0$, the function is entire, and so the integral is $0$.
If $n<0$ and $m\geq 0$, the function becomes $\dfrac{\left(z-\dfrac12\right)^m}{z^{|n|}}$. This can be handled by the Cauchy formula. Let $f(z)=\left(z-\dfrac12\right)^m$. Then the integral is $\dfrac{2\pi i}{|n-1|!}\cdot f^{(|n-1|)}(0)$.
If $m<0$ and $n\geq 0$, it should be similar.
But what if $m,n<0$? Now there are two values for which the denominator vanish. How can we use Cauchy's theorem or otherwise?
Edit: Since this exercise appears in Ahlfors many sections before the Residue theorem, I would like to see a solution that doesn't use Residue theorem.
 A: Residue theorem.  The residue of $z^{-j} (z - 1/2)^{-k}$ at $z=0$, for example,
is the coefficient of $z^{j-1}$ in the Maclaurin series of $(z-1/2)^{-k}$, which you can find using the binomial series.
A: 
$\displaystyle{%
\int_{\left\vert\, z\,\right\vert\ =\ 1}
z^{n}\left(z- {1 \over2}\right)^{m}\,{\rm d}z:\ {\large ?}\\[5mm]
}$

In general, we have two expansion of the integrand:


*

*
$$
z^{n}\left(z- {1 \over2}\right)^{m}
=
\left(-1\right)^{m}
\sum_{\ell = 0}^{\infty}{m \choose \ell}{1 \over 2^{m - \ell}}\,
{\left(-1\right)^{\ell} \over z^{-n - \ell}}    
$$

*
$$
z^{n}\left(z- {1 \over2}\right)^{m}
=
\left[{1 \over 2} + \left(z - {1 \over 2}\right)\right]^{n}\left(z- {1 \over2}\right)^{m}
=
\sum_{\ell = 0}^{\infty}{n \choose \ell}{1 \over 2^{n - \ell}}\,
{1 \over \left(z - 1/2\right)^{-m - \ell}}    
$$


where $\displaystyle{x \choose y}$ is the
$\it\underline{\mbox{generalized binomial coefficient}}$ as explained
here.
When $m \leq -1$ and $n \leq -1$ ( $m$ and $n$ integers ) we have to consider both poles: At $z = 0$ and at $z = 1/2$. The result turns out to be:
\begin{align}
\int_{\left\vert\, z\,\right\vert\ =\ 1}
z^{n}\left(z- {1 \over2}\right)^{m}\,{\rm d}z
&=
2\pi{\rm i}\left[%
{m \choose -n - 1}\left(-\,{1 \over 2}\right)^{m + n + 1}
+
{n \choose -m - 1}{1 \over 2^{n + m + 1}}\right]
\\[3mm]&=
2\pi{\rm i}\left[%
{n \choose -m - 1} + \left(-1\right)^{m + n + 1}{m \choose -n - 1}
\right]\,{1 \over 2^{m + n + 1}}
\\[3mm]&=
2\pi{\rm i}\left[%
\left(-1\right)^{m + 1}{-m - n - 2 \choose -m - 1}
+
\left(-1\right)^{m}{-m - n - 2\choose -n - 1}
\right]\,{1 \over 2^{m + n + 1}}
\\&
\phantom{%
\left[%
{n \choose -m - 1} + \left(-1\right)^{m + n + 1}{m \choose -n - 1}
\right]}
m, n \in {\mathbb Z}\,,\quad m \leq -1\,,\quad n \leq -1.
\end{align}
