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