<s>[INST] How do we integrate, $\int \frac{1}{x+\frac{1}{x^2}}dx$? How do we integrate the following integral?
$$\int \frac{1}{x+\large\frac{1}{x^2}}\,dx\quad\text{where}\;\;x\ne-1$$
 [/INST] $$\quad\int \frac{1}{x+\large\frac{1}{x^2}}\,dx \quad = \quad\int \frac{1}{\Large\frac {x^3+ 1}{x^2}}\,dx\quad= \quad\int \frac {\color{blue}{\bf x^2\,dx}}{\color{red}{\bf x^3 + 1}}\quad(x \neq -1)$$
Let us substitute $\;\;\color{red}{\bf u} = \color{red}{\bf x^3 + 1} \;\implies\; du = 3x^2\,dx \;\implies \;\color{blue}{\bf\dfrac 13 du} = \color{blue}{\bf x^2\,dx}$.
Substituting equivalent expressions gives us:
$$\int \color{blue}{\bf \frac 13} \frac{\color{blue}{\bf du}}{\color{red}{\bf u}} \;\;= \;\;\frac 13 \ln|u| + C \;\;= \;\;\frac 13 \ln|x^3 + 1| + C, \;\;x\neq -1$$
</s>