Giả sử \(x\le y\le z\) do \(xyz\le0\) nên\(x\le0\)
Do \(x^2+y^2+z^2=9\Rightarrow x^2\le9\Rightarrow x\in\left[-3;0\right]\)
Ta có \(yz\le\left(\frac{y+z}{2}\right)^2\le\frac{y^2+z^2}{2}\)
Do đó : \(2\left(x+y+z\right)-xyz=2x+2\left(y+z\right)-xyz\le2x+2\sqrt{2\left(y^2+z^2\right)}-x.\frac{y^2+z^2}{2}\)
\(=2x+2\sqrt{2\left(9-x^2\right)}-\frac{x\left(9-x^2\right)}{2}=\frac{x^3}{2}-\frac{5x}{2}+2\sqrt{2\left(9-x^2\right)}\)
Xét hàm số :
\(f\left(x\right)=\frac{x^3}{2}-\frac{5x}{2}=2\sqrt{2\left(9-x^2\right)}\) với \(x\in\left[-3;0\right]\) \(\Rightarrow f'\left(x\right)=\frac{3x^2}{2}-\frac{5}{2}-\frac{2\sqrt{2}x}{\sqrt{9-x^2}}\)
Xét \(f'\left(x\right)=0\Leftrightarrow\frac{3x^2}{2}-\frac{5}{2}-\frac{2\sqrt{2}x}{\sqrt{9-x^2}}=0\Leftrightarrow\sqrt{9-x^2}\left(5-3x^2\right)=-4\sqrt{2}x\)
\(\Leftrightarrow\left(9-x^2\right)\left(5-3x^2\right)=32x^2\) (với điều kiện \(5-3x^2\ge0\))
\(\Leftrightarrow9x^9-111x^4+327x^2-225=0\)
\(\Leftrightarrow x^2=1;x^2=3;x^2=\frac{25}{3}\)
\(x^2\le\frac{5}{3}\) nên \(x^2=1\Leftrightarrow x=1,x=-1\) (loại)
Ta có \(f\left(-3\right)=-6;f\left(1\right)=10;f\left(0\right)=6\sqrt{2}\) suy ra Max \(f\left(x\right)=f\left(-1\right)=10\)
\(2\left(x+y+z\right)-xyz\le f\left(x\right)\le10\)
Dấu = xảy ra khi x=-1, y=z và \(x^2+y^2+z^2=9\)
\(\Leftrightarrow x=-1;y=z=2\)