value of an integral depending on a parameter in complex plane For each $z\in\mathbb{C}$, evaluate the integral
$$
\int_0^1\int_0^{2\pi}\frac{1}{re^{i\theta}+z}d\theta dr.
$$
How to evaluate it? Thanks.
 A: The integral over $\theta$ may be easily evaluated using the residue theorem.  Let $\zeta=e^{i \theta}$; then
$$\int_0^{2 \pi} \frac{d\theta}{r \, e^{i \theta}+z} = -i \oint_{|\zeta|=1} \frac{d\zeta}{\zeta(r \zeta+z)} = \frac{2 \pi}{z} - \frac{2 \pi}{z} r \,\Theta(r-|z|)$$
where $\Theta$ is the Heaviside step function.  The integral over $r$ is relatively simple and we get that
$$\int_0^1 dr \, \int_0^{2 \pi} \frac{d\theta}{r \, e^{i \theta}+z} = \frac{\pi}{z} \left ( 1+|z|^2 \right )$$
A: The original integral does not exist if $|z|\leq 1$, for $z=0$ it is obvious, and if $z=r_0\exp(i\phi)$ with $0<r_0\leq 1$, because $r_0\exp(i\theta)+z$ is zero for $\theta=\phi+\pi \pmod{2\pi}$. For $|z|>1$, we have $\displaystyle \int_0^{2\pi}\frac{d\theta}{r\exp(i\theta)+z}=\frac{2\pi}{z}$ you can prove this writing $$ \frac{1}{r\exp(i\theta)+z}=\sum_{k\geq 0}(-1)^k\frac{r^k}{z^{k+1}}\exp(ik\theta)$$
and  as this series is normally convergent, integrating term by term, or using the residue theorem.
Then it is immediate that the original integral is $\displaystyle \frac{2\pi}{z}$.
A: $\newcommand{\+}{^{\dagger}}
 \newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\down}{\downarrow}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\isdiv}{\,\left.\right\vert\,}
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}
 \newcommand{\ol}[1]{\overline{#1}}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}
 \newcommand{\wt}[1]{\widetilde{#1}}$
The $\ds{\theta}$-integration is given by:


*
*$\ds{\color{#f00}{\large\tt \verts{z} < r}}$
$$
\int_{0}^{2\pi}{\dd\theta \over r\expo{\ic\theta} + z}
=
{1 \over r}\int_{0}^{2\pi}
{\expo{-\ic\theta}\,\dd\theta \over 1 + z\expo{-\ic\theta}/r}
=
{1 \over r}\sum_{n = 0}^{\infty}\pars{-1}^{n}\pars{z \over r}^{n}\
\overbrace{\int_{0}^{2\pi}\expo{-\ic\pars{n + 1}\theta}\,\dd\theta}^{\ds{=\ 2\pi\,\delta_{n + 1,0}}} = \color{#f00}{\Large\tt 0}
$$


*$\ds{\color{#f00}{\large\tt \verts{z} > r}}$
$$
\int_{0}^{2\pi}{\dd\theta \over r\expo{\ic\theta} + z}
=
{1 \over z}\int_{0}^{2\pi}
{\dd\theta \over 1 + r\expo{\ic\theta}/z}
=
{1 \over z}\sum_{n = 0}^{\infty}\pars{-1}^{n}\pars{r \over z}^{n}\
\overbrace{\int_{0}^{2\pi}\expo{\ic n\theta}\,\dd\theta}^{\ds{=\ 2\pi\,\delta_{n0}}} = \color{#f00}{\Large\tt{2\pi \over z}}
$$




\begin{align}
&\color{#66f}{\large\int_{0}^{1}\int_{0}^{2\pi}{\dd\theta \over r\expo{\ic\theta} + z}\,\dd r}
=\left.\int_{0}^{1}{2\pi \over z}\,\dd r\,\right\vert_{\,\verts{z}\ >\ r}
=\color{#66f}{\large\left\lbrace\begin{array}{lcl}
2\pi\,{\verts{z} \over z} & \mbox{if} & \verts{z} < 1
\\[3mm]
2\pi\,{1 \over z} & \mbox{if} & \verts{z} > 1
\end{array}\right.}
\end{align}

