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.

HINT: 
As $\dfrac{d(2+x+x^2+x^3)}{dx}=1+2x+3x^2,$
let  $\sqrt{1+\sqrt{2+x+x^2+x^3}}=u\implies 2+x+x^2+x^3=(u^2-1)^2$
and $(1+2x+3x^2)dx=(u^2-1)2u\ du$
Now use Partial Fraction Decomposition, 
$\dfrac1{(u^2-1)^2}=\dfrac A{u-1}+\dfrac B{(u-1)^2}+\dfrac C{u+1}+\dfrac D{(u+1)^2}$
