Answer
$$=2x^3-x^2-1$$
Work Step by Step
Simplifying and then subtracting the two sides of the expression, we find:
$$x^2\left(x+1\right)^2-\left(x^2+1\right)^2 \\ x^4+2x^3+x^2-\left(x^4+2x^2+1\right) \\ x^4+2x^3+x^2-x^4-2x^2-1 \\ =2x^3-x^2-1$$