TITLE: The smallest possible value of $x^2 + 4xy + 5y^2 - 4x - 6y + 7$
QUESTION [6 upvotes]: I have been trying to find the smallest possible value of 
$x^2 + 4xy + 5y^2 - 4x - 6y + 7$, but I do not seem to have been heading in any direction which is going to give me an answer I feel certain is correct.  Any hints on how to algebraically approach finding this value would be appreciated.  I prefer not to be told what the value is.

REPLY [10 votes]: $$x^2 + 4xy + 5y^2 -4x -6y + 7 = (x+2y-2)^2 + (y+1)^2 + 2$$

REPLY [5 votes]: Note that $x^2 + 4xy + 5y^2 - 4x - 6y + 7=(x+2y)^2+y^2-4x-6y+7$.
Let $u=x+2y$. Write our expression in terms of $u$ and $y$, and complete the squares.
Remark: The approach may have looked a little ad hoc, but the same basic idea will work for any quadratic polynomial $Q(x,y)$ that has a minimum or maximum. For quadratic polynomials $Q(x_1,x_2,\dots, x_n)$, one can do something similar, but it becomes useful to have more theory. You may want to look into the general diagonalization procedure.