x^3-x^2+2
he factored by grouping.
$\displaystyle x^3 + 1$ <--------sum of two cubes. goes to $\displaystyle (x + 1)(x^2 - x + 1)$
$\displaystyle 1 - x^2$ <--------difference of two squares. goes to $\displaystyle (1 - x)(1 + x)$
in the third step, he factored out the common factor, that is, $\displaystyle (x + 1)$