a)\(P=-x^2-4x+16\)
\(=-x^2-4x-4-12\)
\(=-\left(x^2+4x+4\right)-12\)
\(=-\left(x+2\right)^2-12\le-12\)
Đẳng thức xảy ra khi \(x=-2\)
b)\(-x^2+2xy-4y^2+2x+10y-2017\)
\(=\left(-x^2+2xy-y^2+2x-2y-1\right)+\left(-3y^2+12y-12\right)-2004\)
\(=-\left(x^2-2xy+y^2-2x+2y+1\right)-3\left(y^2-4y+4\right)-2004\)
\(=-\left[\left(x-y\right)^2-2\left(x-y\right)+1\right]-3\left(y-2\right)^2-2004\)
\(=-\left(x-y-1\right)^2-3\left(y-2\right)^2-2004\le-2004\)
Đẳng thức xảy ra khi \(\left\{{}\begin{matrix}x-y-1=0\\y-2=0\end{matrix}\right.\)\(\Rightarrow\left\{{}\begin{matrix}x=3\\y=2\end{matrix}\right.\)