Solution (source code)

= Solution

For coordinates $x=x(q)$, the Jacobian is $J_{ij}=\partial x_i/\partial q_j$. Expanding after separating $x_1=r\cos\theta_1$ from the remaining coordinates gives
$$
|J_n|=r\sin^{n-2}\theta_1\,|J_{n-1}|.
$$
Consequently
$$
dV=r^{n-1}\prod_{j=1}^{n-2}\sin^{n-1-j}\theta_j\,dr\,d\theta_1\cdots d\theta_{n-2}\,d\phi,
$$
and on $r=R$ the surface element is obtained by omitting $dr$ and replacing $r$ by $R$.