\(x^2+y^2-x^2y^2+xy-x-y\)
\(=\left(x^2-x^2y^2\right)+\left(y^2-y\right)+\left(xy-x\right)\)
\(=x^2\left(y-1\right)\left(-1-y\right)+y\left(y-1\right)+x\left(y-1\right)\)
\(=\left(y-1\right)\left(-x^2-x^2y+y+x\right)\)
\(=\left(y-1\right)\left[-x\left(x-1\right)-y\left(x-1\right)\left(x+1\right)\right]\)
\(=\left(y-1\right)\left(x-1\right)\left(-x-xy-y\right)\)