x^2+x^2(x+1)^2+(x+1)^2
=X^2[1+(1+X)^2]+(X+1)^2
=X^2[X^2+2(X+1)]+(X+1)^2
=X^4+2X^2(X+1)+(X+1)^2
=(X^2+X+1)^2