Logarithmic Integral II While reviewing an old calculus book the following integral was assigned:
\begin{align}
\int_{0}^{1} \left( x^{a-1} - x^{n-a-1} \right) \, \frac{\ln^{2}x \, dx}{1-x^{n}} = \frac{2 \, \pi^{3} \, \cos\left(\frac{a \pi}{n}\right)}{n^{3} \, \sin^{3}\left(\frac{a \pi}{n}\right)}
\end{align}
for $a \neq n$. The proposed questions here are:


*

*What are some methods to prove the given integral?

*What are the changes if the power of the logarithm is lowered to one or raised to 3?



The old calculus book is: Ralph A Roberts, "A treatise on the integral calculus; part 1", 1887. The propoblem presented here is found on page 354 as example 36. The book can be found in the Google Books collection.
 A: That is not terribly difficult. One just has to prove that:
$$\int_{0}^{1}\frac{x^{a}-x^{n+a}}{1-x^n}\cdot\frac{dx}{x}=\frac{1}{a},\qquad \int_{0}^{1}\frac{x^{a}-x^{n-a}}{1-x^n}\cdot\frac{dx}{x} = \frac{\pi}{n}\,\cot\left(\frac{\pi a}{n}\right)\tag{1}$$
that follows, for instance, from the reflection formula for the digamma function or from the residue theorem, then differentiate the above line with respect to $a$ the right number of times. Another chance is given by exploiting:
$$ \int_{0}^{1}x^{\alpha-1} \log(x)^k\,dx = \frac{(-1)^k k!}{\alpha^{k+1}}\tag{2}$$
together with:
$$ \psi'(z)=\sum_{n\geq 0}\frac{1}{(z+n)^2},\quad \sum_{n\geq 0}\frac{1}{(n+z)^k} = \frac{(-1)^k}{k!}\, \psi^{(k-1)}(z)\tag{3}$$
from which:
$$\int_{0}^{1}\frac{x^{a/n}}{1-x}\cdot\frac{\log(x)^k}{x}\,dx = (-1)^k k!\sum_{m\geq 0}\frac{1}{\left(m+\frac{a}{n}\right)^{k+1}}=\psi^{(k)}\left(\frac{a}{n}\right).\tag{4}$$
A: Bit long for a comment, but thought I might add my (incomplete) bit... I will finish it off / delete it when I have a bit more time.
Using the change of variable $x=e^y$ gives
$$I=-\int_0^\infty z^2\text{csch}\left(\frac{nz}{2}\right)\sinh\left(az-\frac{nz}{2}\right)dz=-\int_0^\infty z^2\frac{\sinh\left(az-\frac{nz}{2}\right)}{\sinh\left(\frac{nz}{2}\right)}dz.$$
Since the integrand is an even function we have
$$I=-\frac{1}{2}\int_{-\infty}^\infty z^2\frac{\sinh\left(az-\frac{nz}{2}\right)}{\sinh\left(\frac{nz}{2}\right)}dz..$$
For $n>a$ I think the semi-circular integral for $z=Re^{i\theta}$ where $0\leq\theta<\pi$ tends to zero as $R\to\infty$, in which case we may sum the residues in the complex plane above the real axis. Not sure if this converges yet but will take a look soon unless someone else does !
A: This one is trivial. All you have to do is notice that $x^a-x^b=(1-x^b)-(1-x^a)$, and then recognize the expression in question as a linear combination of second-order derivatives of generalized harmonic numbers. Since the latter are umbilically connected to digamma functions, use the reflection formula to arrive at the desired result.
