TITLE: How to show that $y^T x - \frac{1}{2}x^T Q x$ is bounded above?
QUESTION [5 upvotes]: Strictly convex quadric function. Consider $f(x)=\frac{1}{2}x^TQx$, With $Q\in S_{++}^n$. The function $y^T x - \frac{1}{2}x^T Q x$ is bounded above as a function of $x$ for all $y$. It attaints its maximum at $x=Q^{-1}y$.
This is an example from my book, But I dont understand it well. I dont see how $y^T x - \frac{1}{2}x^T Q x$ is bounded and how to find its maximum.

REPLY [3 votes]: We can complete the square.  We want to write $F(x) = \frac12 x^T Q x - y^T x$ in the form
\begin{align}
\frac12 (x - x_0)^T Q (x - x_0) + c &=
\frac12 x^T Q x - x^T Q x_0 + \frac12 x_0^T Q x_0 + c.
\end{align}
To make things match up, we should pick $x_0$ such that $Q x_0 = y
\iff x_0 = Q^{-1} y$, and we should pick
\begin{align}
c &= - \frac12 x_0^T Q x_0 \\
&= -\frac12 y^T Q^{-1} y.
\end{align}
We have discovered that
\begin{align}
\frac12 x^T Q x - y^T x &=
\underbrace{(x - Q^{-1} y)^T Q (x - Q^{-1}y)}_{\text{nonnegative}} -\frac12 y^T Q^{-1} y.
\end{align}
This shows that $F$ is bounded below, and that it attains a minimum at
$x = Q^{-1}y$.
(Note that minimizing $F$ is equivalent to solving $Qx = y$.  That's a very useful fact.)