<s>[INST] Evaluate the integral $\int \frac{1}{\sqrt[3]{(x+1)^2(x-2)^2}}\mathrm dx$ What substitution is useful for this integral?
$$\int \frac{1}{\sqrt[3]{(x+1)^2(x-2)^2}}\mathrm dx$$
Substitutions $u=x^{\frac{2}{3}},u=(x+1)^{\frac{2}{3}},u=(x-2)^{\frac{2}{3}}$ are not working. 
Can't find useful trigonometric substitution. 
 [/INST] I found an interesting substitution by a bit of trial and error.
$$\begin{align}
x&=\frac{1+3\sin(u)}{2}\\
\therefore dx&=\frac{3\cos(u)}{2}du\\
x+1&=\frac{3+3\sin(u)}{2}&&=\frac{3(1+\sin(u))}{2}\\
x-2&=\frac{3\sin(u)-3}{2}&&=\frac{3(\sin(u)-1)}{2}\\
\therefore (x+1)(x-2)&=\frac{9(\sin^2(u)-1)}{4}&&=-\frac{9\cos^2(u)}{4}
\end{align}$$
Using these leads to this interesting final integral:$$\left(\frac{2}{3}\right)^{\frac{1}{3}}\int\frac{du}{\cos^{\frac{1}{3}}(u)}$$
</s>