Suppose that $S_A \subset \mathbb{R}^n$ denotes an ellipsoid centered at the origin,
\begin{align} S_A= \{ x \in \mathbb{R}^n : x^T A x \le 1 \} , \end{align}
where matrix $A$ is symmetric and positive definite.
Let matrix $B$ be positive definite. Can the following integral be calculated in closed form?
\begin{align} \int_{S_A} x^T B x \, dx \end{align}
I understand we have to switch to spherical coordinates here, but there a few details that are not clear to me. For example, how to change the coordinates in this case.
Hint:
By diagonalizing $A$ and scaling the Eigen axis, you can turn the domain to a unit sphere. At the same time, let $B$ follow these linear transformations. The Jacobian is just the volume of the ellipsoid $A$.
Now to integrate $x^TB'x$ in spherical coordinates, you can integrate separately the monomials such as $x_1^2$ and $x_1x_2$. By symmetry, it suffices to consider two coordinates.