A quadratic function of the form function $ f:\mathbb{R}^n\rightarrow \mathbb{R} $ , given by $ f(x)=(1/2)x^T P x + q^T x + r$, where $P\succeq 0$ and $x, q \in \mathbb{R}^n$ and $r \in\mathbb{R}$. How can I demonstrate that it is convex using first-order conditions?
My attempt:
In S.Boyd's lecture:
- First-order: f is convex if $f(y)\geq f(x)+\nabla f(x)^T(y-x)$
Then,
$$ f(y)\geq (1/2)x^T P x + q^T x + r+ (Px+q)^T(y-x) $$
How do I simplify? Does anyone have any ideas?
\begin{align} f(y) - f(x) - \nabla f(x)(y-x) &= \frac12 y^TPy + q^Ty + r - \left(\frac12 x^TPx + q^Tx + r\right) - \left(Px + q\right)^T(y-x)\\ &= \frac12y^TPy + q^Ty + r - \frac12x^TPx - q^Tx - r - x^TPy + x^TPx - q^Ty + q^Tx\\ &= \frac12\left(y^TPy - 2x^TPy + x^TPx\right)\\ &= \frac12 (y-x)^TP(y-x)\ge 0 \end{align}