This is a study question.
Let $q(x)=\sum_{i<j}(x_i-x_j)^2$ be a quadratic form over $R^n$. Find the inertia of $q(x)$.
I have tried to expand the sum and represent $q(x)$ as a matrix, however I am left then with trying to calculate the determinant of a matrix of size $n\times n$.
What is the correct way to begin solving this problem? A hint would be great!
The result I have indicated you, more precisely the answer by RicLouRiv
$$Q(x_1,\ldots,x_n) = \sum_{r < s} (x_r - x_s)^2$$
$$=(n-1)y_1^2+(n-2)y_2^2+\cdots + 1 \cdot y_{n-1}^2 + 0\cdot y_n^2$$
where
$$y_k := \sqrt{\frac{n}{n-k+1}}\left(x_k - \frac{x_{k+1}+\cdots+x_n}{n-k}\right)$$
can receive a nice statistical interpretation as the progressive knowledge on the global mean computed on known samples $x_n, x_{n-1}, ... x_{k+1}$ while new data $x_k$ upcomes (I am obliged to work backwards to preserve the notations as they are). See https://www.sciencedirect.com/science/article/pii/0021999188901830