# Explicit contour integration gone wrong.

Consider the function $f(z):\mathbb{C}\to\mathbb{C}$:

$$f(z)=\frac{4z}{1+z^2}$$

There are a few properties evident:

• The anti-derivative (with integration constant $c=0$) is given by: $$F(z)=\log\left((1+z^2)^2\right)$$

• Function $f(z)$ has poles at $z_{\pm}=\pm i$ with residue $\text{Res}\{f(z),z_\pm\}=2$.

Now, imagine we would like to obtain the residue of the pole in the upper half-plane by explicit contour integration. For that end we can use the antiderivative. However, we have to be careful with the branch cut structure of $F(z)$. We observe:

So we see branch cuts in $F(z)$ starting at the poles of $f(z)$ and running off to infinity. Instead of trying to figure out the directions of the branch cuts, we can make a variable substitution to reveal the branch cut structure more clearly. Namely we take $z\to\frac{1}{z}$. With this we have:

$$F\left(\frac{1}{z}\right)=\log\left(\left(1+\frac{1}{z^2}\right)^2\right)$$

Now, plotting this we see:

Here the branch cut structure is obvious, so that we can straightforwardly draw a closed contour about the upper half plane that does not cross any branch cut:

Starting from the middle, we therefore get the following contributions to the contour integration:

$$2\pi i \text{Res}\{f(z),z_+\}=\lim_{\epsilon^+\to0}\left(\left[ F\left(\frac{1}{x}\right)\right]_{x=\epsilon^+}^{x=\infty}+\left[ \lim_{x\to\infty} F\left(\frac{1}{x \exp(i \phi)}\right)\right]_{\phi=0}^{\phi=\pi}+\left[ F\left(\frac{1}{x}\right)\right]_{x=-\infty}^{x=-\epsilon^+}\right)$$

Unfortunately, when I sum up the three contributions above I get zero instead of the correct residue contribution. Therefore, something must have gone terribly wrong above. Please, let me know what I did wrong.

• $$\lim_{z\to -i}(z+i)\frac{4z}{z^2+1}=\frac{-4i}{-2i}=2\\\lim_{z\to i}(z-i)\frac{4z}{z^2+1}=\frac{4i}{2i}=2$$I think the residue's the same in both poles. – DonAntonio Dec 22 '13 at 19:40
• oh, yes! thank you, you are absolutely right. Let me correct that. – Kagaratsch Dec 22 '13 at 19:41
• Also: what exactly are you trying to calculate/achieve? – DonAntonio Dec 22 '13 at 19:42
• I am trying to learn explicit contour integration, first applying it to an example where I know the result (to test if I get it right). – Kagaratsch Dec 22 '13 at 19:43
• Usually, it's used the other way round, you take the residues and compute a contour integral by summing them. – Daniel Fischer Dec 22 '13 at 20:13

In trying to escape the branch cuts, you're running into another singularity at $1/z = 0$. Instead, you should use the branch cuts. Using the principal branch $\text{Log}$ of the logarithm, $F(z) = \text{Log}((1+z^2)^2)$ has branch cuts where $(1+z^2)^2$ is on the negative real axis, i.e. $1 + z^2$ is on the imaginary axis. For example, $1+z^2 = i$ when $z = \pm 2^{1/4} \exp(3 i \pi/8)$, and $-i$ when $z = \pm 2^{1/4} \exp(-3 i \pi/8)$. Across each of these $F(z)$ jumps by $2 \pi i$. Here's a plot of the real and imaginary parts of $F(2^{1/4} \exp(it))$ (blue and red respectively) for $t$ from $0$ to $\pi$:
You see the jumps at $t = 3\pi/8$ and $5\pi/8$. On the real axis, there are no jumps. So we conclude that for the closed contour $\Gamma$ consisting of the semicircle $|z| = 2^{1/4}$ in the upper half plane and the real segment $[-2^{1/4},2^{1/4}]$, $\oint_\Gamma f(z)\ dz = 4 \pi i$.