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