Surface integral - spherical I'm trying to calculate the following surface integral $$\int \int_{s_r} \frac{z-R}{(x^2+y^2+(z-R)^2)^{3/2}} dS $$, where $s_r=\{(x,y,z)\in \mathbb{R}^3 : x^2+y^2+z^2=r^2 \}. $
I've switched to spherical coordinates but don't really know how to do it. 

The reason to use spherical coordinates is that the surface over which we integrate takes on a particularly simple form: instead of the surface $x^2+y^2+z^2=r^2$ in Cartesians, or $z^2+\rho^2=r^2$ in cylindricals, the sphere is simply the surface $r'=r$, where $r'$ is the variable spherical coordinate. This means that we can integrate directly using the two angular coordinates, rather than having to write one coordinate implicitly in terms of the others.

So in spherical coordinates, $dS = r^2 \sin{\theta} \, d\theta \, d\phi$. The integral becomes
$$ \int_{\theta=0}^{\pi} \int_{\phi=0}^{2\pi} \frac{r\cos{\theta}-R}{(r^2 -2 rR\cos{\theta + R^2})^{3/2}} r^2\sin{\theta} \, d\phi \, d\theta = r^2 \int_{\theta=0}^{\pi} \frac{r\cos{\theta}-R}{(r^2 -2 rR\cos{\theta + R^2})^{3/2}} \sin{\theta} \, d\theta. $$
Putting $u=\cos{\theta}$ gives
$$ \int_{-1}^1 \frac{u-(R/r)}{(1-2u(R/r)+(R/r)^2)^{3/2}} \, du $$
It makes sense to write $R/r=a$ at this point, so
$$ \int_{-1}^1 \frac{u-a}{(1-2ua+a^2)^{3/2}} \, du. $$
The easiest way to do this integral is by a sort of partial fractions idea: the integrand is
$$ \frac{u-a}{(1-2ua+a^2)^{3/2}} = \frac{1}{2a}\left(\frac{a^2-1}{(1-2ua+a^2)^{3/2}} - \frac{1}{(1-2ua+a^2)^{1/2}} \right), $$
which has either
$$ \frac{1-ua}{a^2(1-2ua+a^2)^{1/2}} \quad \text{or} \quad \frac{1-u/a}{a^2(1/a^2-2u/a+1)^{1/2}} $$
as continuous antiderivative, depending on whether $R$ is smaller or larger than $r$.
