Factor by grouping

#x^3+x^2-x-1 =[x^3+x^2]+[-x-1]#

The first bracket has a common factor of #x^2# and the second bracket has a common factor of #-1#. take those out to get:

#x^3+x^2-x-1 = x^2[x+1] color(red)(+) (-1)[x+1]#

Now we have two terms, one on each side of the red #color(red)(+) #.

Each term has a factor (in brackets) of #[x+1]#. Tlhat is a common factor, so we can factor it out:

#x^3+x^2-x-1 = x^2[x+1] color(red)(+) (-1)[x+1]#

#color(white)"ssssssssssssssssss"# #=( x^2 color(red)(+) (-1))[x+1]#

#color(white)"ssssssssssssssssss"# #=( x^2 - 1)(x+1)#

#x^3+x^2-x-1 = ( x^2 - 1)(x+1)#

Are we finished or can anything be factored more?

#x^2-1# is a difference of twp squares, so we can factor it.

#x^3+x^2-x-1 = ( x+1)(x - 1)(x+1)#

Now we are finished.