Contour Integration on unit circle. Find The Following :
$$\int_{|z|=1}\frac{z^n}{z-1}\,dz$$  
N.B Cauchy Residue formula does not work. Since the pole is on the boundary.
 A: Since this integration path goes over a non-integrable singularity, it does not exist. However it has a principal value, defined as $$ \lim_{\epsilon\to 0}\int_{C_\epsilon} \frac{z^n}{z-1}dz$$ where $C_{\epsilon}$ is the unit circle with a symmetric chunk radius $\epsilon$ cut out of it at $z=1.$ i.e. it's the path $e^{it}$ for $\epsilon < t < 2\pi-\epsilon.$
To compute the principal value, note that, we can write it as an integral over a closed contour that makes a semi-circular detour inside the singularity, minus the integral over that semi circular contour which we call $D_\epsilon$ give explicitly as $$ 1 + \epsilon e^{-it} \,\,\,\, \pi/2 <  t < 3\pi/2.$$
(Note some small amount of deformation is necessary to make this exactly a semicircle, but it becomes exact in the limit $\epsilon\to 0.$)
We can do this semi-circle integral in the limit by inserting the path above: $$ \lim_{\epsilon\to 0}\int_{D_\epsilon}\frac{z^n}{z-1}dz = \lim_{\epsilon\to 0}\int_{\pi/2}^{3\pi/2} (1+\epsilon e^{-it})^n(-i) = -i\pi.$$
The integral along the closed contour with the detour around the pole is zero by Cauchy (since we went around the pole on the inside, the contour does not contain it). So the answer is $$ \lim_{\epsilon\to 0}\int_{C_\epsilon} \frac{z^n}{z-1}dz = 0 - (-i\pi) = i\pi$$ 
A: The integral $\oint_{|z|=1}\frac{z^n}{z-1}\,dz$ fails to exist inasmuch as the contour of integration intersects the pole at $z=1$.
However, the Cauchy Principal Value as defined by 
$$PV\oint_{|z|=1}\frac{z^n}{z-1}\,dz=\frac12 \lim_{\epsilon \to 0^+}\left(\oint_{|z|=1+\epsilon}\frac{z^n}{z-1}\,dz+\oint_{|z|=1-\epsilon}\frac{z^n}{z-1}\,dz\right)\tag1$$
exists and is trivial to evaluate.  
The second integral on the right-hand side of $(1)$ is equal zero since $\frac{z^n}{z-1}$ is analytic in and on the contour $|z|=1-\epsilon$ for all $\epsilon>0$.
For the first integral on the right-hand side of $(1)$, Cauchy's Integral Formula (or the residue theorem) guarantees that  $\oint_{|z|=1+\epsilon}\frac{z^n}{z-1}\,dz=2\pi i$ for each $\epsilon>0$.
Therefore, we have
$$PV\oint_{|z|=1}\frac{z^n}{z-1}\,dz=i \pi $$
