Quickly computing residues by hand I will soon be having a complex analysis examination in which I will need to manually compute residues of rational functions. For example, I might need to compute all residues of
$$f(z) = \frac{z^6 + 1}{z^3 (2 z - 1) (z - 2)}$$
Is there a fast procedure for computing such residues by hand? The only method I currently know of is the limit formula.
 A: Partial fraction decomposition is a possibility. In general, if $$
  f(z) = \frac{p(z)}{q(z)}, \,q(z) = (z - \alpha_1)^{r_1}\ldots(z-\alpha_k)^{r_k}, \deg p < \deg q
$$ 
then there are constants $A_{i,j}$, $1 \leq i \leq k$, $1 \leq j \leq r_i$, such that $$
  f(z) = \sum_{i=1}^k \sum_{j=1}^{r_i} \frac{A_{i,j}}{(z - \alpha_i)^j} \text{.}
$$
In particular, if all the zeros of $q$ are single zeros, i.e. if $r_1 = \ldots = r_k = 1$, then there are $A_1,\ldots,A_k$ such that $$
  f(z) = \frac{A_1}{z - \alpha_1} + \ldots + \frac{A_k}{z - \alpha_k} \text{.}
$$
If $\deg p \geq \deg q$, then one can use polynomial division to write $p$ as $p(z) = \hat p(z) q(z) + r(z)$, where $\deg \hat p = \deg p - \deg q$ and $\deg r < \deg q$, and then apply the above to the fractional part of $$
  f(z) = \frac{\hat p(z)q(z) + r(z)}{q(z)} = \hat p(z) + \frac{r(z)}{q(z)} \text{.}
$$
In our case $\deg p = 6$, $\deg q = 5$, $\deg \hat p = 6 - 5 = 1$. $q$ has one triple zero at $0$, and two single zeros at $z=\frac{1}{2}$ and $z=2$. We're thus looking for constants $a,b,A,B,C,D,E$ such that $$
    \frac{z^6 + 1}{z^3(2z -1)(z - 2)} = az + b + \frac{A}{z} + \frac{B}{z^2} + \frac{C}{z^3} + \frac{D}{z - \tfrac{1}{2}} + \frac{E}{z - 2} \text{.}
$$
If you multiply with the denominator of the left-hand side, the denominators on the right-hande side (which are, by definition, factors of the LHS denominator) cancel, and both sides become polynomials in $z$. You can then find the constants $a,b,A,\ldots,E$ by comparing the coefficients of the various power of $z$.
Since $\frac{1}{z^k}$ has residue $1$ if $k=1$ and residue $0$ otherwise, $A$ is the residue at the pole $z=0$, $D$ the residue at $z=\tfrac{1}{2}$ and $E$ the residue at $z=2$. Note that this means that we're only interested in three of the constants - it might pay off to keep that in mind when finding the constants, it might save you some unnecessary work.
A: For the simple poles, it's quite simple. For example, the residue at $z=2$ is
$$\lim_{z \to 2} \ (z-2)\cdot \mathrm{f}(z) = \lim_{z \to 2} \ \frac{z^6+1}{z^3(2z-1)} = \frac{21}{8}$$
For a pole of higher order, for example $z=0$ which is a triple pole, we find
$$\frac{1}{2!}\ \lim_{z\to0} \ \left(\frac{\mathrm{d}^2}{\mathrm{d}z^2}\left[(z-0)^3\cdot \mathrm{f}(z)\right]\right)$$
In general, if $\mathrm{g}$ has a pole of order $n$ at $z=w$, then the residue is given by
$$\frac{1}{(n-1)!}\ \lim_{z\to w} \ \left(\frac{\mathrm{d}^{n-1}}{\mathrm{d}z^{n-1}}\left[(z-w)^n\cdot \mathrm{g}(z)\right]\right)$$
A: First you have to understand what kind of singularity you're facing.
Removable singularities are easy, the residue is zero.
Then you meet polar singularities: if the pole is simple, take the limit. Otherwise it could be more complicated: if $f$ is holomorphic around the k-th order pole $z_0$ then the computing could be long and boring: you know that
$$
f(z)=\sum_{n=1}^{k}\frac{c_{-n}}{(z-z_0)^n}+\sum_{n=0}^{+\infty}c_n(z-z_0)^n\;\;,\;\; z\in B(z_0,r[\;\;.
$$
Then clearly
$$
c_{-k}=\lim_{z\longrightarrow z_0}(z-z_0)^kf(z)
$$
and recursevely you can find the other $k-1$, unfortunately from $c_{k-1}$ to $c_{-1}=Res(f,z_0)$. Knowing $c_{-k}$ you have
$$
f(z)=\frac{c_{-k}}{(z-z_0)^k}+\frac{c_{-k+1}}{(z-z_0)^{k-1}}+o_{z_0}\left(\frac1{(z-z_0)^{k-1}}\right)
$$
from which you have
$$
c_{-k+1}=\lim_{z\longrightarrow z_0}(z-z_0)^{k-1}\left(f(z)-\frac{c_{-k}}{(z-z_0)^k}\right)
$$
and so on...
