Average value of a bilinear map on a Euclidean sphere Let $(V, g = \langle \cdot, \cdot \rangle)$ be a Euclidean vector space and let $B \colon V \times V \to \mathbb{R}$ be a symmetric bilinear form. Denote by $S_r = S(0,r)$ the sphere centered at the origin in $V$ with radius $r > 0$, $\sigma_r$ the volume element on $S_r$ induced from the metric $g$ and $\operatorname{vol}(S_r) = \int_{S_r} \sigma_r$ its volume. How can one prove that: \begin{equation}
 \frac{1}{\operatorname{vol}(S_r)}\int_{S_r} B(x, x) \, \sigma_r = \frac{r^2}{\dim V}\operatorname{tr}_g(B)~.
\end{equation}
Here we have denoted by $\operatorname{tr}_g(B)$ the $g$-trace of $B$, i.e. the trace of the $g$-self adjoint endomorphism of $V$ associated to $B$. It is also equal to the 
trace of the matrix representing $B$ in a $g$-orthonormal basis.
 A: I figured it out, here goes:
Let $(e_1,  \dots, e_n)$ be basis of $V$ which is $g$-orthonormal and $B$-orthogonal (the existence of such a basis is precisely the spectral theorem).
Let $\lambda_k =  B(e_k, e_k)$ for $k \in \{1, \dots n\}$. For any vector $x = \sum_{k=1}^n x_k e_k$, the squared norm of $x$ is $g(x,x) = \sum_{k=1}^n {x_k}^2$ and the quadratic form is given by $B(x,x) = \sum_{k=1}^n \lambda_k {x_k}^2$. Therefore:
\begin{equation}
 \int_{S_r} B(x, x) \sigma_r = \sum_{k=1}^n \lambda_k \int_{S_r} {x_k}^2  \sigma_r~.
\end{equation}
It remains to compute the integrals $I_k = \int_{S_r} {x_k}^2 \sigma_r$. This can be done swiftly using a little trick, starting with the observation that any two of these integrals are equal. Indeed, for any $k \neq l$, one can easily find an isometry $\varphi \in O(g)$ such that ${x_k}^2 \circ \varphi = {x_l}^2$ (namely, the orthogonal reflection through the line spanned by $e_k + e_l$). Since $\varphi$ preserves $\sigma_r$, the change of variables theorem ensures that $I_k = I_l$.
Since all the integrals $I_k$ are equal, one can write $I_k = \frac{1}{n} \sum_{l=1}^n I_l$ for any $k$. That is $I_k = \frac{1}{n}\int_{S_r} \left(\sum_{k=1}^n {x_k}^2\right) \sigma_r$. However $\sum_{k=1}^n {x_k}^2 = g(x,x) = r^2$ for any $x \in S_r$. This yields $I_k = \frac{1}{n}\int_{S_r} r^2 \sigma_r = \frac{r^2}{n} \operatorname{vol}(S_r)$.
Coming back to the initial integral, we obtain the desired result:
\begin{equation}
 \int_{S_r} B(x, x) \sigma_r = \frac{r^2}{n} \operatorname{vol}(S_r) \sum_{k=1}^n \lambda_k = \frac{r^2}{n} \operatorname{vol}(S_r) \operatorname{tr}_g (B)~.
\end{equation}
A: I know this is an old question with a satisfactory answer, but this question came up for me recently, and I thought I'd provide a different approach which requires less of a brute force computation. Perhaps some will find it more illuminating.
Let $L = L(V,V)$ denote the space of linear maps $V \to V$. If $B$ is your quadratic form, let $A = B^\sharp \in L$ be the map defined by $g(Ax,y) = B(x,y)$ for all $x,y \in V$, and if $x \in V$, let $x^\flat \in V^\ast$ be defined by $x^\flat(y) = g(x,y)$.  Consider the functional $T \in L^\ast$ defined by $$T(A) = \frac{1}{\text{vol}(S_r)}\int_{S_r} x^\flat(Ax) \sigma_r$$ for $A \in L$. We want to show that $T(A) = \frac{r^2}{\text{dim} V}\text{Tr}(A)$, where now the trace of $A$ is canonically defined and is equal to $\text{tr}_g(B)$.
Recall that the bilinear map $L \times L \to \mathbb R$ defined by $\langle A_1,A_2\rangle = \text{Tr}(A_1^\ast A_2)$, where $A_1^\ast$ is the $g$-adjoint of $A_1$, defines an inner product on $L$. So, by the Riesz representation theorem, there is $C \in L$ for which $T(A) = \text{Tr}(C^\ast A)$ for all $A \in L$. For $\phi \in O(g)$, $\phi:S_r \to S_r$ is an isometry, and so changing variables $x' = \phi(x)$, it is clear that for all $A \in L$.
$$T(\phi^\ast A \phi) = \frac{1}{\text{vol}(S_r)}\int_{S_r} (\phi x)^\flat(A \phi x) \sigma_r = \frac{1}{\text{vol}(S_r)}\int_{S_r} (x')^\flat(A x') \sigma_r = T(A).$$
Thus $\text{Tr}(C^\ast A) = \text{Tr}(C^\ast \phi^\ast A \phi) = \text{Tr}(\phi C^\ast \phi^\ast A) = \text{Tr}((\phi C \phi^{-1})^\ast A)$ for all $A \in L$. Thus, $\phi C \phi^{-1} = C$. In other words, $\phi$ commutes with $C$. Since this is true for any $\phi \in O(g)$, it follows that $C = c\text{Id}$, for some $c \in \mathbb R$. To find this $c$, we plug in $$c\text{dim} V = c\text{Tr}(\text{Id}^\ast \text{Id}) = T(\text{Id}) = \frac{1}{\text{vol}(S_r)}\int_{S_r} g(x,x) \sigma_r = r^2.$$ Thus $c = \frac{r^2}{\text{dim} V}$ and so $T(A) = \frac{r^2}{\text{dim} V}\text{Tr}(A)$, as desired.
