Cauchy integral formula for $f(z) = \frac{z-a}{z+a}$ The following problem is from 'Applied Complex Variables for Scientists and Engineers' by Yue Kuen Kwok. Consider the function 
$$f(z) = \frac{z-a}{z+a}.$$ 
Use the Cauchy Integral Formula to show that 
$$f^{(n)}(0) = -2 \left( - \frac{1}{a} \right)^{n} n!.$$ 
Hint: Replace the variable of integration by its reciprocal. 
So basically, I've been tearing my hair out over this problem, I just cannot seem to formulate it correctly. I've tried many things, but mainly the following: from the general Cauchy integral formula, we have 
$$f^{(n)}(0) = \frac{n!}{2 \pi i} \oint_{|z|=1} \frac{\frac{z-a}{z+a}}{z^{n+1}}dz,$$ 
Now if we use the substitution $z= \frac{1}{w} \implies dz = -\frac{1}{w^2} dw,$  we get an integrand of 
$$-\frac{1-aw}{1+aw} w^{n-1},$$ 
and I just cannot get anything happening from here... As I said, I think I'm formulating it incorrectly. If anyone can tell me what I'm doing wrong, I'd be very grateful, thanks. 
 A: You've done most of the work: you just need to make sure that the contour has only the pole at zero inside it, so take $\int_{|z|=r}$ where $r<\lvert a \rvert$ instead.
Now, what has happened on taking the reciprocal is that the multiple pole at zero, originally the only pole inside the contour, is now outside, while the simple pole at $z=-a$ has become one at $w=-1/a$, which now lies inside the contour. You can use the Cauchy Integral Formula to write down the integral at this value of $w$:
$$ \frac{n!}{2\pi i} \int_{|w|=1/r} - \frac{1/a-w}{1/a+w} w^{n-1} \, dw = n! \cdot -(1/a-(-1/a)) (-1/a)^{n-1} = -2(-1/a)^n n!, $$
as desired.
A: I thought it might be instructive to present an alternative way forward.  Note that we have
$$\begin{align}
\oint_{|z|=r<|a|}\frac{z-a}{z^{n+1}(z+a)}\,dz&=\int_{|z|=R>|a|}\frac{z-a}{z^{n+1}(z+a)}\,dz-2\pi i \text{Res}\left(\frac{z-a}{z^{n+1}(z+a)}, z=-a\right)\\\\
&=\int_{|z|=R>|a|}\frac{z-a}{z^{n+1}(z+a)}\,dz-2\pi i\left(\frac{-2a}{(-a)^{n+1}}\right)\tag1
\end{align}$$
Letting $R\to \infty$, the integral on the right-hand side of $(1)$ approaches $0$.  Hence, we find that 
$$\begin{align}
f^{(n)}(0)&=\frac{n!}{2\pi i}\,(2\pi i)(-2)\left(\frac{-1}{a}\right)^n\\\\
&-2n!\left(\frac{-1}{a}\right)^n
\end{align}$$
as was to be shown!
