# Integral around unit sphere of inner product

For arbitrary $n\times n$ matrices M, I am trying to solve the integral

$$\int_{\|v\| = 1} v^T M v.$$

Solving this integral in a few low dimensions (by passing to spherical coordinates) suggests the answer in general to be $$\frac{A\,\mathrm{tr}(M)}{n}$$ where $A$ is the surface area of the $(n-1)$-dimensional sphere. Is there a nice, coordinate-free approach to proving this formula?

-
I would try proving this for diagonal matrices and arguing that the integral doesn't change when you replace $M$ by $PMP^{-1}$. – Grumpy Parsnip Sep 6 '11 at 17:57
@Jim: It says "arbitrary", not just diagonalizable. – joriki Sep 6 '11 at 17:57
@Joriki: that's true. At least that would prove a special case. :) – Grumpy Parsnip Sep 6 '11 at 18:00
@Jim: Thanks! That definitely seems like the right track (though I think the integral only doesn't change when $P$ is orthogonal, i.e. when $M$ is symmetric) – user7530 Sep 6 '11 at 18:05
Of course Jim's comment also leads to a slightly more heavy-handed answer by replacing the integral with $\frac{1}{n}\int_{SO(n)} \mathrm{tr}(OMO^{-1})$. – Willie Wong Sep 6 '11 at 18:09

The integral is linear in $M$, so we only have to calculate it for canonical matrices $A_{kl}$ spanning the space of matrices, with $(A_{kl})_{ij}=\delta_{ik}\delta_{jl}$. The integral vanishes by symmetry for $k\neq l$, since for every point on the sphere with coordinates $x_k$ and $x_l$ there's one with $x_k$ and $-x_l$.

So we only have to calculate the integral for $k=l$. By symmetry, this is independent of $k$, so it's just $1/n$ of the integral for $M$ the identity. But that's just the integral over $1$, which is the surface area $A$ of the sphere.

Then by linearity the integral for arbitrary $M$ is the sum of the diagonal elements, i.e. the trace, times the coefficient $A/n$.

-
@Willie Indeed there is. Corrected, thanks. – user7530 Sep 6 '11 at 18:09
Very nice. $\,\,\,$ – Grumpy Parsnip Sep 6 '11 at 18:09

As a function of $M$ your integral is linear, and is invariant under conjugation by orthogonal transformations ($C_R: M \mapsto R^{T} M R$). Now the average of $C_R(M)$ over all orthogonal transformations $R$ (using Haar measure) is $\text{Tr}(M) I/n$ (it must be invariant under all $C_R$ so it is a multiple of $I$, and the trace is preserved). So the integral is the same as it would be for $\text{Tr}(M)I/n$, which is $\text{Tr}(M)/n$ times the area of the sphere.

-