\(P=\left(x^2-2x+1\right)+\left(y^2-2y+1\right)+xy-x-y+1+2012=\left(x-1\right)^2+\left(y-1\right)^2-\left(x-1\right)\left(y-1\right)+2012\)
\(P=\left(\left(x-1\right)^2-\left(x-1\right)\left(y-1\right)+\frac{\left(y-1\right)^2}{4}\right)+\frac{3\left(y-1\right)^2}{4}+2012=\left(x-1-\frac{y-1}{2}\right)^2+\frac{3\left(y-1\right)^2}{4}+2012\ge2012\)
=> Min P=2012 <=> \(\frac{2x-2-y+1}{2}=0\Leftrightarrow2x-y-1=0\) và \(\frac{3\left(y-1\right)^2}{4}=0\Leftrightarrow y=1\)=> \(2x-1-1=0\Leftrightarrow x=1\)