<s>[INST] Find the smallest possible value for $x^2-3x+2y^2+4y+2$ Find the smallest possible value for $x^2-3x+2y^2+4y+2$.
I know this: $x^2-3x+2y^2+4y+2=(x-\frac{3}{2})^2+2(y+1)^2-\frac{9}{4}$ so the smallest value is $-\frac{9}{4}$.
Now we also know this: $x^2-3x+2y^2+4y+2=(x-1)^2-1-x+2(y+1)^2=(*)(x-1)^2+2(y+1)^2-(1+x)$
My question is: why we cannot say that the smallest value possible is $-(1+x)$ when $(x-1)^2=0$ (i.e. when $x=1$) and $(y+1)^2=0$, and because $x=1$ so the smallest value is $-2$?
 [/INST] If you (think you) have completed the square, but your left-over term isn't a constant, then you haven't completed the square.
The fact that $x=1$ minimises the expression $(x-1)^2$ has nothing to do with minimising $g_1(x) = (x-1)^2 + 3x\ $ or $\ g_2(x) =(x-1)^2 - 26x^3 + 45,\ $ or $\ g_3(x) =(x-1)^2 + f(x),\ $ unless $f(x)$ is a constant.
If $f(x)$ is a constant, for example, $\ g_3(x) = (x-1)^2 + 24,\ $ then $x=1$ minimises $\ g_3(x)\ $; the reason being that $\ \min \{ u^2: u\in\mathbb{R} \} = 0.\quad g_3(x)$ attains this minimum when $x=1.$
This reasoning goes out the window for $g_1(x), $ because $g_1(x) = (x+1/2)^2 + 3/4,$ and so the minimum of $\ g_1(x)\ $ is $\ 3/4\ $ occurs when $x=-1/2.$
</s>