a)\(x^2-y^2-x+3y-2=\left(x^2+xy-2x\right)-\left(xy+y^2-2y\right)+\left(x+y-2\right)\)
\(=x\left(x+y-2\right)-y\left(x+y-2\right)+\left(x+y-2\right)\)
\(=\left(x+y-2\right)\left(x-y+1\right)\)
b)\(x^3+y^3+6xy+x+y-10\)
\(=\left(x^3+xy^2-x^2y+2x^2+2xy+5x\right)+\left(y^3+x^2y+xy^2+2y^2+2xy+5y\right)-\left(2x^2+2y^2-2xy+4x+4y+10\right)\)
\(=x\left(x^2+y^2-xy+2x+2y+5\right)+y\left(y^2+x^2-xy+2y+2x+5\right)-2\left(x^2+y^2-xy+2x+2y+5\right)\)\(=\left(x+y-2\right)\left(x^2+y^2-xy+2x+2y+5\right)\)