a: \(\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(y-1\right)\left(x-1\right)\left(y+1\right)\left(x+1\right)\)
b: \(\left(a+b+c\right)^2+\left(a+b-c\right)^2-4c^2\)
\(=\left(a+b\right)^2+2c\left(a+b\right)+c^2+\left(a+b\right)^2-2c\left(a+b\right)+c^2-4c^2\)
\(=2\left(a+b\right)^2-2c^2\)
\(=2\left(a+b+c\right)\left(a+b-c\right)\)