Computing $\int_{\alpha}\frac{1}{(z-a)^n(z-b)^m}dz$ using Cauchy integral formula Let $\alpha(t) = re^{it}$ where $|a|<r<|b|$ and $t \in [0,2\pi]$. I'd like to compute
$$\int_{\alpha}\frac{1}{(z-a)^n(z-b)^m}dz \ \ \ \ n, m \in \mathbb{N}.$$
It appears that the answer is
$$2\pi i (-1)^m{n + m -2 \choose n-1}\frac{1}{(b-a)^{n+m-1}}.$$
I try to compute it but I'm not sure how that's the final answer. Here is my attempt:
Let $f(z) = \frac{1}{(z-b)^m}$, then by Cauchy integral formula
$$\int_{\alpha}\frac{1}{(z-a)^n(z-b)^m}dz = \int_{\alpha}\frac{f(z)}{(z-a)^n}dz = \frac{2\pi i}{(n-1)!}f^{(n-1)}(a).$$
Trying to find an expression of $f^{(n-1)}(z)$
\begin{align*}
f^{(1)} &= -m\frac{1}{(z-b)^{m-1}}\\
f^{(2)} &= m(m-1)\frac{1}{(z-b)^{m-2}}\\
f^{(3)} &= -m(m-1)(m-2)\frac{1}{(z-b)^{m-3}}\\
&\vdots\\
f^{(n-1)} &= (-1)^{n-1}m(m-1)(m-2)\dotsc(m-n + 2)\frac{1}{(a-b)^{m-n+1}}
\end{align*}
I think this should be correct. So,
\begin{align*}
\int_{\alpha}\frac{1}{(z-a)^n(z-b)^m}dz &= \frac{2\pi i}{(n-1)!}(-1)^{n-1}m(m-1)(m-2)\dotsc(m-n + 2)\frac{1}{(a-b)^{m-n+1}}\\
&= \frac{2\pi i}{(n-1)!}(-1)^{2n-2-m}m(m-1)(m-2)\dotsc(m-n + 2)\frac{1}{(b-a)^{m-n+1}}\\
&=\frac{2\pi i}{(n-1)!}(-1)^{m}m(m-1)(m-2)\dotsc(m-n + 2)\frac{1}{(b-a)^{m-n+1}}.
\end{align*}
But the exponent on $(b-a)$ is not the same. Further, I have no clue how I can get the binomial coefficient. Writing out the binomial coefficient in the given answer doesn't seem to help me either.
$${n + m -2 \choose n-1} = \frac{(n+m-2)!}{(n-1)!(m-1)!} = \frac{(n+m-2)(n+m-3)\dotsc 2\cdot 1}{(n-1)!(m-1)!} $$
NOTE: I haven't learned residue theorem yet.
 A: Answering my own question, thanks to the comments.
Let $f(z) = \frac{1}{(z-b)^m}$, then by Cauchy integral formula
$$\int_{\alpha}\frac{1}{(z-a)^n(z-b)^m}dz = \int_{\alpha}\frac{f(z)}{(z-a)^n}dz = \frac{2\pi i}{(n-1)!}f^{(n-1)}(a).$$
Trying to find an expression of $f^{(n-1)}(z)$
\begin{align*}
f^{(1)} &= -m\frac{1}{(z-b)^{m+1}}\\
f^{(2)} &= m(m+1)\frac{1}{(z-b)^{m+2}}\\
f^{(3)} &= -m(m+1)(m+2)\frac{1}{(z-b)^{m+3}}\\
&\vdots\\
f^{(n-1)} &= (-1)^{n-1}m(m+1)(m+2)\dotsc(m+n - 2)\frac{1}{(a-b)^{m+n-1}}
\end{align*}
So,
\begin{align*}
\int_{\alpha}\frac{1}{(z-a)^n(z-b)^m}dz &= \frac{2\pi i}{(n-1)!}(-1)^{n-1}m(m+1)(m+2)\dotsc(m+n - 2)\frac{1}{(a-b)^{m+n-1}}\\
&= \frac{2\pi i}{(n-1)!}(-1)^{n-1-m-n+1}m(m+1)(m+2)\dotsc(m+n - 2)\frac{1}{(b-a)^{m+n-1}}\\
&=\frac{2\pi i}{(n-1)!}(-1)^{-m}m(m+1)(m+2)\dotsc(m+n - 2)\frac{1}{(b-a)^{m+n-1}}\\
&=\frac{2\pi i}{(n-1)!}(-1)^{m}m(m+1)(m+2)\dotsc(m+n - 2)\frac{1}{(b-a)^{m+n-1}}.
\end{align*}
Note that
$${n + m -2 \choose n-1} = \frac{(n+m-2)(n+m-3)\dotsc m}{(n-1)!}.$$
Hence,
$$\int_{\alpha}\frac{1}{(z-a)^n(z-b)^m}dz = 2\pi i(-1)^m{n + m -2 \choose n-1}\frac{1}{(b-a)^{m+n-1}}.$$
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\on}[1]{\operatorname{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
$\ds{\bbox[5px,#ffd]{}}$

\begin{align}
&\bbox[5px,#ffd]{\left.
\oint_{\verts{z}\ =\ r}\,\,
{\dd z \over \pars{z - a}^{\,n}\pars{z - b}^{\,m}}
\,\right\vert_{\substack{n, m\ \in\ \mathbb{N} \\[1mm]
\verts{a}\ <\ r\ <\ \verts{b}}}}
\\[5mm] = &\
2\pi\ic\on{Res}\bracks{{1 \over \pars{z - a}^{\,n}
\pars{z - b}^{\,m}}, z = a}\label{1}\tag{1}
\end{align}

\begin{align}
\mbox{Note that}\ &
{1 \over \pars{z - b}^{m}} =
{1 \over \bracks{a - b + \pars{z - a}}^{m}}
\\[5mm] & =
{1 \over \pars{a - b}^{m}}
\bracks{1 + {z - a \over a - b}}^{-m}
\\[5mm] & =
{1 \over \pars{a - b}^{m}}
\sum_{k = 0}^{\infty}{-m \choose k}
\pars{z - a \over a - b}^{k}
\end{align}
(\ref{1}) becomes
\begin{align}
&\bbox[5px,#ffd]{\left.
\oint_{\verts{z}\ =\ r}\,\,
{\dd z \over \pars{z - a}^{\,n}\pars{z - b}^{\,m}}
\,\right\vert_{\substack{n, m\ \in\ \mathbb{N} \\[1mm]
\verts{a}\ <\ r\ <\ \verts{b}}}}
\\[5mm] = &\
2\pi\ic{1 \over \pars{a - b}^{m}}
\bracks{{-m \choose n - 1}
\pars{1 \over a - b}^{n - 1}}
\\[5mm] = &\
2\pi\ic{1 \over \pars{a - b}^{m + n - 1}}
{m + \bracks{n - 1} - 1 \choose n - 1}\pars{-1}^{n - 1}
\\[5mm] = &\
\bbx{2\pi\ic\,\pars{-1}^{m}
{n + m - 2 \choose n - 1}
{1 \over \pars{b - a}^{n + m - 1}}} \\ &
\end{align}
