Prove that $5x^2−2xy−8x+ 2y^2−2y+ 5 \ge 0$ for all $x, y\in\mathbb R$. When does equality occur? I tried grouping the $x$'s and the $y$'s but that didn't get me anywhere. I know that $5x^2, 2y^2$, and $5$ are always positive. I am not sure what to try next. 
 A: By inspection, equality occurs for $x=y=1$. 
So the obvious choice is to group around these values. This also gives a somewhat more detailed explanation how you arrive at these magic squares:
$$
5x^2−2xy−8x+ 2y^2−2y+ 5 = \\
5((x-1) +1)^2−2((x-1)+1)((y-1) + 1)−8(x-1)+ 2((y-1)+1)^2−2(y-1) -5\\
= 5(x-1)^2  - 2(x-1)(y-1)  +2(y-1)^2 =\\
= 4(x-1)^2  + ((x-1)-(y-1))^2  +(y-1)^2 = \\
= 4(x-1)^2  + (x-y)^2  +(y-1)^2 \\
\geq 0
$$
which is clear.
A: take the expression $$5x^{2}-2xy-8x+2y^{2}-2y+5$$ we want to write this as a sum of squares somehow. grouping the terms as:
$$(x^{2}-2xy+y^{2}) + (y^{2}-2y+1) + (4x^{2}-8x+4) $$
factoring the three expressions gives
$$(x-y)^{2} + (y-1)^{2} + 4(x-1)^{2}$$ which is the sum of squares, each of which is greater than $0$.
for equality to hold, notice that both $(y-1)^{2}$ and $4(x-1)^{2}$ have roots of 1 which means they will be zero at that value, and also notice that $(x-y)^{2}$ will be zero whenever $x=y$, this means that we should take $x=y=1$ for equality to hold
A: $5x^2-2xy-8x+2y^2-2y+5=x^2-2xy+y^2+4x^2-8x+4+y^2-2y+1=(x-y)^2+(2x-2)^2+(y-1)^2$
A: The LHS may be written as
$$4x^2−8x+4\; +\; x^2−2xy+y^2\; +\; y^2−2y+ 1$$
Do you see why this yields the "$\,\ge 0\,$" ?
And also the equality case?
A: We have: $5x^2 -2xy -8x +2y^2 -2y + 5=\frac{9}{2}(x-1)^2 +\frac{1}{2}(x-2y+1)^2\geqq 0$
Equality holds when $x =y = 1$
A: We have
$$5\,x^{\,2}- 2\,xy- 8\,x+ 2\,y^{\,2}- 2\,y+ 5= (\,1+ x- 2\,y\,)(\,5\,x+ 8\,y- 13\,)+ 18(\,y- 1\,)^{\,2}$$
$$9(\,5\,x^{\,2}- 2\,xy- 8\,x+ 2\,y^{\,2}- 2\,y+ 5\,)= -\,(\,1+ x- 2\,y\,)(\,5\,x+ 8\,y- 13\,)+ 2(\,5\,x- y- 4\,)^{\,2}$$
$$\therefore\,5\,x^{\,2}- 2\,xy- 8\,x+ 2\,y^{\,2}- 2\,y+ 5\geqq 0$$
Furthermore
$$\because\,{\rm discriminant}[\,5\,x^{\,2}- 2\,xy- 8\,x+ 2\,y^{\,2}- 2\,y+ 5,\,x\,]= -\,36(\,y- 1\,)^{\,2}\leqq 0$$
