<s>[INST] Integral $\int{\frac{1}{(x^{3} \pm 1)^2}}$ I need to solve the following integrals:
$$\int{\frac{1}{(x^3+1)^2}}dx$$
and
$$\int{\frac{1}{(x^3-1)^2}}dx$$
My first thought was to use a trigonometric substitution but the $x^3$ messed it up. Can you guys suggest another method?
 [/INST] $$I=\int{\frac{1}{(x^3+1)^2}}dx$$
$$I=-\int  \frac {1}{3x^2}\color {red}{{\frac{-3x^2}{(x^3+1)^2}}}dx$$
The function in red is a derivative.
$$I=-\int  \frac {1}{3x^2}\color {red}{ \left ({\frac{1}{x^3+1}} \right )'}dx$$
The integral is now of the form:
$$ \color {blue}{I=\int f(x) g'(x)dx}$$
Integrate by part
$$ \color {blue}{\int f(x) g'(x)dx=f(x)g(x)-\int f'(x)g(x) dx}$$
$$I=- \frac {1}{3x^2}{\frac{1}{(x^3+1)}}-\frac {2}{3}\int  \frac {1}{x^3}{\frac{1}{(x^3+1)}}dx$$
$$I_2=\int  \frac {1}{x^3}{\frac{1}{(x^3+1)}}dx$$
$$I_2=\int  \frac {dx}{x^3}-\int {\frac{dx}{(x^3+1)}}$$
$$I_2=-  \frac {1}{2x^2}-\int {\frac{1}{(x^3+1)}}dx$$
So that we have :
$$I=\frac x{3(x^3+1)}+\frac23\int\frac1{x^3+1}dx$$
Then use fraction decomposition method for that integral.
</s>