TITLE: Evaluating $\int_0^{\infty} \frac{\ln (x)}{1-x^n}\text{d}x$
QUESTION [7 upvotes]: This is just for recreational purposes.
I've been wondering how to evaluate the following integral:
$$\int_0^{\infty} \frac{\ln (x)}{1-x^n}\text{d}x$$
Because I noticed that certain values for $n$ lead to some nice rational multiples of $\pi^2$ when evaluated in WolframAlpha. This leads me to believe we should somehow get it into series form to turn it into something Basel-esque.  However, I've been struggling with this. I managed to put into series form a related integral, to at least show some kind of context/effort, which is:
$$\int_0^{1} \frac{\ln (x)}{1-x^n}\text{d}x$$
When inputting the series expansion of $1-x^n$, one simply needs to evaluate an integral of the form $x^{kn} \ln(x)$, which is simple, and the following series emerges:
$$\int_0^{1} \frac{\ln (x)}{1-x^n}\text{d}x = \sum_{k=0}^{\infty} \frac{1}{(kn+1)^2}$$
However, this approach doesn't work with bounds from $0$ to $\infty$ for obvious reasons. Could someone give me some help?

REPLY [2 votes]: @user429040 Already has an excellent answer. I'd like to expand a little bit on the sum formula that he has presented:
$$\sum_{k\in\Bbb{Z}}\frac{1}{(k+z)^2}=\pi^2\csc^2(\pi z)$$
How do we prove this formula? Well, first we expand it using partial fractions into two different sums:
$$\sum_{k\in\Bbb{Z}}\frac{1}{(k+z)^2}=\sum_{k=0}^\infty\frac{1}{(k+z)^2}+\sum_{k=0}^\infty\frac{1}{\big(k+(1-z)\big)^2}$$
Now we consider the polygamma function:
$$\psi^{(n)}(z):=\mathrm D^{n+1}(\log \Gamma)(z)=(-1)^{n+1}n!\sum_{k=0}^\infty \frac{1}{(k+z)^{n+1}}$$
The sum formula is proven in this excellent video from Flammable Maths. We can write this as
$$\sum_{k\in\Bbb{Z}}\frac{1}{(k+z)^2}=\psi^{(1)}(z)+\psi^{(1)}(1-z)$$
Let's let
$$f_n(z)=\psi^{(n)}(z)-(-1)^n\psi^{(n)}(1-z)$$
Now let $\mathrm I$ be the integral operator. Ignoring constants of integration for now (it can be shown they all vanish), we can see using the derivative definition of the polygamma that
$$\mathrm I^{n+1} f_n(z)=\log \Gamma(z)+\log\Gamma(1-z)$$
Using the laws of logarithms we have
$$\mathrm I^{n+1}f_n(z)=\log\big(\Gamma(z)\Gamma(1-z)\big)$$
But using Euler's reflection formula which is also proven by Flammable Maths we have
$$\mathrm I^{n+1}f_n(z)=\log\left(\frac{\pi}{\sin(\pi z)}\right)=\log(\pi)-\log(\sin(\pi z))$$
Taking a derivative on both sides,
$$\mathrm I^n f_n(z)=-\frac{1}{\sin(\pi z)}\cdot \cos(\pi z)\cdot \pi=-\pi\cot( \pi z)$$
Hence,
$$f_n(z)=\mathrm D^n(s\mapsto -\pi \cot(\pi s))(z)$$
Therefore
$$f_1(z)=\mathrm D(s\mapsto -\pi\cot(\pi s))(z)=\pi^2\csc^2 (\pi z)$$