$\int _\alpha \frac{z}{(z-\alpha)(z-b)} dz $ where $\alpha$ is the curve shown below I'm struggling with this question. Could you try to help me me?
$$\int _\alpha \dfrac{z}{(z-a)(z-b)} dz $$ where $\alpha$ is the curve shown below:

I know that the answer is $-2i \dfrac{\pi(b-2a)}{a-b}$.
 A: First
$$
\frac{z}{(z-a)(z-b)}=\frac{1}{b-a}\left(\frac{b}{z-b}-\frac{a}{z-a}\right)
$$
Then, we clearly have that
$$
\int_\alpha\frac{dz}{z-a}=2\cdot2\pi i,\quad \int_\alpha\frac{dz}{z-b}=2\pi i
$$
Hence
$$
\int_\alpha\frac{z\,dz}{(z-a)(z-b)}=\frac{2\pi bi}{b-a}-\frac{4\pi ai}{b-a}
$$
A: Hint: Do you know the residue theorem? https://en.wikipedia.org/wiki/Residue_theorem
In your case the curve $\alpha$ has winding number $2$ for $a$ and $1$ for $b$ (why?). Then apply Cauchy's integral formula to single loop curves around $a$ and $b$ to caluculate the residues - i.e if $\gamma$ is a single loop around $a$ then
$$\int_\gamma \frac{z}{(z-a)(z-b)}dz = \frac{2\pi ia}{a-b}.$$
A: Note that the residue at $a$ is $ \frac{a}{a-b}$ and the residue at $b$ is $\frac{b}{b-a}$ and your contour can be deformed as follows.

So the contour goes once (anticlockwise) around $b$ and twice around $a$ so the integral is
\begin{eqnarray*}
2 \pi i \left( \color{red}{2 \frac{a}{a-b}}+ \color{blue}{ \frac{b}{b-a}} \right). 
\end{eqnarray*}
A: We have a partial fraction decomposition
$$\frac{z}{(z-a)(z-b)}=\frac{z}{a-b}\Big(\frac{1}{z-a}-\frac{1}{z-b}\Big)$$
Define $f(z)=z/(a-b)$, now integrate with respect to $\alpha$ to obtain
\begin{align}
\int_{\alpha} \frac{z}{(z-a)(z-b)}&=\int_{\alpha} \frac{z}{a-b}\Big(\frac{1}{z-a}-\frac{1}{z-b}\Big)dz\\
&=2\pi i(f(a)\mathrm{ind}(\alpha ,a)-f(b)\mathrm{ind}(\alpha,b))\\
&=2\pi i\cdot \frac{2a-b}{a-b}
\end{align}
by residue theorem
