Using Cauchy's integral formula to solve $\int_{|z| = 2} \frac{e^z}{z^2(z-1)}\,dz$ On p. 116 in Complex Analysis by Gamelin, he has just introduced some examples of the application of the Cauchy Integral Formula (CIF). He then considers the integral $$\int_{|z| = 2} \frac{e^z}{z^2(z-1)}\,dz$$ which cannot immediately be solved using CIF. He introduces a way to solve this by cutting out two discs of radius $\epsilon$ centered at $0$, and $1$ to obtain, $$\int_{|z| = 2} \frac{e^z}{z^2(z-1)}\,dz = \int_{|z| = \epsilon} \frac{e^z}{z^2(z-1)}\,dz + \int_{|z-1| = \epsilon} \frac{e^z}{z^2(z-1)}\,dz.$$ 
What makes it ok to do this cut out of discs? He do not mention his reasoning.My guess is that since we want the theorem to be applicable we need to take care of the singularities in some way and I do agree with him in applying the theorem to the two new integrals around the two epsilon discs. Is the "formal" argument for doing what he did that since the discs with radius $\epsilon$ union with the disc $\{|z| = 2\}$1 is a bounded domain with piecewise smooth boundary, and since the integrands $f(z) = \frac{e^z}{z-1}$ and $f(z) = \frac{e^z}{z^2}$ are analytic on $\{|z|=\epsilon\}$ and  $\{|z-1|=\epsilon\}$ respectively, we can be guaranteed that it works? However, what is meant by it? Do we let $\epsilon \to 0$? 
All help is appreciated, thank you! 
 A: We want to calculate $$I = \int_{\partial D} \frac{e^z}{z^2(z-1)}dz$$ where $D = \{z \in \mathbb{C}: |z| \leq 2\}$. 
Since the integrand $\frac{e^z}{z^2(z-1)}$ has two singularities in $D$, namely, at $z = 0$, and $z = 1$, we remove two epsilon-discs, containing these points, from $D$, in order to get a domain where the integrand $\frac{e^z}{z^2(z-1)}$ is analytic. This we do in order to apply Cauchy's theorem ($\int_{}f(z)dz = 0$ whenever $f(z)$ is analytic.)
We now consider the integral $$I_\epsilon = \int_{D_\epsilon}\frac{e^z}{z^2(z-1)}dz$$ where $D_\epsilon$ is the punctured disc, $D\epsilon = D-\{z \in \mathbb{C}: |z| \leq \epsilon\}-\{z \in \mathbb{C}: |z-1| \leq \epsilon\}$. 
By Cauchy's theorem, $$0 = \int_{D_\epsilon}\frac{e^z}{z^2(z-1)}dz = \int_{D} \frac{e^z}{z^2(z-1)}dz - \int_{|z| = \epsilon}\frac{e^z}{z^2(z-1)}dz - \int_{|z-1| = \epsilon} \frac{e^z}{z^2(z-1)}dz \iff \int_{D} \frac{e^z}{z^2(z-1)}dz = \int_{|z| = \epsilon}\frac{e^z}{z^2(z-1)}dz + \int_{|z-1| = \epsilon} \frac{e^z}{z^2(z-1)}dz$$
We can apply Cauchy's integral formula, $$f^{(m)}(z) = \frac{m!}{2\pi i} \int_{\partial D} \frac{f(w)}{(w-z)^{m+1}}dw,$$
to each summand of the integral,
$$I = \int_{|z| = \epsilon}\frac{e^z}{z^2(z-1)}dz + \int_{|z-1| = \epsilon} \frac{e^z}{z^2(z-1)}dz = 2\pi i \frac{d}{dz}\left[\frac{e^z}{z-1}\right]\biggr\rvert_{z = 0} + 2\pi i \left[\frac{e^z}{z^2}\right]\biggr\rvert_{z = 1} = 2\pi i (-2) + 2\pi i (e) = 2\pi i(e-2).$$
A: An easier version. Use partial fraction decomposition 
$$\frac{1}{z^2(z-1)}=-\frac{1}{z^2}-\frac{1}{z}+\frac{1}{z-1}$$ 
then
$$\int\limits_{|z|=2}\frac{e^z}{z^2(z-1)}dz=
-\int\limits_{|z|=2}\frac{e^z}{z^2}dz - \int\limits_{|z|=2}\frac{e^z}{z}dz + \int\limits_{|z|=2}\frac{e^z}{z-1}dz$$
and now you can apply Cauchy's integral formula:
$$f^{(n)}(a)=\frac{n!}{2\pi i} \int\limits_{\gamma}\frac{f(z)}{(z-a)^{n+1}}dz$$
where $f(z)=e^z$, for each of the three parts.
$$\int\limits_{|z|=2}\frac{e^z}{z^2(z-1)}dz=
-2\pi i f'(0)-2\pi i f(0) + 2\pi i f(1)=
 2\pi i (e-2)$$
