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