Geometry behind $\int_{0}^{2π}\frac{e^{ix}}{e^{ix}-z}~dx=2\pi(|z|<1)$ It's a nice exercise to prove, 
$$\int_{0}^{2π}\frac{e^{ix}}{e^{ix}-z}~dx=2\pi(|z|<1)$$ using Leibneiz's rule.But,what's the geometrical interpretation of this?Any idea?
 A: My attempt at providing a "geometric" interpretation will repeat @robjohn's points, before looking at it from a physical perspective.
With $w:=e^{ix}$, we can rewrite this as a contour integral, $\oint_{|w|=1}\frac{dw}{w-z}=2i\pi[|z|<1]$. It always helps to think of $\Bbb C$ as a Euclidean plane. Placing a $1/(w-z)$ factor in the loop contributes $2\pi$ to the integral, provided the pole $z$ is also in the loop. This is analogous to Ampère's law, in which current passing through a loop generates a magnetic field. Or if you consider a 2D closed surface in 3D space instead, Gauss's law says an electric field is generated by an enclosed charge. Physics metaphors aside, we're quantifying what is enclosed in a set boundary; it's all effectively Stokes's theorem (see also here).
A: Multiplying by $i$, we get, with $w=e^{ix}$,
$$
\oint_{|w|=1}\frac{\mathrm{d}w}{w-z}=2\pi i\,[|z|\lt1]\tag1
$$
The function $\frac1{w-z}$ has residue $1$ at $w=z$, and this simply states that $z$ is inside the contour $|w|=1$ when $|z|\lt1$ and outside when $|z|\gt1$.
When $|z|=1$, $(1)$ only converges in the principal value sense to $\pi i$.
A: I'm not sure about geometrical, but you can get the same result with complex analysis. Consider the path $\gamma$ defined by the counterclockwise rotation on $|z|=1$. Note here I am using $z$ as a variable and will call the constant $z$ from your statement by $z_0$. Then
$$\int_\gamma \frac{1}{z-z_0}dz$$
can be transformed by $z=e^{i\theta}$ to become
$$=i\int_{0}^{2\pi}\frac{e^{i\theta}}{e^{i\theta}-z_0}dz$$
However, we can also solve this integral using the Residue Theorem. Since $|z_0|<1$, there is exactly one pole inside $\gamma$. We can find the residue at this pole easily:
$$\text{Res}(z_0)=\lim_{z\to z_0} (z-z_0)\frac{1}{z-z_0}=1$$
Then
$$i\int_{0}^{2\pi}\frac{e^{i\theta}}{e^{i\theta}-z_0}dz=\int_\gamma \frac{1}{z-z_0}=2\pi i\text{Res}(z_0))=2\pi i$$
$$\int_{0}^{2\pi}\frac{e^{i\theta}}{e^{i\theta}-z_0}dz=2\pi$$
A: 
I thought it might be instructive to present an approach that does not rely on contour integration and Cauchy's Integral Theorem, but uses straightforward complex arithmetic and real analysis only.  To that end we proceed to write the integral of interest in terms of its real and imaginary parts.


Let $z=re^{i\theta}$  Then, multiplying the numerator and denominator by the complex conjugate of the denominator, we find that 
$$\begin{align}
\int_0^{2\pi}\frac{e^{ix}}{e^{ix}-z}\,dx&=\int_0^{2\pi}\frac{1-r\cos(x-\theta)-ir\sin(x-\theta)}{1+r^2-2r\cos(x-\theta)}\,dx\\\\
&=2\int_0^{\pi}\frac{1-r\cos(x)}{1+r^2-2r\cos(x)}\,dx-i\underbrace{\int_{-\pi}^{\pi}\frac{r\sin(x)}{1+r^2-2r\cos(x)}\,dx}_{=0}\\\\
&=\left.\left(x-2\arctan\left(\frac{(1-r)\cot(x/2)}{1+r}\right) \right)\right|_0^\pi\\\\
&=\pi-2(0-\pi/2)\\\\
&=2\pi
\end{align}$$
as was to be shown!
