Ta có:
\(x^2+y^2+z^2-2x+4y=6z-14\\ \Leftrightarrow\left(x^2-2x+1\right)+\left(y^2+4y+4\right)+\left(z^2-6z+9\right)=0\\ \Leftrightarrow\left(x-1\right)^2+\left(y+2\right)^2+\left(z-3\right)^2=0\\ \Leftrightarrow\left\{{}\begin{matrix}x=1\\y=-2\\z=3\end{matrix}\right.\)
Thay vào p ta có: \(p=1^{2021}+\left(-2\right)^2+3=1+4+3=8\)
\(x^2+y^2+z^2-2x+4y=6z-14\)
\(\leftrightarrow (x^2-2x+1)+(y^2+4y+4)+(z^2-6z+9)=0\)
\(\leftrightarrow (x-1)^2+(y+2)^2+(z-3)^2=0\)
Ta có \(\begin{cases} (x-1)^2\ge 0\\(y+2)^2\ge 0\\(z-3)^2\ge 0\end{cases}\)
\(\to (x-1)^2+(y+2)^2+(z-3)0^2\ge 0\)
\(\to\) Dấu "=" xảy ra khi \(\begin{cases}x-1=0\\y+2=0\\z-3=0\end{cases}\)
\(\leftrightarrow \begin{cases}x=1\\y=-2\\z=3\end{cases}\)
Thay \(x=1;y=-2;z=3\) vào P
\(P=1^{2021}+(-2)^2+3=1+4+3=8\)
Vậy \(P=8\)