\(x^2y+y^2x+x^2z+z^2x+y^2z+z^2y+2xyz\)..
\(=\left(x^2y+z^2y+2xyz\right)+\left(y^2x+y^2z\right)+\left(z^2x+x^2z\right)\).
\(=y\left(x+z\right)^2+y^2\left(x+z\right)+xz\left(x+z\right)\)
\(=\left(xy+yz\right)\left(x+z\right)+\left(x+z\right)\left(y^2+xz\right)\).
\(=\left(x+z\right)\left(xy+yz+y^2+xz\right)\).
\(=\left(x+z\right)\left[x\left(y+z\right)+y\left(y+z\right)\right]\).
\(=\left(x+z\right)\left(x+y\right)\left(y+z\right)\).