Let $M \in \mathcal{S}_{n}(\mathbb{R})$, we denote by $m = s^{\downarrow}(M)$ its ordered spectrum, and $\left(v_{1}, \ldots, v_{n}\right)$ an orthonormal basis from the spectral resolution of $M$. Calculate
$$\sup_{\|x\|=1} \langle x, Mx \rangle$$
as a function of the coordinates of $m$. Is this supremum attained? (One may decompose $x$ and $Mx$ on the orthonormal basis $\left(v_{1}, \ldots, v_{n}\right)$ of question 2a).