\(x^3-x^2y+3x-3y\)
\(=x^2\left(x-y\right)+3\left(x-y\right)\)
\(=\left(x-y\right)\left(x^2+3\right)\)
\(=x^2\left(x-y\right)+3\left(x-y\right)=\left(x^2+3\right)\left(x-y\right)\)
\(x^3-x^2y+3x-3y=x^2\left(x-y\right)+3\left(x-y\right)=\left(x-y\right)\left(x^2+3\right)\)