b: \(xy\left(x+y\right)-yz\left(y+z\right)+xz\left(x-z\right)\)
\(=x^2y+xy^2-y^2z-yz^2+x^2z-xz^2\)
\(=x^2y-yz^2+xy^2-y^2z+x^2z-xz^2\)
\(=y\left(x-z\right)\left(x+z\right)+y^2\left(x-z\right)+xz\left(x-z\right)\)
\(=\left(x-z\right)\left(xy+yz+y^2+xz\right)\)
\(=\left(x-z\right)\left(x+y\right)\left(x+z\right)\)