# Prove that $\int_0^\infty \frac{\ln x}{x^n-1}\,dx = \Bigl(\frac{\pi}{n\sin(\frac{\pi}{n})}\Bigr)^2$

This question inspired me to ask the following.

Prove that

$$I_n = \int_0^\infty \frac{\ln x}{x^n-1}\,dx = \left(\frac{\pi}{n\sin\left(\frac{\pi}{n}\right)}\right)^2,$$

for $\Re(n)>1$.

For some cases there is a nice specific form of $I_n$. For example

\begin{align} I_2 & = \frac{\pi^2}{4} \\ I_3 & = \frac{4\pi^2}{27} \\ I_4 & = \frac{\pi^2}{8} \\ I_5 & = \frac{2\left(5+\sqrt 5\right)\pi^2}{125} \\ I_6 & = \frac{\pi^2}{9} \\ I_7 & = \frac{2\pi^2}{49\left(1-\sin\left(\frac{3\pi}{14}\right)\right)} \\ I_8 & = \frac{\left(2+\sqrt 2\right)\pi^2}{32} \end{align}

• $\displaystyle\int_0^\infty\dfrac{x^{^{k-1}}}{1-x^{^n}}dx~=~\dfrac\pi n\cot\bigg(k~\dfrac\pi n\bigg)$ – Lucian Oct 24 '14 at 20:19
• Just to put @Lucian's comment clear, for non-experts like me, we define $f(k) = \int_0^\infty \dfrac{x^{k-1}}{1-x^n}dx$, then $f'(k) = \int_0^\infty \dfrac{ \log x x^{k-1}}{1-x^n}dx$, so the integral in question is $-f'(1)$ – Petite Etincelle Oct 24 '14 at 20:49

\begin{align} \int_0^\infty\frac{\log(x)}{x^n-1}\mathrm{d}x &=\int_{-\infty}^\infty\frac{x}{e^{nx}-1}e^x\,\mathrm{d}x\\ &=\int_0^\infty\frac{x}{e^{nx}-1}e^x\,\mathrm{d}x+\int_0^\infty\frac{x}{1-e^{-nx}}e^{-x}\,\mathrm{d}x\\ &=\int_0^\infty x(e^{(1-n)x}+e^{(1-2n)x}+e^{(1-3n)x}+\dots)\,\mathrm{d}x\\ &+\int_0^\infty x(e^{-x}+e^{(-1-n)x}+e^{(-1-2n)x}+\dots)\,\mathrm{d}x\\ &=\frac1{(n-1)^2}+\frac1{(2n-1)^2}+\frac1{(3n-1)^2}+\dots\\ &+1+\frac1{(n+1)^2}+\frac1{(2n+1)^2}+\frac1{(3n+1)^2}+\dots\\ &=\frac1{n^2}\sum_{k\in\mathbb{Z}}\frac1{\left(k+\frac1n\right)^2}\\ &=\frac{\pi^2}{n^2}\csc^2\left(\frac\pi{n}\right) \end{align} where the last step uses the derivative of $(7)$ from this answer

We can use a contour integral in the complex plane, as I showed here for the case $n=3$. Now, however, we use

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

where $C$ is the modified keyhole contour about the positive real axis of outer radius $R$ and inner radius $\epsilon$.

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

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

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

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

The residue computation is a little more involved, because we now have $n-1$ poles at which we need to evaluate residues. The contour integral is thus

$$i 2 \pi \sum_{k=1}^{n-1} \frac{-4 \pi^2 k^2/n^2}{n e^{i 2 (n-1) \pi k/n}} = -i \frac{8 \pi^3}{n^3} \sum_{k=1}^{n-1} k^2 \, e^{-i 2 (n-1) \pi k/n}$$

The sum is doable, but the algebra is a bit hideous. The result is

$$\sum_{k=1}^{n-1} k^2 \, e^{-i 2 (n-1) \pi k/n} = \frac12 \left ( \frac{n}{\sin^2{\frac{\pi}{n}}} - n^2\right ) - i \frac12 n^2 \cot{\frac{\pi}{n}}$$

Equating real and imaginary parts of both equations for the contour integral yields

$$\int_0^{\infty} dx \frac{\log{x}}{x^n-1} = \frac{\pi^2}{n^2 \sin^2{\frac{\pi}{n}}}$$

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


\begin{align}\color{#66f}{\large \int_{0}^{\infty}{\ln\pars{x} \over x^{n} - 1}\,\dd x} &={1 \over n^{2}}\bracks{\Psi'\pars{1 \over n} + \Psi'\pars{-\,{1 \over n} + 1}} \end{align}

With the Euler Reflection Formula $\color{#000}{\bf 6.4.7}$ $$\Psi'\pars{1 - z} + \Psi'\pars{z} = - \pi\,\totald{\cot\pars{\pi z}}{z} =\pi^{2}\csc^{2}\pars{\pi z}$$

we'll find $$\color{#66f}{\large \int_{0}^{\infty}{\ln\pars{x} \over x^{n} - 1}\,\dd x ={\pi^{2} \over n^{2}}\,\csc^{2}\pars{\pi \over n}}$$