TITLE: Intuitive explanation of Residue theorem in Complex Analysis
QUESTION [9 upvotes]: The residue theorem that states that if 
a) $U$ is a simply connected and  open subset of the complex plane, 
b) $a_1,\dots,a_n$ are finitely many points of $U$,
c) and $f$ is a function which is defined and holomorphic on $U\backslash \{a_1,\dots,a_n \}$,
d) $\gamma$ is a rectifiable and positively oriented curve in $U$ which does not meet any of the $a_k$, and whose start point equals its end point,
then
$$
\oint_\gamma f(z)\, dz =
2\pi i \sum_{k=1}^n  
\operatorname{Res}( f, a_k ).
$$
Question: What is the intuitive explanation of this theorem ? 
I appreciate a explanation like geometry ( whit Java Applet ? ). But algebric explanation are welcome. I know the proof of this theorem, I'm just trying to understand the intuition ( if exists ) this theorem.
I'm motivated to get an intuition of this theorem because he gave a wonderful explanation of the intuitive of an part of fundamental theorem of calculus using the properties of the  telescopic sums, mean value theorem and Riemann sum whit partition $\{a=x_0<x_1<\dots<x_n=b \}$ of interval:
\begin{align}
F(b)-F(a)=
& \sum_{k=1}^{n}[F(x_k)-F(x_{k-1})]
& \mbox{ telescopic sum }
\\
=
&
\sum_{k=1}^{n}F^\prime(x_k^*)[x_k-x_{k-1}]
&
\mbox{Mean Value Theorem}
\\
=
&
\sum_{k=1}^{n}F^\prime(x_k^*)\Delta x_k
&
\mbox{Riemann sum}
\\
\approx
&
\int_{a}^{b}F^\prime(x)\, dx
&
\end{align}
It makes me think that there may be an explanation as elegant as this (but not necessarily following the same reasoning) in understanding the theorem of residues.

REPLY [11 votes]: The algebraic intuitive explanation is that for all $n\in \mathbb Z$, the functions $z^n$ integrate to $0$ around a simple closed loop containing $z=0$, except when $n=-1$, when the integral is $2\pi i$.
From this observation it follows that if $f$ is a meromorphic function with one simple singularity at $z=a$ then $f(z)=g(z)/(z-a)$  where $g$ is holomorphic and when you expand $f$ in a Laurent series around $z=a$ (by using the Taylor series of $g$) you get one term $g(a)/(z-a)$ plus other terms that do not contain $z-a$ to a negative power, that is, a power series around $z=a$. When you integrate $f$ in that form, all terms but one become zero. The one that is left (hence the name residue) is the one corresponding to $g(a)/(z-a)$, whose integral is $2\pi i g(a)$. This is the  Residue Theorem. It needs to be extended to handle higher-order singularities and multiple singularities but the essential idea is the one above.