How to perform double contour integrals? Let's say I have an integral of the form
$$\oint\oint \frac{dz_1}{2\pi i} \frac{dz_2}{2\pi i} \frac{1}{(z_1 + n_1)(z_2 + n_2)(z_1 + z_2 + n)}$$
where $n_1,n_2,n\in\mathbb{Z}$ and both the contours are of the form which go from $c-i\infty$ to $c+i\infty$ in both cases for $c\in(0,1)$ and the contour is closed to the left at infinity.
How would one evaluate the integral? What bothers me is that when $n=n_1+n_2$, we end up getting a double pole, while in other cases there seems to be a single pole. How do we take care of this?
 A: I suppose (perhaps a tiny bit more generally) that the contours go from $c_{1,2}-i\infty$ to $c_{1,2}+i\infty$, for $z_{1,2}$ respectively, where $c_1,c_2\in(0,1)$. The term "closed to the left at infinity" is not a property of such a contour, but rather a limiting process, when the path from $c-i\infty$ to $c+i\infty$ is replaced by the segment $[c-iR,c+iR]$ and, say, the halfcircle $|z-c|=R$ lying in $\Re z\leqslant c$, and the limit $R\to{\raise 1pt\tiny{(+)}}\infty$ is taken. [I'm using this term myself below.]
Assuming that $z_1+z_2+n$ doesn't vanish (that is, $c_1+c_2+n\neq 0$), the given double integral is absolutely convergent. Thus, Fubini's theorem guarantees that the order of integration does not matter. This is also confirmed by the result below (which is symmetric w.r.t. simultaneous $n_1\leftrightarrow n_2$ and $c_1\leftrightarrow c_2$).
The obvious substitutions show that our integral is $I(n_1+c_1,n_2+c_2,n+c_1+c_2)$, where $$I(a,b,c)=\int_{-i\infty}^{i\infty}\int_{-i\infty}^{i\infty}\frac{1}{(z_1+a)(z_2+b)(z_1+z_2+c)}\frac{dz_1}{2\pi i}\frac{dz_2}{2\pi i}.\qquad(a,b,c\in\mathbb{R}_{\neq 0})$$ The computation of $I(a,b,c)$ is merely a bunch of case distinctions.
To ease it, we use the 1D analogue: for $z_1,z_2\in\mathbb{C}\setminus i\mathbb{R}$, we have $$\int_{-i\infty}^{i\infty}\frac{1}{(z+z_1)(z+z_2)}\frac{dz}{2\pi i}=\begin{cases}1/(z_2-z_1),&\Re z_1>0\wedge\Re z_2<0\\1/(z_1-z_2),&\Re z_1<0\wedge\Re z_2>0\\\hfill 0,\hfill&\text{otherwise}\end{cases}$$ (the proof is easy: if $\Re z_1<0$ and $\Re z_2<0$, we "close to the left" as above, getting the poles out of the contour, so the integral is $0$; note that this works for $z_1=z_2$ too, so that the double pole is not an issue; likewise, if $\Re z_1>0$ and $\Re z_2>0$, we "close to the right", and the integral is $0$ again; in the remaining cases, we go either way, computing the residue at a single simple pole).
Now we just proceed with iterated integration, in any order. The final result is $$I(a,b,c)=\begin{cases}1/(c-a-b)&\text{if }a,b,-c\text{ are of the same sign}\\\hfill 0\hfill&\text{otherwise}\end{cases}$$
