Integrate a function over a contour including infinitely many poles, such as $\int_{|z|=1}1/\sin(1/z)\,dz$ We can find complex integration of a function over a closed contour by residue theorem if there are only finite many singularity inside the contour. But my question is how to find  the integration if there are infinite many singularity inside the contour? Please help me solve this type of problem mention below.
$$\int_{|z|=1} \frac{1}{\sin(\frac{1}{z})} dz$$
 A: Ok this is what i would do (i assume the unit circle is traversed in counter clockwise direction):
Let's denote
$$
f(z)=\frac{1}{\sin(1/z)}
$$
As the OP already noted the integrand behaves quite nasty inside the unit disc. The reason is the infinite number of poles showing up as $z\rightarrow 0$.
So what can we do?
One idea would be to look at the outside of the unit disc rather then into its inside because we only have one pole at $z=\infty$rather then an uncountable number which is not so bad. 
By residue theorem, the countour integral around the pole at infinity is the negative of the integral around the unit circle. We get
$$
\oint_{|z|=1}f(z)dz=-2\pi i\text{Res}(f(z),z=\infty)
$$
the residue at infinity is given by
$$
\text{Res}(f(z),z=\infty)=\text{Res}(-f(\frac{1}{z})/z^2,z=0)
$$
using $\sin(z)=z-z^3/3!+z^5/5!+\mathcal{O}(z^7)$ and expand the fraction as a geometric series we get $\text{Res}(f(z),z=\infty)=-1/6$ and 
$$
\oint_{|z|=1}f(z)dz=\frac{\pi i}{3}
$$
as announced in the comments
A: $I=\oint_{|z|=1}f(z)dz=-\oint_{|u|=1}\frac{du}{u^2 \sin(u)}=\frac{\pi i}{3}$
(the rotation is not in the trigonometric sense, as the residus inside $|z|=1$ are outside |u=1| with $z=1/u$).
The residue of $\frac1{u^2 \sin(u)}$ in $u=0$ is $\frac16$. This is linked to the theory of residue at infinity.
