\(x^2+2y^2+2xy-2x-6y+5=0\)
\(\Leftrightarrow\left(x^2+2xy+y^2\right)-\left(2x+2y\right)+1+\left(y^2-4y+4\right)=0\)
\(\Leftrightarrow\left(x+y\right)^2-2\left(x+y\right)+1+\left(y-2\right)^2=0\)
\(\Leftrightarrow\left(x+y-1\right)^2+\left(y-2\right)^2\ge0\forall x,y\)
Đẳng thức xảy ra khi \(\left\{{}\begin{matrix}\left(x+y-1\right)^2=0\\\left(y-2\right)^2=0\end{matrix}\right.\)\(\Rightarrow\left\{{}\begin{matrix}x=-1\\y=2\end{matrix}\right.\)
Khi đó \(P=\dfrac{\left(-1\right)^2-7\cdot\left(-1\right)\cdot2+51}{-1-2}=-22\)