y³ + 2xy² - 2x - y, if you rearrange the terms
= y²(y + 2x) - (2x + y), using factoring by grouping
= y²(2x + y) - (2x + y)
= (2x + y)(y² - 1), by pulling out the greatest common factor
= (2x + y)(y + 1)(y - 1), by factoring the difference of two squares