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