Suppose that $x,y,z\geq 0$ are three reals. I want to prove $$2(x+y)(x+z)(y+z)+2xyz\le(xy+yz+xz)^2+(x+y+z)^2.$$
My attempt: By AM-GM: $$LHS\le \frac2{27} (2x+2y+2z)^3+2xyz=\frac{16}{27}(x+y+z)^3+2xyz.$$
I am not sure what the right way to continue is.
Hint: It is $$(xy+yz+xz)^2-2(x+y)(x+z)(y+z)-2xyz+(x+y+z)^2=\left( xy+xz+yz-x-y-z \right) ^{2}$$