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?
 A: The standard method uses partial fractions decomposition.
Here is how it begins for the first integral: factorout  the denominator into irreducible factors with high-school identities:
$$x^3+1=(x+1)(x^2-x+1)$$
Newt proceed to decompose into partial fractions:
$$\frac{1}{(x^3+1)^2}=\frac{1}{(x+1)^2(x^2-x+1)^2}=\frac A{x+1}+\frac B{(x+1)^2}+\frac {Cx+D}{x^2-x+1}+\frac{Ex+F}{(x^2-x+1)^2}.$$
A: $$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.
A: Hint:
Simplify
$$\int{\frac{1}{(x^3+1)^2}}dx=\frac x{3(x^3+1)}+\frac13\int\frac2{x^3+1}dx$$
Then, decompose
$$\frac2{x^3+1}=\frac1{x+1}+\frac{1}{x^2-x+1}- \frac{x^2}{x^3+1}$$
A: $$
\begin{aligned}
I &=\int \frac{1}{\left(x^{3}+1\right)^{2}} d x \\
&=-\frac{1}{3} \int \frac{1}{x^{2}} d\left(\frac{1}{x^{3}+1}\right) \\
&=-\frac{1}{3 x^{2}\left(x^{3}+1\right)}-\frac{2}{3} \int \frac{1}{x^{3}\left(x^{3}+1\right)} d x \\
&=-\frac{1}{3 x^{2}\left(x^{3}+1\right)}-\frac{2}{3} \int\left(\frac{1}{x^{3}}-\frac{1}{x^{3}+1}\right) d x \\
&=-\frac{1}{3 x^{2}\left(x^{3}+1\right)}+\frac{1}{3 x^{2}}+\frac{1}{3} \int \frac{d x}{x^{3}+1}
\end{aligned}
$$
By my post,
$$
\therefore I=\frac{1}{18}\left[\frac{6 x}{\left(x^{3}+1\right)}+\ln \left|\frac{(1+x)^{2}}{1-x+x^{2}}\right|+2 \sqrt{3} \tan ^{-1}\left(\frac{2 x-1}{\sqrt{3}}\right)\right]+C
$$
