\(P=x^2-4x+y^2-5y+xy+2022\)
\(P=\left(x^2+\dfrac{1}{4}+4+xy-4x-2y\right)+\dfrac{3}{4}y^2-3y+2018\)
\(P=\left(x+\dfrac{1}{2}y-2\right)^2+3\left(\dfrac{1}{4}y^2-y+1\right)+2015\)
\(P=\left(x^2+\dfrac{1}{2}y-2\right)^2+3\left(\dfrac{1}{2}y-1\right)^2+2015\ge2015\)
Dấu =xảy ra ⇔ \(\left\{{}\begin{matrix}x+\dfrac{1}{2}y-2=0\\\dfrac{1}{2}y-1=0\end{matrix}\right.\Rightarrow\left\{{}\begin{matrix}x=1\\y=2\end{matrix}\right.\)
Vậy \(P_{min}=2015\Leftrightarrow\left\{{}\begin{matrix}x=1\\y=2\end{matrix}\right.\)