a) \(=xy^2\left(y+x+1\right)\)
b) \(=x^2y\left(x+y\right)-\left(x+y\right)=\left(x+y\right)\left(x^2y-1\right)\)
c) \(=\left(x^2-6xy+9y^2\right)-z^2\)
\(=\left(x-3y\right)^2-z^2=\left(x-3y-z\right)\left(x-3y+z\right)\)
d) \(x\left(x-4\right)-2\left(x-4\right)=\left(x-4\right)\left(x-2\right)\)