TITLE: Show convexity of the quadratic function
QUESTION [10 upvotes]: Given symmetric positive semidefinite matrix $A$, let
$$F(x) := x^TAx + b^Tx + c$$
Can someone show that $F$ is convex using the definition (without taking the gradient)?

REPLY [21 votes]: Just to leave the answer for the general case online for future reference.  A function is convex if $f(\lambda x + (1-\lambda) y) \leq \lambda f(x) + (1-\lambda) f(y)$ for all $\lambda\in[0,\;1]$.  
It suffices to show for a quadratic function $f(x) = x^TQx$.  Therefore using the definition of a convex function:
\begin{align}
(\lambda x + (1-\lambda) y)^TQ(\lambda x + (1-\lambda) y)\leq \lambda x^TQx + (1-\lambda)y^TQy
\end{align}
Equality holds for $\lambda = 0\;\text{or}\;1$.  Therefore consider $\lambda\in(0,1)$. The left hand side simplifies to:
\begin{align}
\lambda^2x^TQx + (1-\lambda)^2y^TQy + \lambda(1-\lambda)x^TQy + \lambda(1-\lambda)y^TQx\leq \lambda x^TQx + (1-\lambda)y^TQy
\end{align}
Rearranging the terms and simplifying one obtains:
\begin{align}
& \lambda(1-\lambda)x^TQx + \lambda(1-\lambda)y^TQy - \lambda(1-\lambda)x^TQy -\lambda(1-\lambda)y^TQx\geq 0 \\
& \Rightarrow x^TQx + y^TQy -x^TQy-y^TQx \geq 0 \\ 
& \Rightarrow (x-y)^TQ(x-y) \geq 0
\end{align}
which is true for positive semi-definite $Q\succeq 0$.