Convexity of the set $C = \{x \in \Bbb R^n \mid x^T Ax \leq b\}$ where $A \in S^n$, $A \succeq 0$ and $b \geq 0$ I have this question in my homework and neither I nor my colleagues can solve it. 


  Show that the set $$C = \{x \in \Bbb R^n \mid x^T Ax \leq b\}$$ where $A$ is symmetric and positive semidefinite and $b \geq 0$, is convex.


I personally find it similar to halfspace and was thinking that maybe somehow proving that this is a halfspace we can prove that it is convex too. Do you have any ideas?
The function $x \mapsto x^TAx$ is convex. Indeed, the Hessian of this function is $A \succeq 0$. $C$ is just a sublevel set of this function.
Let $r := \mbox{rank} (\mathrm A)$. Since $\mathrm A$ is symmetric and positive semidefinite, there is a matrix $\mathrm Q \in \mathbb R^{r \times n}$ such that $\rm A = Q^\top Q$. Hence,
$$b - \mathrm x^\top \mathrm A \,\mathrm x = b - \mathrm x^\top \mathrm Q^\top \mathrm Q \,\mathrm x \geq 0$$
Using the Schur complement, we obtain the following linear matrix inequality (LMI) in $\mathrm x \in \mathbb R^n$
$$\begin{bmatrix} \mathrm I_r &amp; \mathrm Q \,\mathrm x\\ \mathrm x^\top \mathrm Q^\top &amp; b\end{bmatrix} \succeq \mathrm O_{r+1}$$
Hence, the set is a spectrahedron and, thus, convex.

convex-analysis schur-complement linear-matrix-inequality spectrahedra