# Integral in n-dimensional spherical coordinates

I have to calculate the following integral:

$\int_{B_1(0)} \frac{1}{|x|^m} dx$

where $x \in \mathbb{R}^d$ and $B_1(0)$ is a $d$ dimensional ball around origin with radius equal to $1$.

I know I can use $\int_{R^d}f(x)dx=\int_{S^{d-1}}\left(\int_{0}^{\infty} f(r \gamma) r^{d-1} dr \right) d \sigma(\gamma)$, where $r=|x|$ and $\gamma=\frac{x}{|x|}$. But, I don't know how to apply it on my problem and obtain the results.

Not a very clever approach, but we can compute this integral using hyper-spherical coordinates. We use the coordinate system $r, \phi_1,...,\phi_{n-1}$ with $r > 0, \phi_{n-1} \in [0,2\pi)$ and $\phi_i \in [0, \pi]$ for all other $i$.

Then $$\int_{B_1} \frac{dx}{\|x \|^m} = \int_{0}^{1} \int_{0}^{\pi} \cdots \int_{0}^{2\pi} \left( \frac{1}{r^m} \right) (r^{n-1} \sin^{n-2}(\phi_1) \sin^{n-3}(\phi_2) \cdots \sin(\phi_{n-1})) \, dr\, d\phi_1 \, \cdots d \phi_{n-1}.$$ The second term is the Jacobian coming from the coordinate change. We see that this integral is almost just the integral of a volume of a ball. We transform coordinates so that it is in fact exactly this. If $n-1-m \neq -1$ we let $s = r^{n-m}/(n-m)$ so $ds = r^{n-m-1} dr$. If $n-1-m = -1$, then we let $s = \log r$.

Then in this coordinate system the integral is (when $n-m-1 \neq -1$)

$$\int_{0}^{1/(n-m)} \sin^{n-2}(\phi_1) \sin^{n-3}(\phi_2) \cdots \sin(\phi_{n-1})) \, ds\, d\phi_1 \, \cdots d \phi_{n-1}.$$ Which is precisely the volume of $B_{1/(n-m)}.$ This volume is known to be $$\frac{\pi^{\frac{n}{2}}}{\Gamma\left(\frac{n}{2}+1\right)}\left(\frac{1}{n-m}\right)^n.$$

Perhaps a more enlightened approach to this problem would be to realize that the integrand is radially symmetric, so it is constant on spherical shells about the origin. We may then express the integral as an integral in one variable - $r$ the radius of the shells (similar to how in a second semester of calculus one might calculate the volume of a surface of revolution with cylindrical shells). Each shell contributes the value of the function on that shell times the surface area of the shell. Then we should get that our integral is equal to $$\int_{0}^{1} r^{-m} S(r) \; dr,$$ where $S(r)$ is the surface area of the sphere of radius $r$.

I haven't checked this latter method, but I believe it agrees with the former one. Sorry if it doesn't work out.

Another way to solve this to use the alternate polar coordinates formula: $$\int_{B_r(x_0)} f(x) dx = \int_0^r \int_{\partial B_t(x_0)} f d \mathcal{H}^{n-1} dt.$$ (See Appendix C.3 in Partial Differential Equation by Lawrence C. Evans). Then \begin{align*} \int_{B_1 } \frac 1 {\vert x \vert ^m} d x &= \int_0^1 \int_{\partial B_t} \frac 1 {\vert x \vert^m } d \mathcal{H}^{n-1} d t. \end{align*} Since $$\vert x \vert = t$$ on $$\partial B_t$$ it follows this equals \begin{align*} \int_0^1 \frac 1 {t^m } \mathcal{H}^{n-1}(\partial B_t) d t. \end{align*} Using that $$\mathcal{H}^{n-1}(\partial B_t) = n \omega_n t^{n-1}$$ where $$\omega_n$$ is the volume of the unit ball in $$\mathbb{R}^n$$, we conclude \begin{align*} \int_{B_1 } \frac 1 {\vert x \vert ^m} d x &= n \omega_n \int_0^1 t^{n-m-1} d t\\ &= \begin{cases} \frac{n \omega_n}{n-m}, & \text{if } n >m \\ \text{undefined}, & \text{if } n \leqslant m. \end{cases} \end{align*}

Note that the integral is finite if and only if $$m < d$$. Then using spherical coordinates (in particular, the surface measure $$\mathrm d\sigma$$ on the sphere), \begin{align*} \int_{B_1(0)}\frac{1}{|x|^m}\,\mathrm{d}x &= \int_{S^{d-1}}\int_0^1\frac{1}{r^m}r^{d-1}\,\mathrm dr\,\mathrm d\sigma(\omega) \\ &= \sigma(S^{d-1})\int_0^1r^{d-1-m}\,\mathrm dr \\ &= \sigma(S^{d-1})\frac{1}{d-m}, \end{align*} where in the last line we used the fundamental theorem of calculus, and the fact that the integral converges since $$d-m-1>-1$$, and $$\sigma(S^{d-1})$$ is the surface area of the sphere of dimension $$d-1$$.