<s>[INST] How prove this inequality $x^2+y^2+z^2+xyz(x+y+z-2)\ge 4$ let $x,y,z\ge 0$,and such
$$xy+yz+xz=xyz+2$$
show that
$$x^2+y^2+z^2+xyz(x+y+z-2)\ge 4$$
my try: let $x+y+z=p,xy+yz+xz=q, xyz=r$
then 
$$q=r+2$$
show that
$$p^2-2q+r(p-2)\ge 4$$
then I can't,Thank you
 [/INST] WLOG, $z=$Min{$x,y,z$},$z=\dfrac{2-xy}{x+y-xy}, t^2=xy,p=x+y, \implies p^2 \ge 4t^2,p\ge2t$
$z\ge 0 \implies (2-t^2)(p-t^2)\ge 0 \implies p\ge 2, t^2 \le2 $. 
(if $p<2, t^2\le \dfrac{1}{2} \implies z>1$, but $z\le \dfrac{x+y}{2} < 1, $ contradict.)
(if $t^2>p\ge2 ,z=\dfrac{t^2-2}{t^2-p}<\dfrac{p}{2} \iff t^2 >\dfrac{p^3-4}{p-2} \iff \dfrac{p^2}{4} > \dfrac{p^3-4}{p-2} \iff 3p^3+2p^2<16$, but $3p^3+2p^2\ge40$ ,contradict)
replace $x,y,z$ with $p,t$  we have the inequality:
$f(p)=p^4-2t^2p^3-4p^2+(t^6+4t^4+4t^2)p-3t^6-3t^4+4 \ge 0$
$f'(p)=4p^3-6t^2p^2-8p+t^6+4t^4+4t^2   , f''(p)=12p^2-12tp-8  ,\dfrac{12t}{2*12}=\dfrac{t}{2}<1<2 \implies 2t\ge 2 ,f''_{min}=f(2t)=24t^2-8>0 \\ 2t<2,f''_{min}=f(2)=40-24t>0$
so $f'(p)$ is mono increasing function $\implies$
$2t>2,f'_{min}=f(2t)=t(t^5-20t^3+32t^2+4t-16)=t(13(2-t^2)(t-1)+(t-1)^2(t^3+2t^2-4x+9)+1)\ge t > 0   \\ 2t<2,f'_{min}=f(2)=t^6+4t^4-20t^2+16=t^6+4t^2(1-t)(4-t)>0$
so $f(p)$ is mono increasing function $\implies$ 
$2t \ge 2, f_{min}=f(2t)=(t-1)^2(t^2-2)^2(2t+1) \ge 0,t=1 $ or $t^2=2$ get min zero.  
$2t<2,f_{min}=f(2)=-t^6+5t^4-8t^2+4=(1-t^2)(t^2-2)^2 \ge 0$
so $f(p) \ge 0$, the "=" will hold  when $p=2t, t=1 $ or $t=\sqrt{2} \implies x=y=1=z$ or $x=y=\sqrt{2},z=0$
</s>