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