3x3 - x2 - 3x + 1
Constant term of p(x) = -1
$\therefore$ Factors of 1 are ±1
By trial, we find that p(1) = 0, so (x - 1) is a factor of p(x).
Now, we see that 3x3 - x2 - 3x - 1
= 3x2 - 3x2 + 2x2 - 2x - x + 1
= 3x2(x - 1) + 2x(x - 1) -1(x - 1)
= (x - 1)(3x2 + 2x - 1)
Now, (3x2 + 2x - 1) = 3x2 - x2 - 3x - 1 [bi spliting middle term]
= 3x2 (x + 1) -1(x + 1) = (x + 1)(3x - 1)
$\therefore$ 3x2 - x2 - 3x - 1 = (x - 1)(x + 1)(3x - 1)