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