Let $g = (g_1, ..., g_n)$ be a random vector distributed uniformly on the sphere $\{ x \in \mathbb{R}^n : \| x \|_2 = 1 \}$. Let $A, B$ be two symmetric $n \times n$ matrices.
I am interested in a simple formula for: $$\mathbb{E}[ g^T A g g^T B g ]$$
In particular, I know that if $g$ is a standard normal $N(0, I)$, then $$ \mathbb{E}[ g^T A g g^T B g ] = 2 \mathrm{Tr}(AB) + \mathrm{Tr}(A)\mathrm{Tr}(B) \:. $$
Does something similar hold in the uniform on a sphere case?
It turns out the answer is:
$$ \mathbb{E}[g^T A g g^T B g] = \frac{1}{n(n+2)} (2 \mathrm{Tr}(AB) + \mathrm{Tr}(A) \mathrm{Tr}(B)) \:. $$
This comes from the Theorem in Section 3 of D. P. Wiens, "On Moments of Quadratic Forms in Non-Spherically Distributed Variables" (https://pdfs.semanticscholar.org/f9e3/9424ff32aec189b441dd189b6f819764de6b.pdf). It is straightforward to check that the conditions (1.1) hold for the uniform distribution over the sphere.
To apply the result, you need to compute $\mathbb{E}[g_1^2 g_2^2]$. It turns out this is equal to $\frac{1}{n(n+2)}$. Here is a simple way to compute this by symmetry. Observe that:
$$ g_1^2 g_2^2 = (1 - g_2^2 - ... - g_n^2) g_2^2 = g_2^2 - g_2^4 - g_3^2 g_2^2 - ... - g_n^2 g_2^2 \:. $$ Let $\mu = \mathbb{E}[g_1^2 g_2^2]$. By symmetry, $\mu = \mathbb{E}[g_i^2 g_j^2]$ for any $i \neq j$. Hence taking expectations, $$ \mu = \mathbb{E}[g_2^2] - \mathbb{E}[g_2^4] - (n-2) \mu \:. $$ Rearrange to obtain: $$ \mu = \frac{1}{n-1}\left( \mathbb{E}[g_2^2] - \mathbb{E}[g_2^4] \right) \:. $$ We can compute $\mathbb{E}[g_2^2] = 1/n$ by a similar symmetry argument. Furthermore, since $g_2^2 \stackrel{d}{=} \mathrm{Beta}(1/2, (n-1)/2)$, we can compute $\mathbb{E}[g_2^4]$ by looking up the formula of the second moment of a Beta distribution, which gives us $\mathbb{E}[g_2^4] = \frac{3}{n(n+2)}$. Hence, $$ \mu = \frac{1}{n-1}\left( \frac{1}{n} - \frac{3}{n(n+2)} \right) = \frac{1}{n(n+2)} \:. $$