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.
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}}.$$