\(P=-x^2-4x-y^2+2y\)
\(P=-x^2-4x-y^2+2y+1-1+4-4\)
\(P=-\left(x^2+4x+4\right)-\left(y^2-2y+1\right)+5\)
\(P=-\left(x+2\right)^2-\left(y-1\right)^2+5\le5\)
Dấu "=" xảy ra khi:\(\left\{{}\begin{matrix}-\left(x+2\right)^2=0\\\left(y-1\right)^2=0\end{matrix}\right.\Leftrightarrow\left\{{}\begin{matrix}x=-2\\y=1\end{matrix}\right.\)