TITLE: When Cauchy integral and when Cauchy residue..?
QUESTION [5 upvotes]: $\int_C\tan(z)dz$ where $C$ is the circle $\vert z\vert=2$
What should be applied to evaluate the following solution?
Is it Cauchy integral or residue?

REPLY [7 votes]: Typically, the residue theorem is used for evaluating a contour integral, while Cauchy's integral formula is used for evaluating a function.  Notice the difference between Cauchy's formula:
$$
f(z_0)=\frac{1}{2\pi i}\oint_C \frac{f(z)}{z-z_0}dz
$$  which holds for functions which are holomorphic throughout a region which contains the circle $C$, and the residue theorem:
$$
\oint_C f(z)dz=2\pi i\sum\text{Res}[f,z_j],
$$ which holds for functions which are holomorphic inside a region containing $C$ except possibly at the points $z_j$.
The connection is, of course, that if $f(z)$ has a simple pole at $z=z_0$, then $g(z)=(z-z_0)f(z)$ is holomorphic, and the residue is $g(z_0)$.  Then the residue theorem is exactly Cauchy's integral formula, after dividing over the $2\pi i$.  If the pole is of higher-order, then the "generalized Cauchy integral formula" is the same as the residue theorem, but the residues are calculated using the general residue formula.