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.
 A: 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}$.
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\on}[1]{\operatorname{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
$\ds{\cal C}$ is a key-hole contour which "takes care" of the $\ds{\ln}$-branch cut with $\ds{0 < \arg\pars{z} < 2\pi}$.
Integrand poles are $\ds{\expo{2\pi\ic/3}}$ and
$\ds{\expo{4\pi\ic/3}}$.

Residue Theorem yields:
\begin{align}
\oint_{\cal C}{\ln^{2}\pars{z} \over z^{3} - 1}\,\dd z& =
2\pi\ic\bracks{%
\pars{{2\pi \over 3}\,\ic}^{2}\,{\expo{2\pi\ic/3} \over 3} +
\pars{{4\pi \over 3}\,\ic}^{2}\,{\expo{4\pi\ic/3}  \over 3}}
\\[5mm] & = -\,{4 \over 27}\pars{3\root{3} - 5\ic}\pi^{3}
\end{align}

Note that the singularity at $\ds{z = 1}$ lies on the
$\ds{\ln}$-branch cut. Hereafter we properly deals with this fact ( see below ).
Namely,
\begin{align}
&\bbox[5px,#ffd]{\oint_{\cal C}{\ln^{2}\pars{z} \over z^{3} - 1}\,\dd z}
\\[5mm] = &\
\int_{0}^{\infty}{\ln^{2}\pars{x} \over
\pars{x - 1 + \ic 0^{+}}\pars{x^{2} + x + 1}}\,\dd x
\\[2mm] + &\
\int_{\infty}^{0}{\bracks{\ln\pars{x} + 2\pi\ic}^{2} \over
\pars{x - 1 - \ic 0^{+}}\pars{x^{2} + x + 1}}\,\dd x
\\[5mm] = &\
\mrm{P.V.}\int_{0}^{\infty}{\ln^{2}\pars{x} \over
\pars{x - 1}\pars{x^{2} + x + 1}}\,\dd x
\\[2mm] - &\
\mrm{P.V.}\int_{0}^{\infty}{\ln^{2}\pars{x} + 4\pi\ic\ln\pars{x} - 4\pi^{2} \over
\pars{x - 1}\pars{x^{2} + x + 1}}\,\dd x
+ {4\pi^{3} \over 3}\,\ic
\\[5mm] = &\
-4\pi\ic\int_{0}^{\infty}{\ln\pars{x} \over x^{3} - 1}\,\dd x +
4\pi^{2}\
\underbrace{\mrm{P.V.}\int_{0}^{\infty}{\dd x \over x^{3} - 1}
\,\dd x}_{\ds{-\,{\root{3} \over 9}\,\pi}}\  +\
{4\pi^{3} \over 3}\,\ic
\end{align}

\begin{align}
&\int_{0}^{\infty}{\ln\pars{x} \over x^{3} - 1}\,\dd x
\\[2mm] = &\
{-\,\pars{4/27}\pars{3\root{3} - 5\ic}\pi^{3} -
4\pi^{2}\pars{-\root{3}\pi/9} - 4\pi^{3}\ic/3 \over -4\pi\ic}
\\[2mm] & =
\bbx{4\pi^{2} \over 27} \approx 1.4622 \\ &
\end{align}
