Integral of $\int_0^\infty {\log x\over x^b-1}\ dx$ 
Show that for $b>1$, $\int_0^\infty {\log x\over x^b-1}\ dx = {\pi^2\over b^2\sin^2(\pi/b)}$ using $PV\int_0^\infty{1\over x^b-1}\ dx = -{\pi\over b}\cot(\pi/b)$.

Consider a region $\{re^{i\sigma}:0<\sigma<2\pi/b,\epsilon<r<R\}$ with small half circle at $e^{i\theta}$ where $\theta = 2\pi/b$. Let $C_1$ be the outer circle, $C_2$ be the half circle at $e^{i\theta}$ and $C_3$ be the inner circle at $0$. Let $f(z) = {\log z\over z^b-1}$. Then it's easy to see that $\int_{C_1}f(z)dz\to 0$ and $\int_{C_3}f(z)dz\to 0$ as $R\to\infty, \epsilon\to 0$. Note that $f(z)$ is analytic at $1$. So by Cauchy theorem, the contour integral is zero so
$$0 = \int_{\epsilon}^Rf(x)dx + \left(\int_{[Re^{i\theta},(1+\epsilon)e^{i\theta}]} - \int_{C_2}+\int_{[(1-\epsilon)e^{i\theta},\epsilon e^{i\theta}]}\right)f(z)dz,$$
where $C_2$ is positively oriented. Then as $e^{i\theta b} = e^{2\pi i} =1$, direct calculation shows that the above equality becomes
$$\int_0^\infty f(x)dx = \int_{C_2}f(z)dz + e^{i\theta}\int_0^\infty{\log x\over x^b-1}dx-e^{i\theta}i\theta\int_0^\infty{1\over x^b-1}dx.$$
Note that $\int_{C_2}f(z)dz = -\pi i\mathrm{Res}(f(z),e^{i\theta}) = {\pi\theta e^{i\theta}\over b}$. Hence, using the given integral value,
$$\int_0^\infty f(x)dx = {\pi\theta e^{i\theta}\over b}+(e^{i\theta}+i\theta e^{i\theta})\left(-{\pi\over b}\right)\cot\left({\pi\over b}\right).$$
I spent quite a lot of time to transform the RHS to the desired value but I couldn't. Did I mess up somewhere? Anyone please help.
 A: Substituting $x \mapsto x^{a}$ for $a > 0$, we get
$$ \mathrm{PV}\!\int_{0}^{\infty} \frac{1}{x^b - 1} \, \mathrm{d}x
= \mathrm{PV}\!\int_{0}^{\infty} \frac{a x^{a-1}}{x^{ab} - 1} \, \mathrm{d}x $$
This and using the hint, with $c = ab$ we get
$$ \mathrm{PV}\!\int_{0}^{\infty} \frac{x^{a-1}}{x^{c} - 1} \, \mathrm{d}x = -\frac{\pi}{c} \cot\left(\frac{a \pi}{c}\right). $$
Therefore it follows that
\begin{align*}
\int_{0}^{\infty} \frac{\log x}{x^b - 1} \, \mathrm{d}x
&= \int_{0}^{\infty} \biggl( \frac{\partial}{\partial a}\biggr|_{a=1} \biggr) \frac{x^{a-1}}{x^b - 1} \, \mathrm{d}x \\
&= \biggl( \frac{\partial}{\partial a}\biggr|_{a=1} \biggr) \biggl[ \mathrm{PV}\!\int_{0}^{\infty} \frac{x^{a-1}}{x^{b} - 1} \, \mathrm{d}x \biggr] \\
&= \biggl( \frac{\partial}{\partial a}\biggr|_{a=1} \biggr) \biggl[ -\frac{\pi}{b} \frac{\partial}{\partial a} \cot\left(\frac{a \pi}{b}\right) \biggr] \\
&= \frac{\pi^2}{b^2} \csc^2 \left( \frac{\pi}{b} \right).
\end{align*}
A: If one wishes to use contour integration, then one may proceed as follows.
First, let $I(b)$ be given by the integral
$$I(b)=\int_0^\infty \frac1{x^b-1}\,dx$$
Next, enforcing the substitution $x^{1/b}\mapsto x$ reveals
$$I(b)=\frac1b\int_0^\infty \frac{x^{1/b}}{x(x-1)}\,dx$$
Then, integrating around the classical keyhole contour, we find that
$$\begin{align}
0&=(1-e^{i2\pi/b})\,\text{PV}\int_0^\infty \frac{x^{1/b}}{x(x-1)}\,dx\\\\
&+i\lim_{\varepsilon\to 0^+}\left(\int_\pi^0 \frac{e^{\frac1b \log(1+\varepsilon e^{i\phi})}}{(1+\varepsilon e^{i\phi})}\,d\phi+\int_{2\pi}^\pi \frac{e^{i2\pi/b}e^{\frac1b \log(1+\varepsilon e^{i\phi})}}{(1+\varepsilon e^{i\phi})}\,d\phi\right)\\\\
&=(1-e^{i2\pi/b})\,\text{PV}\int_0^\infty \frac{x^{1/b}}{x(x-1)}\,dx-\pi (1+e^{i2\pi/b})
\end{align}$$
whence we find that
$$I(b)= -\frac\pi b\cot(\pi/b) $$
Finally, we have
$$\begin{align}
\int_0^\infty \frac{\log(x)}{x^b-1}\,dx&=\frac1{b^2}\int_0^\infty \frac{\log(x)x^{1/b}}{x(x-1)}\,dx\\\\
&=\frac1{b^2} \frac{\partial }{\partial (1/b)} \int_0^\infty \frac{x^{1/b}}{x(x-1)}\,dx\\\\
&=\frac1{b^2} \frac{\partial }{\partial (1/b)}  (-\pi\cot(\pi/b))\\\\
&=-\frac{\pi^2}{b^2\sin^2(\pi/b)}  
\end{align}$$
as was to be shown!
A: A rather  elementary approach is to start with the given integral identity
(1) $I(b)= -\frac{\pi}{b} \cot ( \frac{\pi}{b}) =\int_0^{\infty} \frac{ dx}{x^b-1}$
and re-write that identity (1) using the change of variables $x= e^t$.
Next perform the   simple change of variables $ bt=\tau$, so $t=\alpha \tau$ where $\alpha= 1/b$.
Deduce
(2) $ -\cot (\alpha \pi) = \int_{-\infty}^{\infty} \frac{ e^{\alpha t} dt}{ e^t-1}$
Now differentiate (2) with respect to $\alpha$ and then re-express this new integral identity  (3) in terms of the original variable $x$.
