Suppose I have to calculate $\int \frac{f(z)}{(z-a)(z-b)}dz$ around a curve in which both $a$ and $b$ lie inside.
Should I apply Residue theorem like this:
Residue at $a$= $\frac{f(a)}{a-b}$
Residue at $b$= $\frac{f(b)}{b-a}$
Then I use the Residue theorem 2pi*(sum of residues)
OR
Should I solve it by partial fractions?
Are both valid?
My confusion with the first method is that the numerator of $\int \frac{f(z)/(z-a)}{(z-b)}$, i.e. $\frac{f(z)}{z-a}$ is not analytic, because $a$ also lies inside the curve. Aren't we allowed to use Cauchy's integral formula only when the numerator is analytic?
They are both valid. If you apply the residue theorem, you'll get that the integral is equal to$$2\pi i\left(\frac{f(a)}{a-b}+\frac{f(b)}{b-a}\right)=2\pi i\frac{f(b)-f(a)}{b-a}$$and if you apply partial fractions together with Cauchy's integral theorem, you'll get\begin{align}\oint\frac{f(z)}{(z-a)(z-b)}\,\mathrm dz&=\oint\frac{f(z)}{(b-a)(z-b)}+\frac{f(z)}{(a-b)(z-a)}\,\mathrm dz\\&=\frac1{b-a}\left(\oint\frac{f(z)}{z-b}\,\mathrm dz-\oint\frac{f(z)}{z-a}\,\mathrm dz\right)\\&=2\pi i\frac{f(b)-f(a)}{b-a}.\end{align}