Evaluate $\int_{\left | z \right |=3} (e^{z}-1)dz/(z(z-1)(z-i))$ 
I want to evaluate the integral $$\int_{\left | z \right |=3} \frac{e^{z}-1}{z(z-1)(z-i)}\,dz$$ 
  by using the following  theorem:
If a function $f$ is analytic everywhere in the finite plane except for a finite number of singularities interior to a positively oriented simple closed curve $C$, then 
  $$\int_{C}f(z) dz=2\pi i\text{Res}\left ( \frac{1}{z^{2}}f(\frac{1}{z}), 0 \right ).$$

I want to calculate this integral  by calculating the residue at 0 of $\frac{1}{z^{2}}f(\frac{1}{z})=\frac{1+\frac{1}{2!z}+\frac{1}{3!z^{2}}\cdot \cdot \cdot }{1-(1+i)z+iz^{2}}$
So I did long division but the coefficient of 1/z is 0. 
I know the method of calculating the residues at each singularities 0, 1, i, respectively. This method gives me the answer $2\pi i(0+\frac{e-1}{1-i}+\frac{e^{i}-1}{i(i-1)})$ which is not 0. Why answers are different?? Why does not hold long division method? Any help please.
 A: $$e^z-1=\sum_{n=1}^{\infty}\frac{z^n}{n!}=zg(z)$$ where $g(0) \neq 0$
So $0$ is a removable singularity of $f$.
Now $f$ has poles of order $1$ at $z=1,i \in D(0,3)$.
Thus $$\int_{|z|=3}f(z)dz=\frac{1}{2 \pi i} [Res(f,1)+Res(f,i)]=\frac{1}{2 \pi i}[\frac{e^i-1}{i(i-1)}+\frac{e-1}{1-i}]$$
A: We have that for $A=\frac{1+i}{2}$ and $B=\frac{1-i}{2}$,
$$\frac{f(1/z)}{z^{2}}=\frac{(e^{1/z}-1)z}{(1-z)(1-iz)}=
A(e^{1/z}-1)\cdot\frac{z}{1-z}-iB(e^{1/z}-1)\cdot\frac{iz}{1-iz}\\
=A\sum_{k\geq 1}\frac{1}{k!z^k}\sum_{j\geq 1}z^j-iB\sum_{k\geq 1}\frac{1}{k!z^k}\sum_{j\geq 1}(iz)^j$$
Now the residue at $0$ of the left-hand side, i.e. its coefficient of $1/z$,  is obtained by letting $j=k-1$:
$$A\sum_{k\geq 2}\frac{1}{k!}-B\sum_{k\geq 2}\frac{i^k}{k!}=A(e-2)-B(e^i-1-i)=\frac{1+i}{2}(e-2)-\frac{1-i}{2}(e^i-1-i)$$
which is exactly the sum of the other residues $\displaystyle 0+\frac{e-1}{1-i}+\frac{e^{i}-1}{i(i-1)}$.
P.S. A first version of this answer appeared in Evaluate the integral $\int_{\left | z \right |=3} (e^{z}-1)dz/(z(z-1)(z-i))$ then I realized that this question had been posted twice and I moved my answer here.
