\(x^3\left(2+x\right)^2-\left(x+2\right)^2+1-x^3\\ =\left(x+2\right)^2\left(x^3-1\right)-\left(x^3-1\right)\\ =\left[\left(x+2\right)^2-1\right]\left(x^3-1\right)\\ =\left(x-1\right)\left(x^2+x+1\right)\left(x^2+4x+3\right)=\left(x-1\right)\left(x+1\right)\left(x+3\right)\left(x^2+x+1\right)\)