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