Integration over n-sphere

627 Views Asked by At

I am trying to integrate squares of sum of coordinates in n-dimensional sphere with radius bounded by r.

$f(x,y)=x^2+y^2$. In spherical coordinates when $N=2,\;y=a\cos\theta$ and $x=a\sin\theta$

So my question becomes $$ \int_0^r \int (a\cos\theta + a\sin\theta)^2da\,d\theta\,. $$

$\theta$ between 0 and $2\pi$.

I calculated this analytically by using symmetries around $y=-x$ in $\mathbb R^2$ but if someone has a general formula for this particular integral in n dimension it would be a great help.

Thanks