This is an old revision of the document!
So, you have learned what holomorphic function looks like, and you know there are functions which are 'bad' only at a few points. What do you want to do with these functions?
Just like calculus, you can do differentiation, and you can do integration. Differentiation is easy, let's talk about integration.
Recall what we do in real analysis case: given $f(x)$ on $\R$, we can find one primitive $F(x)$ by considering $$ F(x) = C + \int_{x_0}^x f(u) du $$ where we set the initial condition that $F(x_0) = C$, and $F'(x)= f(x)$.
Can we do the same here? Say $f(z)$ is any complex valued function, $f: \C \to \C$, can we try to get a function $F(z)$, such that $F(z_0) = C$, and $F'(z) = f(z)$? We can try $$ F(z) = \int_{z_0}^z f(u) du $$ Now, we immediately run into trouble: how do we go from $z_0$ to $z$? Does the integration depends on how we choose the path from $z_0$ to $z$?
You immediately would get, if $F$ is a holomorphic function (since we say its complex derivative $F'(z)$ exists), then $f(z)$ is also holomorphic. That is a necessary condition. So you cannot just use any $f(z)$ to integrate.
OK, if $f: \C \to \C$ is holomorphic, then you can find its primitive $F(z)$ up to a shift of constant.
OK, $f(z) = 1/z$ is not a holomorphic function on the entire $\C$. We can say, it is a holomorphic function on the 'punctured complex plane' $\C^* = \C \RM \{0\}$, or it is a meromorphic function on $\C$ with a pole of order $1$ at $z=0$. Either way, we can ask, can we find the primitive of $1/z$ on $\C^*$? Namely, is there a hol'c function $F(z)$ such that $F'(z) = 1/z$?
You probably know that, for $x>0$, if you integrate $1/x$, you get $\log (x) + C$. (why is that? )
The same holds for complex analytic function. almost. We can say the primitive of $1/z$ is $\log(z) + C$, but $\log(z)$ is a multivalued function on $\C^*$.
Let $f: \Omega \to \C$ be a meromorphic function. Let $\gamma$ be a closed contour in $\Omega$ (“contour” just means a smooth path) that avoids the pole of $f$. Then, $$ \int_\gamma f(z) dz = (2 \pi i) \sum_{z_0 \text{poles of } f} Res_{z_0} f. $$ The $Res_{z_0} f$ is the residue of $f$, which is the Laurent expansion of $f$ at $z$, the coefficient in front of $1/(z-z_0)$.
Example: $f(z) = 1/ [(z-1)(z-2)(z-3)]$, $\gamma$ is a contour around the two poles $1$ and $2$.