# Complex integral using cauchy residue formula

I want to compute $\displaystyle \int_{0}^{+\infty} \frac{dx}{x^n-1}$
I've proved that $\displaystyle \int_{0}^{+\infty} \frac{dx}{x^n+1} = \frac{\pi}{n\sin\left(\frac{\pi}{n}\right)}$ in a previous question by using some contour integration (in 3 parts like here : image ) and using cauchy residue formula.
Given that $\displaystyle \frac{1}{x^{n}-1}-\frac{1}{x^{n}+1} = 2 \frac{1}{x^{2n}-1}$ so we just have to compute $\displaystyle \int_{-\infty}^{\infty} \frac{dx}{x^{2n}-1}$ , the other integral being $\displaystyle \frac{\pi}{n\sin\left(\frac{\pi}{n}\right)}$.
The singularities in this integral are $z_k=e^{i k \pi / n}$ for $k=0,\dots,2n-1$
If we use cauchy residue formula we would find, if I note $S=\{ z_k \big| \Im(z_k) \geq 0 \}$ $$\displaystyle \int_{-\infty}^{\infty} \frac{dx}{x^{2n}-1} = 2i\pi \sum_{z_k \in S} Res(z_k) = \frac{i\pi}{n} \sum_{z_k \in S} z_k$$
For instance for $n=2$ the solution with positive imaginary part of $z^4=1$ gives $S=\{1,-1,i\}$ and then using this formula $\displaystyle \int_{-\infty}^{\infty} \frac{dx} {x^4-1} = -\frac{\pi}{2}$ , which seems to be correct using some calculator.

So, can it be simplified ? I don't like the fact that I need to use S. Thanks in advance.

• Isn't the sum over $z_k$ a geometric series ? – Mirajane Dec 1 '14 at 22:06
• Yes, but S is only part of it ... (positive imaginary part), so it's not that easy, isn't it ? :-) – Dyoann Dec 1 '14 at 22:07
• Note that the integrand has a pole at $x = 1$. So is this the principal value? – Hans Engler Dec 1 '14 at 22:11
• Yes, forgot to mention, this is the cauchy principal value. – Dyoann Dec 1 '14 at 22:14
• I don't know much about contour integration but for the sum : $\sum_{z_k \in S} z_k=\sum_{k=0}^n e^{ik\pi/n}=(1-e^{i(n+1)\pi/n})/(1-e^{i\pi/n})$ - or did i miss something ? – Mirajane Dec 1 '14 at 22:17

## 2 Answers

We can in fact evaluate the Cauchy principal value of the integral as follows.

Consider the following contour integral:

$$\oint_C dz \frac{\log{z}}{z^n-1}$$

$C$ is a modified keyhole contour about the positive real axis of outer radius $R$ and inner radius $\epsilon$. The modification lies on small semicircular bumps above and below $z=1$ of radius $\epsilon$, and we will consider the limits as $\epsilon \to 0$ and $R\to\infty$.

Let's evaluate this integral over the contours. There are $8$ pieces to evaluate, as follows:

$$\int_{\epsilon}^{1-\epsilon} dx \frac{\log{x}}{x^n-1} + i \epsilon \int_{\pi}^0 d\phi \, e^{i \phi} \frac{\log{\left (1+\epsilon e^{i \phi}\right )}}{(1+\epsilon e^{i \phi})^n-1} \\ + \int_{1+\epsilon}^R dx \frac{\log{x}}{x^n-1} + i R \int_0^{2 \pi} d\theta \, e^{i \theta} \frac{\log{\left (R e^{i \theta}\right )}}{R^n e^{i n \theta}-1} \\ + \int_R^{1+\epsilon} dx \frac{\log{x}+i 2 \pi}{x^n-1} + i \epsilon \int_{2 \pi}^{\pi} d\phi \, e^{i \phi} \frac{\log{\left (1+\epsilon e^{i \phi}\right ) }+i 2 \pi}{(1+\epsilon e^{i \phi})^n-1} \\ + \int_{1-\epsilon}^{\epsilon} dx \frac{\log{x}+i 2 \pi}{x^n-1} + i \epsilon \int_{2 \pi}^0 d\phi \, e^{i \phi} \frac{\log{\left (\epsilon e^{i \phi}\right )}}{\epsilon^n e^{i n \phi}-1}$$

(To see this, draw the contour out, including the bumps about $z=1$.)

As $R \to \infty$, the fourth integral vanishes as $\log{R}/R^{n-1}$. As $\epsilon \to 0$, the second integral vanishes as it is $O(\epsilon)$, while the eighth integral vanishes as $\epsilon \log{\epsilon}$. This leaves the first, third, fifth, sixth and seventh integrals, which in the above limits, become

$$PV \int_0^{\infty} dx \frac{\log{x} - (\log{x}+i 2 \pi)}{x^n-1} + \frac{2 \pi^2}{n}$$

It should be appreciated that, in the fifth, sixth, and seventh integrals, the $i 2 \pi$ factor appears because, on the lower branch of the real axis, we write $z=x \, e^{i 2 \pi}$. In the sixth integral, in fact, $z = e^{i 2 \pi} + \epsilon \, e^{i \phi + 2 \pi}$.

The $PV$ denotes the Cauchy principal value of the integral. As it stands, the integral does not actually converge. Nevertheless, we are not actually considering the integral straight through the pole at $z=1$, but a very small detour around the pole. Thus, in the limit, we get the Cauchy PV. A little rearranging cancels the $\log$ term, and we now have:

$$-i 2 \pi PV \int_0^{\infty} \frac{dx}{x^n-1} + \frac{2 \pi^2}{n}$$

The contour integral is also equal to $i 2 \pi$ times the sum of the residues at the poles. The poles here are at $z=e^{i 2 \pi k/n}$, $k=1,\cdots,n-1$. Note that the pole at $z=1$ is not inside the contour $C$ because of the detour around that "pole". It should be appreciated that the poles must have their arguments between $[0,2 \pi]$ because of the way we defined $C$.

In any case, we now have that the above 1D integrals over the positive real line are equal to

$$i 2 \pi \sum_{k=1}^{n-1} \frac{i 2 \pi k/n}{n e^{i 2 \pi k (n-1)/n}} = \frac{2 \pi ^2}{n}+i \frac{2\pi ^2}{n} \cot{\frac{\pi}{n}}$$

(The evaluation of the sum is a bit messy but very doable by hand, which I did. I will skip the details in the name of brevity but will supply them upon request.)

We may now solve for the principal value and get:

$$PV \int_0^{\infty} \frac{dx}{x^n-1} = -\frac{\pi}{n}\cot{\frac{\pi}{n}}$$
