<s>[INST] Proof that $\int_0^\infty\frac{\ln x}{x^3 - 1} \, dx = \frac{4 \pi^2}{27}$ I realise this question was asked here, but I'm not able to work with any of the answers. The hint given by my professor is

Integrate around the boundary of an indented sector of aperture $\frac{2 \pi}{3}$

but when I try that I can't figure out how to deal with the (divergent) integral along the radial line at angle $2 \pi / 3$. My issue with the accepted answer is that it uses the residue theorem where it doesn't apply, at least as we've learned it, since
$$z \mapsto \frac{\log^2z}{z^3 - 1}$$
has non-isolated singularities on the closed region bounded by the proposed contour (due to branch cuts), and I am not sure how to relate the integral along the real axis to one over a contour modified to avoid the branch cut.
For a fixed $\varepsilon > 0$, and for any $\delta \in (0, 1 - \varepsilon)$, we could let $\log_{-\delta / 2}$ be the branch of the logarithmic function with a cut along the ray $\operatorname{arg}z = -\delta / 2$ and define a contour which goes along the positive real axis from $\varepsilon$ to $1 - \delta$, a semicircle in the upper half plane of radius $\delta$ around $1$, the positive real axis from $1 + \delta$ to $2$, an arc of radius $2$ around $0$ with central angle $2 \pi - \delta$, the ray $\operatorname{arg}z = 2 \pi - \delta$ from $r = 2$ to $r = \varepsilon$, and finally an arc of radius $\varepsilon$ around $0$ back to $\varepsilon$. But then, for example, I don't know how to calculate the limit of integral along the arc of radius $\varepsilon$
$$\lim_{\delta \to 0}\int_0^{2 \pi - \delta}\frac{\log_{-\delta / 2}^2(\varepsilon e^{i \theta})}{\varepsilon^3 e^{3 i \theta} - 1} \varepsilon i e^{i \theta} \, d\theta.$$
If I instead try to first use the substitution $x = e^u$ on the real integral and then compute a contour integral, I still get a divergent integral that I don't know how to handle, this time along the top of an indented rectangle.
 [/INST] Here we discuss two ways of tackling the integral using contour integral. I added Solution 1 to help you implement the hint suggested by the professor. However, I personally recommend you to jump directly to Solution 2.

Solution 1. Consider
$$ f(z) = \frac{\log z}{z^3 - 1}, $$
where $\log(\cdot)$ is the principal complex logarithm. Now we integrate $f$ along the boundary of the indented sector of opening $2\pi/3$:

Here, the radius of the larger arc $\Gamma_2$ (resp. smaller arc $\Gamma_1$) is $R$ (resp. $\epsilon$) and $0 < \epsilon < 1 < R$. Then it is easy to check that
$$ \left| \int_{\Gamma_1} f(z) \, \mathrm{d}z \right| \leq C \epsilon ( C + \log (1/\epsilon) )
\qquad\text{and}\qquad
\left| \int_{\Gamma_2} f(z) \, \mathrm{d}z \right| \leq \frac{C(C + \log R)}{R^2} $$
for $C = 2\pi/3$, and so, the integrals along these curves vanish as $\epsilon \to 0^+$ and $R \to \infty$. So by the residue theorem,
\begin{align*}
\int_{L_1} f(z) \, \mathrm{d}z + \int_{L_2} f(z) \, \mathrm{d}z + \int_{L_3} f(z) \, \mathrm{d}z + \int_{\gamma} f(z) \, \mathrm{d}z = o(1)
\end{align*}
as $\epsilon \to 0^+$ and $R\to\infty$. However, using the fact that $\omega = e^{2\pi i/3}$ is a simple pole of $f(z)$, the function $(z - \omega)f(z)$ is analytic at $z = \omega$. So
\begin{align*}
\lim_{\epsilon \to 0^+} \int_{\gamma} f(z) \, \mathrm{d}z
&= \lim_{\epsilon \to 0^+} i\int_{2\pi/3}^{-\pi/3} \epsilon e^{i\theta} f(\omega + \epsilon e^{i\theta}) \, \mathrm{d}\theta \tag{$z=\omega+\epsilon e^{i\theta}$} \\
&= -i \pi \lim_{z \to \omega} (z - \omega)f(z)
= -i \pi \mathop{\mathrm{Res}}_{z = \omega} f(z) \\
&= \frac{2\pi^2}{9} \omega.
\end{align*}
Moreover,
\begin{align*}
\int_{L_2} f(z) \, \mathrm{d}z
&= -\omega \int_{1+\epsilon}^{R} f(\omega x) \, \mathrm{d}x
= -\omega \int_{1+\epsilon}^{R} \left( f(x) + \frac{2\pi i}{3} \cdot \frac{1}{x^3 - 1} \right) \, \mathrm{d}x
\end{align*}
and likewise
\begin{align*}
\int_{L_3} f(z) \, \mathrm{d}z
= -\omega \int_{\epsilon}^{1-\epsilon} \left( f(x) + \frac{2\pi i}{3} \cdot \frac{1}{x^3 - 1} \right) \, \mathrm{d}x.
\end{align*}
Combining altogether and using that $f(z)$ is analytic at $z = 1$,
\begin{align*}
(1 - \omega) \int_{\epsilon}^{R} f(x) \, \mathrm{d}x
- \frac{2\pi i \omega}{3} \left( \int_{\epsilon}^{1-\epsilon} \frac{1}{x^3 - 1} \, \mathrm{d}x + \int_{1+\epsilon}^{R} \frac{1}{x^3 - 1} \, \mathrm{d}x \right)
+ \frac{2\pi^2}{9} \omega = o(1).
\end{align*}
Letting $\epsilon \to 0^+$ and $R \to \infty$,
\begin{align*}
(1 - \omega) \int_{0}^{\infty} f(x) \, \mathrm{d}x
- \frac{2\pi i \omega}{3} \left( \mathop{\mathrm{PV}}\! \int_{0}^{\infty} \frac{1}{x^3 - 1} \, \mathrm{d}x \right)
+ \frac{2\pi^2}{9} \omega = 0.
\end{align*}
By noting that
\begin{align*}
\mathop{\mathrm{PV}}\! \int_{0}^{\infty} \frac{1}{x^3 - 1} \, \mathrm{d}x
&=-\frac{\pi}{3\sqrt{3}},
\end{align*}
we end up with
\begin{align*}
\int_{0}^{\infty} f(x) \, \mathrm{d}x
= \frac{\omega}{1 - \omega} \left( -\frac{\pi}{3\sqrt{3}} \cdot \frac{2\pi i}{3}
- \frac{2\pi^2}{9} \right)
= \frac{4\pi^2}{27}.
\end{align*}

Solution 2. Here is a more elegant solution. Let $\operatorname{Log}$ denote the complex logarithm chosen so that its argument lies between $0$ and $2\pi$. (Note: Using the principal complex logarithm, this can be realized by $\operatorname{Log}(z) = i\pi + \log(-z)$.) Then consider
$$ g(z) = \frac{(\operatorname{Log}(z) - 2\pi i)\operatorname{Log}(z)}{z^3 - 1}. $$
Then it is not hard to see that, for $x > 0$,
\begin{align*}
g(x + i0^+) := \lim_{\epsilon \to 0^+} g(x + i\epsilon)
&= \frac{(\log x - 2\pi i)\log x}{x^3 - 1} \\
g(x - i0^+) := \lim_{\epsilon \to 0^+} g(x - i\epsilon)
&= \frac{(\log x + 2\pi i)\log x}{x^3 - 1}.
\end{align*}
So by using the keyhole contour,
$$ \int_{0}^{\infty} \bigl( g(x + i0^+) - g(x - i0^+) \bigr) \, \mathrm{d}x
= 2\pi i \biggl( \mathop{\mathrm{Res}}_{z=e^{2\pi i/3}} g(z) + \mathop{\mathrm{Res}}_{z=e^{4\pi i/3}} g(z) \biggr) $$
Now the left-hand side is
$$ (-4\pi i) \int_{0}^{\infty} \frac{\log x}{x^3 - 1} \, \mathrm{d}x $$
and the right-hand side is
$$ 2\pi i \biggl( \frac{\bigl(\frac{2\pi i}{3} - 2\pi i \bigr)\bigl( \frac{2\pi i}{3} \bigr)}{3 e^{4\pi i}} + \frac{\bigl(\frac{4\pi i}{3} - 2\pi i \bigr)\bigl( \frac{4\pi i}{3} \bigr)}{3 e^{8\pi i}} \biggr) = 2\pi i \left( -\frac{8\pi^2}{27} \right).$$
Therefore the answer is again $\frac{4\pi^2}{27}$.
</s>