Help integrating the contour integral $\oint_C \frac{e^{\frac{1}{z}}}{z(1-qz)}dz$ around the unit circle Consider the integral $$\oint_C \frac{e^{\frac{1}{z}}}{z(1-qz)}dz$$
where C is the anti-clockwise oriented unit circle and q is a complex constant.
I have no clue how to integrate this. I tried using the residue theorem but it just doesn't come out correctly. Any help would be appreciated. The reason I am stuck is because it seems like there are an infinite amount of poles at z =0, so am very confused
 A: Following the recommendation of @honey kumar you can expend the integrand into the series. The integrand is analytic in all points of the unit circle, except for $z=0$. So, you can deform the contour into a circle of smaller radius $r\to0$ around $z=0$, and then to choose all terms of the integrand expansion into series containing $\frac{1}{z}$, because only these terms will contribute, according to the residual theorem.
$\frac{e^{\frac{1}{z}}}{z(1-qz)}=\frac{1}{z}\left(1+\frac{1}{z1!}+\frac{1}{z^22!}+\frac{1}{z^33!}+...\right)\left(1+qz+q^2z^2+q^3z^3+...\right)$
You need to take only simple poles from this expression. It gives:
$I(q)=\oint_C \frac{e^{\frac{1}{z}}}{z(1-qz)}dz=\oint_C\frac{dz}{z}\left(1+\frac{qz}{z1!}+\frac{q^2z^2}{z^22!}+\frac{q^3z^3}{z^33!}+...\right)=\oint_C\frac{dz}{z}e^q=2\pi{i}e^q$
An important point:
thanks to @A rural reader who points out that $I(q)=2\pi{i}e^q$ at $|q|<1$ and that at $|q|>1$ the integral is zero.
Indeed, when we squeeze the contour ($|z|=r\to0$) and if $|q|>1$ the integration path will have to cross the point $z=\frac{1}{q}$ first, and only after we can enjoy the expansion of $\frac{1}{1-qz}=1=qz+q^2z^2+...$. When crossing the point $z=\frac{1}{q}$ we will get an additional residual in this point ($=-e^q$) which will cancel the residual at $z=0$.
We can also show that $I(|q|>1)=0$ directly:
$I(q)=\oint_C \frac{e^{\frac{1}{z}}}{z(1-qz)}dz=-\oint_C \frac{e^{\frac{1}{z}}}{qz^2(1-\frac{1}{qz})}dz=$$=-\oint_C\frac{dz}{qz^2}\left(1+\frac{1}{z1!}+\frac{1}{z^22!}+\frac{1}{z^33!}+...\right)\left(1+\frac{1}{qz}+\frac{1}{q^2z^2}+...\right)=0$
because there is no  simple poles at $z=0$.
A: First get rid of the $e^{1/z}$ term, make the change of variable $w = 1/z$. Then
the integral can be written
\begin{equation}
-\int_{C'}\, \frac{e^w}{w - q}\, dw
\end{equation}
and we're still on the same circle, but now going clockwise. The only pole is at $w = q$, so if $q$ is outside the unit disk the integral is zero. If it's inside, the residue is $-e^q$, so, accounting for the direction of the integration, the integral is $2\pi i e^q$.
