<s>[INST] Another integral $\int \frac{3 x^2+2 x+1}{ \left(x^3+x^2+x+2\right) \sqrt{1+\sqrt{x^3+x^2+x+2}}} \, dx$ Here is an indefinite integral that is similar to an integral I wanna propose for a contest. Apart from 
using CAS, do you see any very easy way of calculating it?
$$\int \frac{1+2x +3 x^2}{\left(2+x+x^2+x^3\right) \sqrt{1+\sqrt{2+x+x^2+x^3}}} \, dx$$
EDIT: It's a part from the generalization 
$$\int \frac{1+2x +3 x^2+\cdots n x^{n-1}}{\left(2+x+x^2+\cdots+ x^n\right) \sqrt{1\pm\sqrt{2+x+x^2+\cdots +x^n}}} \, dx$$
Supplementary question: How would you calculate the following integral using the generalization above? Would you prefer another way?
$$\int_0^{1/2} \frac{1}{\left(x^2-3 x+2\right)\sqrt{\sqrt{\frac{x-2}{x-1}}+1} } \, dx$$
As a note, the generalization like the one you see above and slightly modified versions can be wisely used for calculating very hard integrals.
 [/INST] Let $$2+x+x^2+x^3=t^2\implies (1+2x+3x^2)dx=2tdt$$ $$\int \frac{2tdt}{t^2\sqrt{1+t}}$$ $$=2\int \frac{dt}{t\sqrt{1+t}}$$
Let $1+t=x^2\implies dt=2xdx$
$$=2\int \frac{2xdx}{(x^2-1)x}$$
$$=4\int \frac{dx}{x^2-1}$$
$$=4\int \frac{dx}{(x-1)(x+1)}$$
$$=4\frac{1}{2}\int \left(\frac{1}{x-1}-\frac{1}{x+1}\right)dx$$
$$=4\frac{1}{2}\left(\int\frac{dx}{x-1}-\int\frac{dx}{x+1}\right)$$
$$=2\left(\ln|x-1|-\ln|x+1|\right)+c$$
$$=2\ln\left|\frac{x-1}{x+1}\right|+c$$
$$=2\ln\left|\frac{\sqrt{1+t}-1}{\sqrt{1+t}+1}\right|+c$$
$$=2\ln\left|\frac{\sqrt{1+\sqrt{1+2+x+x^2+x^3}}-1}{\sqrt{1+\sqrt{1+2+x+x^2+x^3}}+1}\right|+c$$
</s>