Solution (source code)

= Solution

Take <spherical polar coordinates> with polar <angle> $\theta$ measured from positive $z$ and <azimuthal angle> $\phi$:
$$
x=r\sin\theta\cos\phi,\qquad y=r\sin\theta\sin\phi,\qquad z=r\cos\theta.
$$
The derivative <matrix> is
$$
\frac{\partial(x,y,z)}{\partial(r,\theta,\phi)}
=\begin{pmatrix}
\sin\theta\cos\phi&r\cos\theta\cos\phi&-r\sin\theta\sin\phi\\
\sin\theta\sin\phi&r\cos\theta\sin\phi&r\sin\theta\cos\phi\\
\cos\theta&-r\sin\theta&0
\end{pmatrix}.
$$
Expanding its <determinant> gives $r^2\sin\theta$. Thus
$$
\boxed{dV=r^2\sin\theta\,dr\,d\theta\,d\phi,\qquad
\det\frac{\partial(r,\theta,\phi)}{\partial(x,y,z)}=\frac1{r^2\sin\theta}.}
$$
The inverse formula holds where $r>0$ and $0<\theta<\pi$; it excludes the origin and polar axis. These formulas use the general <chain rule> and determinant construction in <10/a/i/solution>.