One way of proving Newton's theorem on the potential of a spherically symmetric measure (see below) is to evaluate the integral $$ \int_0^{\pi} \frac{\sin^{n-2}{\theta}}{(1+r^2 - 2r \cos{\theta} )^{(n-2)/2}} \, d\theta = \frac{\sqrt{\pi} \Gamma((n-1)/2)}{\Gamma(n/2)} (\max{(1,r)})^{2-n}. \tag{1}$$ In what ways can one prove this for general $n \neq 2$? (Integer $n$ is obviously the interesting case.) I'm looking in particular for some more elementary ways of doing it (I've added a couple of rather high-powered ways below), but otherwise, anything goes: complex analysis, Fourier transforms, whatever.
(The case $n=2$ is much easier, and has been answered before on this site.)
It is clear that for $r>1$, we can take out a factor of $r^{2-n}$, reducing to the $r<1$ case ($r=1$ is easy: just apply double-angle formulae and the definition of the beta function).
(The following is the context from which the above arises.)
Let $\mu(x)$ be a measure on $\mathbb{R}^n$. The Coulomb potential of $\mu$, $D(\mu)(x)$, is defined as $$ D(\mu)(x) = \int_{\mathbb{R}^n} G_n(x-y) \, d\mu(y), $$ where $G_n$ is the fundamental solution of Laplace's equation in $\mathbb{R}^n$, $$ G_n(x) = \begin{cases} \frac{1}{(n-2)S_{n-1}} \lvert x \rvert^{2-n} & n \neq 2 \\ \frac{1}{2\pi} \log{\lvert x \rvert} & n=2 \end{cases}, $$ $S_{n-1}$ the surface area of the $(n-1)$-dimensional sphere. (The point being of course that $-\Delta D(\mu) = \mu $.)
Newton's theorem states that for a spherically symmetric measure $\mu$, the Coulomb potential satisfies $$ D(\mu)(x) = G_n(x) \int_{|y|\leqslant |x|} d\mu(y) + \int_{|y|>|x|} G_n(y) \, d\mu(y) $$ (see, for example, Lieb and Seiringer, The Stability of Matter in Quantum Mechanics, p.91f.) (We assume that all the appropriate integrals converge.)
Now, one way of proving this (indeed, probably the simplest way) is to turn the integral into spherical coordinates and do the integrals over spheres. It is easy to see that $\lvert x-y \rvert = \sqrt{\lvert x \rvert^2 + \lvert y \rvert^2 - 2\lvert x \rvert \lvert y \rvert \cos{\theta} }$, $\theta$ the angle between $x$ and $y$. Choosing the right spherical coordinates eventually gives us the integral $$ S_{n-2}\int_0^{\pi} \frac{\sin^{n-2}{\theta}}{(\lvert x \rvert^2 + \lvert y \rvert^2 - 2\lvert x \rvert \lvert y \rvert \cos{\theta} )^{(n-2)/2}} \, d\theta, $$ for $n \neq 2$, which we need to show is equal to $$ S_{n-1} \max{(\lvert x\rvert ,\lvert y\rvert )})^{2-n}, $$ and reducing further leads to (1).