[tex]3x^3-3x^2y+xy^2-x^2y[/tex]
All terms have an x in them, so you factor that out first to get
[tex]x(3x^2 -4xy+y^2)[/tex]
Now the 2nd degree equation will be of the form (3x- ... y)(x- ... y) and by just trying you find that the ... is just 1. So the factorization is:
[tex]x(3x - y)(x - y)[/tex]