In Marsden's Complex Analysis, section 2.4, the main theorem is Cauchy's integral formula (C.I.F) and there appears this problem:
Let $f$ be analytic inside and on $\gamma: |z-z_0|=R$. Prove that $$\frac{f(z_1)-f(z_2)}{z_1-z_2}-f'(z_0)=\frac{1}{2\pi i}\int_\gamma\frac{f(z)}{(z-z_1)(z-z_2)}-\frac{f(z)}{(z-z_0)^2}$$ for $z_1, z_2$ inside $\gamma$
My attempt: That $$-f'(z_0) = - \frac{1}{2 \pi i} \int_\gamma \frac{f(z)}{(z-z_0)^2}$$ follows from Cauchy's integral formula.
In order to evaluate $$\frac{1}{2\pi i}\int_\gamma\frac{f(z)}{(z-z_1)(z-z_2)}$$ we can draw two "very" small circles, parametrized as curves oriented negatively, around $z_1$ and $z_2$ respectively. I called them $- \alpha$ and $- \beta$. It can be shown that $$ \frac{1}{2\pi i}\int_\gamma\frac{f(z)}{(z-z_1)(z-z_2)} = -\frac{1}{2\pi i}\int_\alpha\frac{f(z)}{(z-z_1)(z-z_2)} - \frac{1}{2\pi i}\int_\beta\frac{f(z)}{(z-z_1)(z-z_2)} $$
(to see this, according to figure draw a line connecting $z_1$ and $z_2$, dividing the greatest circle $\gamma$ in two regions, A and B, where $\frac{f(z)}{(z-z_1)(z-z_2)}$ is analytic and hence the integral es $0$ trough the frontier in each of these regions (the curves with arrows blue and red in the figure) and hence the integral is $0$ in the sum of the two curves. And after canceling the segments of line (because in the red curve are traveled in opposite direction with respect of the blue curve), we get our claim (the small remaining circles around $z_1$ and $z_2$ are $\alpha$ and $\beta$))
But $\frac{f(z)}{(z-z_2)}$ is analytic inside $\alpha$ and $\frac{f(z)}{(z-z_1)}$ is analytic inside $\beta$. So Cauchy's formula gives
$$\frac{1}{2 \pi i}\int_\alpha \frac{f(z)}{(z-z_2)(z-z_1)} = \frac{f(z_1)}{(z_1-z_2)} = -\frac{f(z_1)}{(z_2-z_1)}$$ and $$\frac{1}{2 \pi i}\int_\beta \frac{f(z)}{(z-z_1)(z-z_2)} = \frac{f(z_2)}{(z_2-z_1)}= \frac{f(z_2)}{(z_2-z_1)} $$
hence $$ \frac{1}{2\pi i}\int_\gamma\frac{f(z)}{(z-z_1)(z-z_2)} = -\left(\frac{f(z_2)-f(z_1)}{(z_2-z_1)} \right) = \frac{f(z_1)-f(z_2)}{(z_2-z_1)}$$ So I get the desired result, except that $f(z_1)$ is interchanged with $f(z_2)$. Where do I committed a mistake?
Hint: using $$ \frac{1}{(z-z_1)(z-z_2)}=\frac{1}{z_1-z_2}\left(\frac{1}{z-z_1}-\frac{1}{z-z_2}\right) $$ and Cauchy's Integral Formula, then one has $$ \frac{1}{2\pi i}\int_\gamma\frac{f(z)}{(z-z_1)(z-z_2)}=\frac{1}{z_1-z_2}\frac{1}{2\pi i}\int_\gamma\left(\frac{f(z)}{z-z_1}-\frac{f(z)}{z-z_2}\right)=\frac{1}{z_1-z_2}(f(z_1)-f(z_2)). $$