# Homework Help: Application of Residue Theorem to Definite Integrals (Logarithm)

1. Jul 23, 2013

### Tsunoyukami

I've been studying for a test and have been powering through the recommended problems and have stumbled upon a problem I just can't seem to figure out.

$$\int_{0}^{\infty} \frac{logx}{1+x^{2}} dx$$ (Complex Variables, 2nd edition by Stephen D. Fisher; Exercise 17, Section 2.6; pg. 167)

Write $f(z) = \frac{log(z)}{z^{2}+1}$ and consider the integral over the curve $\gamma$ which is composed of the following four parts; this guarantees that $f(z)$ is analytic (note that $\gamma$ does not pass through the origin).

1) $\gamma_{1}$, the half circle of radius R, connecting R to -R.
2) $\gamma_{2}$, the horizontal line connecting -R to -$\epsilon$
3) $\gamma_{3}$, the half circle of radius $\epsilon$, connecting -$\epsilon$ to $\epsilon$.
4) $\gamma_{4}$, the horizontal line connecting $\epsilon$ to R.

It is possible to compute the integral of $f(z)$ over $\gamma$ using the Residue Theorem, which states:

$$\int_{\gamma} f(z) dz = 2\pi i \sum_{z_{p} inside \gamma} Res(f;z_{p})$$

Furthermore, it is clear that:

$$\int_{\gamma} f(z) dz = \int_{\gamma_{1}} f(z) dz + \int_{\gamma_{2}} f(z) dz + \int_{\gamma_{3}} f(z) dz + \int_{\gamma_{4}} f(z) dz$$

(I will note that $\gamma_{4}$ 'is' the integral we are interested in finding.)

First I will attempt to calculate the value of $\int_{\gamma} f(z) dz$ using the Residue Theorem.

$$\int_{0}^{\infty} \frac{log(x)}{1+x^{2}} dx$$
$$\int_{\gamma} \frac{log(z)}{1+z^{2}} dz = \int_{\gamma} \frac{log(z)}{(z+i)(z-i)} dz$$

Notice that, provided $\epsilon$ is small enough and $R$ is large enough, $f(z)$ has only a single simple pole inside $\gamma$ (which is "roughly" the upper half-plane as $\epsilon$ approaches 0 and $R$ approaches $\infty$).

For a simple pole we can compute the residue in the following manner:

Suppose $g(z) = \frac{P(z)}{Q(z)}$ has a pole at $z_{p}$ (that is, $Q(z_{p}) = 0$). If $P(z_{p}) \neq 0$ and $Q'(z_{p}) \neq 0$:

$$Res(f;z_{p}) = Res(\frac{P(z)}{Q(z)};z_{p}) = \frac{P(z_{p})}{Q'(z_{p})}$$

For our $f(z)$ we have $P(z) = log(z)$ and $Q'(z) = 2z$, so we can write:

$$Res(\frac{log(z)}{z^{2}+1}; i) = \frac{log(i)}{2i} = \frac{ln|i| + iarg(i)}{2i} = \frac{0 + iarg(i)}{2i} = \frac{iarg(i)}{2i} = \frac{arg(i)}{2} = \frac{\frac{\pi}{2}}{2} = \frac{\pi}{4}$$

Therefore, by the Residue Theorem:

$$\int_{\gamma} f(z) dz = 2\pi i \frac{\pi}{4} = \frac{\pi^{2} i}{2}$$

At this point I would like to note that it is clear that the real-valued definite integral we are asked to compute cannot possibly result in a negative value; therefore at least one other $\gamma_{n}$ must be non-zero. So the next thing I must do is check each $\gamma_{n}$ and estimate their value.

I will need the following estimates:

1) For any polynomial, with |z| large,
$$\frac{1}{2}|a_{n}|R^{n} ≤ |p(z)| ≤ 2|a_{n}|R^{n}$$
2) For any function $f(z)$,
$$\left| \int_{\gamma} f(z) dz \right| = length(\gamma) \cdot max_{on \gamma}|f(z)|$$

Consider first $\gamma_{1}$, the half circle of radius $R$, connecting $R$ to -$R$. On $gamma_{1}$ note that $|z| = R$. I will show that the value of this integral goes to $0$ as $R$ goes to $\infty$.

$$\left| f(z) \right| = \left| \frac{log(z)}{z^{2}+1} \right| = \frac{\left|log(z)\right|}{\left|z^{2}+1 \right|} ≤ \frac{\left|ln|z| + iarg(z)\right|}{\frac{1}{2}R^{2}} ≤ \frac{2 (ln R + \left| iarg(R)\right|)}{R^{2}} ≤ \frac{2 (ln R + \pi)}{R^{2}} = \frac{2ln R + 2\pi)}{R^{2}}$$
$$length(\gamma) = \pi R$$
$$\left| \int_{\gamma} f(z) dz \right| = length(\gamma) \cdot max_{on \gamma}|f(z)| = \pi R \cdot \frac{2ln R + 2\pi)}{R^{2}} = \frac{2\pi(lnR + \pi)}{R} → 0$$

Consider next $\gamma_{3}$, the half circle of radius $\epsilon$, connecting -$\epsilon$ to $\epsilon$. Note $|z| = \epsilon$.

I am not too sure how to approach this section of the curve. We consider taking $\epsilon$ to 0 - this means that the numerator must have a larger degree of $\epsilon$ than the denominator but all my steps for the similar curve ($\gamma_{1}$ lead to the opposite. Can anyone help me with this?

Next we have two curves left to consider - $\gamma_{2}$ and $\gamma_{4}$. Because the integral we are attempting to find is essentially $\gamma_{4}$ I expect $\gamma_{2}$ to give the value of $\int_{\gamma} f(z) dz$ I found above using the Residue Theorem, but I'm not sure how to do this exactly...

If anyone would be able to assist me in solving this problem it would be greatly appreciated! Thanks in advance!

2. Jul 24, 2013

### vanhees71

Note that the logarithm on the here to be considered branch is real along the positive real axis and has a branch cut along the negative real axis. So you have to shift the real part of the contour a bit into, e.g., the upper plane. Then you can use
$$\forall x>0: \quad \ln(-x+\mathrm{i}0^+)=\ln x+\mathrm{i} \pi.$$
With that argue about the real and the imaginary part of the paths along the real axis (infinitesimally shifted into the upper half plane).

Note that with this trick you also don't need the little semi-circle anymore. You simply deform the originally given contour (which by the way is not well defined for the given function due to branch cut along the negative real axis) to an infinitesimally upward shifted path parallel to the real axis and then close with a large semi circle in the upper half plane at infinity. You've already seen that this large semicircle doesn't contribute anyway.

3. Jul 24, 2013

### Tsunoyukami

I should have mentioned that I have taken the branch cut along the negative imaginary axis because this is the manner in which the textbook approached the only example.

To be sure, the contour you suggest would be composed of two pieces - the half-circle and the horizontal line parallel to the real axis shifted infinitesimally into the upper half plane.

Using the contour you suggest I would need to estimate the value from $-\infty$ to $\infty$. I'm not sure how I would do this...on the negative half I could use the expression for log(z) that you suggested - but I'm not sure where this will take me. The length of the negative half will be R and so I expect I will get an estimate of the form $\frac{1}{R}$ which will approach 0. This would mean that my integral from 0 to $\infty$ of my original function would have a complex result...which cannot be correct.

4. Jul 24, 2013

### Mandelbroth

Note that $\gamma_3$ will be along the path $z(\theta)=\varepsilon e^{i\theta}$ for $\theta\in[\pi, 2\pi]$. Substituting for $z$ in the integral, we get $\displaystyle \int\limits_{[\pi, 2\pi]}\frac{\ln(\varepsilon e^{i\theta})}{1+\varepsilon^2 e^{2i\theta}}i\varepsilon e^{i\theta}\, d\theta$. What can you do from there that makes things easy?

Hint: What is $\displaystyle \lim_{x\to 0}\left[x\ln{x}\right]$?

5. Jul 24, 2013

### vanhees71

Ok, then you can use the original contour. Then we have first to think about, how the logarithm is defined on the specific Riemann sheet. Of course, along the positive real axis the log should still be real. Thus in this case you have
$$\ln z=\ln|z|+\mathrm{i} \varphi,$$
where the argument, $\varphi$ of $z$ (i.e., $z=|z| \exp(\mathrm{i} \varphi)$) has to be choosen in the interval $\varphi \in (-\pi/2,3 \pi/2)$ and $\ln|z| \in \mathbb{R}$ for $z \neq 0$.

Now, as you have done you have to evaluate the integral along the total path, using the theorem of residues. To make the relation with the original real integral, you have to evaluate the pieces originally not included in this integral. Of course, the large and the small semicircle give a 0 contribution in the limits $R \rightarrow \infty$ and $\epsilon \rightarrow 0$ to the contour integral. This you'll manage to prove with help of the hints in this thread. Note that, with your choice of the cut, of course, you have to circumvent the branchpoint, $z=0$ in the upper half-plane, i.e.,
$$-\gamma_3: z=\epsilon \exp(\mathrm{i} \theta), \quad \theta \in (0,\pi).$$

The only thing you have to think about are the values of the log along the negative real axis, but that's easy now, given the above clear definition of the specific branch of the logarithm with the cut along the negative imaginary axis.

General note: I'm a bit surprised that the textbooks you use nowadays in learning function theory use so unusual branch cuts for the elementary functions. Of course, you can put the branch cut, wherever the analytic structure of the given function admits you to do, but I find this pretty confusing. The good side is that, from such examples, you learn how important it is to specify the branch and cuts for the domain of multivalued functions under consideration for a given problem!

6. Jul 24, 2013

### Tsunoyukami

Thanks, Mandelbroth. $\lim_{x\to 0} xlnx = 0$ and so I would expect the integral over $gamma_{3}$ to be 0. However, I'm a little bit confused as to why I do not use the following estimation on the polynomial in the denominator. (Note that I want the denominator to be small if I was to estimate the maximum value of a function).

$\frac{1}{2} |a_{n}|R^{n} ≤ |p(z)| ≤ 2|a_{n}|R^{n}$

EDIT: Nevermind, I see it - this estimate is only for large R.

So all that is left is to find $\int_{\gamma_{2}} f(z) dz$.

$$\int_{\gamma_{2}} f(z) dz = \int_{-R}^{-\epsilon} \frac{log(z)}{z^{2}+1} dz = \int_{-R}^{-\epsilon} \frac{ln|z| + iarg(z)}{z^{2}+1} dz = \int_{-R}^{-\epsilon} \frac{ln|z| + i\pi}{z^{2}+1} dz = \int_{-R}^{-\epsilon} \frac{ln|x| + i\pi}{x^{2}+1} dx$$

But we note that along $\gamma_{2}$ z = x for all x < 0. I'm a little bit confused here...maybe wary is a better word. I'm concerned about the real part here, with log|x| for x < 0. I feel like there's something more I need to do to handle this term.

I'll continue just by looking at the imaginary part for now.

$$i \int_{-R}^{-\epsilon} \frac{\pi}{x^{2}+1} dx = \frac{i\pi^{2}}{2}$$

I would expect I end up with something like the following:

$$\int_{\gamma} f(z) dz = \int_{\gamma_{1}} f(z) dz + \int_{\gamma_{2}} f(z) dz + \int_{\gamma_{3}} f(z) dz + \int_{\gamma_{4}} f(z) dz = 0 + \left( \int_{-R}^{-\epsilon} \frac{ln|x|}{x^{2}+1} dx + \frac{i\pi^{2}}{2} \right) + 0 + \int_{\epsilon}^{R} \frac{ln|x|}{x^{2}+1} dx = \frac{i\pi^{2}}{2}$$

$$\int_{\gamma} f(z) dz = \int_{-R}^{-\epsilon} \frac{ln|x|}{x^{2}+1} dx + \int_{\epsilon}^{R} \frac{ln|x|}{x^{2}+1} dx = 0$$

Now I know the answer is 0 so I am expecting the first integral (over the negative real axis) to go to 0, which suggests that the second also goes to 0. However, the best way I can think to do that is by rewriting the first in the form of the second so that I can express my answer as twice the original integral is equal to zero which suggests that the original integral is, indeed, equal to zero...but how can I go about doing this (provided, of course, that I've done everything right so far)?

7. Jul 24, 2013

### Mandelbroth

You have that $\displaystyle \int\limits_{[-R,-\varepsilon]} \frac{ln|x|}{x^2+1}\, dx + \int\limits_{[\varepsilon,R]} \frac{ln|x|}{x^2+1}\, dx = 0$, right? Let's do a simple change of variables on the first integral. Consider the substitution $x\mapsto -x \implies dx\mapsto -dx$.

Under that substitution, we get $\displaystyle 2\int\limits_{[\varepsilon,R]} \frac{ln|x|}{x^2+1}\, dx = 0$.

8. Jul 24, 2013

### Tsunoyukami

Ahh, I tried that but forgot to change $dx$ to $-dx$.

Thanks a lot!

9. Jul 24, 2013

### Mandelbroth

You are most certainly welcome. Believe it or not, this is fun for me.

10. Jul 24, 2013

### Tsunoyukami

I believe you. These questions (while somewhat tedious) are "fun" in an unconventional manner. This course in complex numbers I'm taking is reigniting my former love of math problems and inspiring me to return to previous courses to master material I neglected to previously.

In particular, the Residue Theorem is pretty amazing.