Ta có: \(P=2x-2xy-2x^2-y^2\)
\(P=-x^2-2xy-y^2-x^2+2x\)
\(P=-\left(x^2+2xy+y^2\right)-\left(x^2-2x+1\right)+1\)
\(P=-\left(x+y\right)^2-\left(x-1\right)^2+1\)
\(P=-\left[\left(x+y\right)^2+\left(x-1\right)^2\right]+1\le1\forall x;y\)
Vậy GTLN của P là 1 khi x=-1; y=1.