\(xy\left(x+y\right)+yz\left(y+z\right)+xz\left(x+z\right)+2xyz=xy\left(x+y+z\right)+yz\left(x+y+z\right)+xz\left(x+z\right)\)
\(=y\left(x+y+z\right)\left(x+z\right)+xz\left(x+z\right)=\left(xy+y^2+zy+xz\right)\left(x+z\right)=\left\{y\left(x+y\right)+z\left(x+y\right)\right\}\left(x+z\right)=\left(x+y\right)\left(y+z\right)\left(x+z\right)\)