I don't understand how to get from the first to the second step here and get $1/3$ in front.
In the second step $g(x)$ substitutes $x^3 + 1$.
\begin{align*} \int_0^2 \frac{x^2}{x^3 + 1} \,\mathrm{d}x &= \frac{1}{3} \int_{0}^{2} \frac{1}{g(x)} g'(x) \,\mathrm{d}x = \frac{1}{3} \int_{1}^{9} \frac{1}{u} \,\mathrm{d}u \\ &= \left. \frac{1}{3} \ln(u) \,\right|_{1}^{9} = \frac{1}{3} ( \ln 9 - \ln 1 ) = \frac{\ln 9}{3} \end{align*}
The derivative of $g(x)$ is $g'(x)=3x^2$. The constant $3$ is not present in the first expression but:
$\frac{1}{3}g'(x)=\frac{1}{3}\cdot 3x^2=x^2$