Answer
$(x+2)(x-1)(x+1)$
Work Step by Step
Regroup to obtain:
$=(x^3+2x^2) + (-x-2)$
Factor out $x^2$ in the first group and $-1$ in the second to obtain:
$=x^2(x+2) + (-1)(x+2)
\\=x^2(x+2) - 1(x+2)$
Factor out the GCF of $x+2$ to obtain:
$=(x+2)(x^2-1)
\\=(x+2)(x^2-1^2)$
Factor the difference of two squares using the formula $a^2-b^2=(a-b)(a+b)$ where $a=x$ and $b=1$ to obtain:
$=(x+2)(x-1)(x+1)$