Spivak's Calculus: Chapter 1, Problem 17c (Minimum value of expression) 17c) Find the smallest possible value of $x^2 + 4xy + 5y^2 - 4x - 6y + 7$
The context of this problem is that the previous two parts are solved by rewriting the given expressions such that you end up with squared parentheticals and then one constant value outside the parenthetical. Given that any squared real expression is $ \ge 0$, the constant is then by default the minimum possible value of the expression. However, after trying many different groupings and simplifications, I cannot figure out how to entirely confine the variable terms into squared expressions, and so every result I get is the combination of a constant term and a variable term.
Nothing in the text of the problems suggests that the answer to this question should be so different from the answer to the other two questions, so I think it's still asking for an isolated constant term. It's often the 4xy term that is proving difficult to deal with, it keeps popping up in my final results.
 A: Write this quadratic polynomial in two variables as a sum of squares of linear polynomials:
\begin{align}
x^2 + 4xy + 5y^2 - 4x - 6y + 7&= (x^2 + 4xy  - 4x) + (5y^2 - 6y + 7) \\
&= (x+2y-2)^2 -4y^2-4+8y + (5y^2 - 6y + 7) \\
&= (x+2y-2)^2+y^2+2y+3 \\
&= (x+2y-2)^2+(y+1)^2+2 
\end{align}
Thus the minimum of the expression is $2$,  attained when $y=-1$ and $x=2-2y=4$.
A: While factoring the expression directly isn’t very difficult in this case, you can also arrive at the solution entirely mechanically by diagonalizing the quadratic form via an algorithm related to Gaussian elimination, which you can find described here. Basically, one iteratively completes squares by applying the same elementary operations to both the rows and columns of the coefficient matrix.  
Starting with the augmented coefficient matrix (you can in fact omit the augmentation for this purpose, as will be explained below) $$\left[\begin{array}{ccc|ccc}1&2&-2 & 1&0&0 \\ 2&5&-3 & 0&1&0 \\ -2&-3&7 & 0&0&1 \end{array}\right]$$ subtract twice the first row/column from the second $$\left[\begin{array}{ccc|ccc}1&0&-2 & 1&0&0 \\ 0&1&1 & -2&1&0 \\ -2&1&7 & 0&0&1 \end{array}\right]$$ then add twice the first row/column to the third $$\left[\begin{array}{ccc|ccc}1&0&0 & 1&0&0 \\ 0&1&1 & -2&1&0 \\ 0&1&3 & 2&0&1 \end{array}\right]$$ and finally subtract the second row/column from the first to obtain $$\left[\begin{array}{ccc|ccc}1&0&0 & 1&0&0 \\ 0&1&0 & -2&1&0 \\ 0&0&2 & 4&-1&1 \end{array}\right].$$ The last diagonal element on the left side is the constant term that you seek.  
To obtain the actual diagonalized quadratic form, you’ll need the inverse of the matrix on the right side, which is $$\begin{bmatrix}1&0&0\\2&1&0\\-2&1&1\end{bmatrix},$$ but this is less work than it might seem at first glance because the entries below the main diagonal are precisely the coefficients, with signs inverted, from the elementary row/column operations that you used to diagonalize the quadratic form in the first place. Reading down each column and combining with the values from the computed diagonal matrix, we have $$x^2+4xy+5y^2-4x-6y+7 = (x+2y-2)^2+(y+1)^2+2.$$
