Lời giải:
Ta có:
\(2x^2+y^2+z^2-2x-2xy+2z+2=0\)
\(\Leftrightarrow (x^2+y^2-2xy)+(x^2-2x+1)+(z^2+2z+1)=0\)
\(\Leftrightarrow (x-y)^2+(x-1)^2+(z+1)^2=0(*)\)
Vì \((x-y)^2; (x-1)^2; (z+1)^2\geq 0, \forall x,y,z\in\mathbb{R}\)
Do đó, để $(*)$ xảy ra thì \((x-y)^2=(x-1)^2=(z+1)^2=0\)
\(\Rightarrow \left\{\begin{matrix} x=y=1\\ z=-1\end{matrix}\right.\)
\(\Rightarrow P=x+y+z=1\)