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. 
 A: 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$.
A: $\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\left.\iint_{\Large s_{r}}{z - R \over
\bracks{x^{2} + y^{2} + \pars{z - R}^{2}}^{3/2}}\,\dd S\,
\right\vert_{\substack{x^{2} + y^{2} + z^{2}\ =\ r^{2}
                       \\[1mm]
                       z\ =\ r\cos\pars{\theta}}}
\\[5mm] = &\
\partiald{}{R}\int_{0}^{2\pi}\int_{0}^{\pi}{1 \over
\root{r^{2} -2rR\cos\pars{\theta} + R^{2}}}\,r^{2}\sin\pars{\theta}\,\dd\theta
\,\dd\phi
\\[5mm] & \stackrel{\xi\ =\ \cos\pars{\theta}}{=}\,\,\,
\left.2\pi r^{2}\,\partiald{}{R}\int_{-1}^{1}
{\dd\xi \over \root{r^{2} -2rR\xi + R^{2}}} =
2\pi r^{2}\,\partiald{}{R}{\root{r^{2} -2rR\xi + R^{2}} \over -rR}
\,\right\vert_{\ \xi\ =\ -1}^{\ \xi\ =\ 1}
\\[5mm] = &\
-2\pi r\,\partiald{}{R}
{\root{r^{2} - 2rR + R^{2}} - \root{r^{2} + 2rR + R^{2}} \over R} =
-2\pi r\,\partiald{}{R}
{\verts{r -R} - \pars{r + R} \over R}
\\[5mm] = &\
\bbox[#ffe,25px,border:1px dotted navy]{\left\{\begin{array}{lcl}
\ds{\phantom{-\,}0} & \mbox{if} & \ds{R < r}
\\[2mm]
\ds{-\,{4\pi r^{2} \over R^{2}}} & \mbox{if} & \ds{R > r}
\end{array}\right.}
\end{align}
A: Use parametric representation to solve the surface integral 
\begin{array}{l}
x = r\sin \phi \cos \theta \\
y = r\sin \phi \sin \theta \\
z = r\cos \phi 
\end{array}
Where, 
$$0 \le \phi  \le \pi ,\,\,\,0 \le \theta  \le 2\pi $$
That is,
$${\rm{r}}\left( {\phi ,\theta } \right) = r\sin \phi \cos \theta \widehat i + r\sin \phi \sin \theta \widehat j + r\cos \phi \widehat k$$
Compute the cross product of the Tangent Vectors 
$${T_\phi } \times {T_\theta } = \left| {\matrix{
   {\widehat i} & {\widehat j} & {\widehat k}  \cr 
   {{{\partial x} \over {\partial \phi }}} & {{{\partial y} \over {\partial \phi }}} & {{{\partial z} \over {\partial \phi }}}  \cr 
   {{{\partial x} \over {\partial \theta }}} & {{{\partial y} \over {\partial \theta }}} & {{{\partial z} \over {\partial \theta }}}  \cr 
 } } \right|$$
This will give,
$$\left| {{T_\phi } \times {T_\theta }} \right| = {r^2}\sin \phi $$

Now Calculate the integral, 
$$\displaylines{
  \int\!\!\!\int_{{s_r}} {{{z - R} \over {{{({x^2} + {y^2} + {{(z - R)}^2})}^{3/2}}}}dS}  \cr 
   = \int\!\!\!\int_D {\left( {{{r\cos \phi  - R} \over {{{({{\left( {r\sin \phi \cos \theta } \right)}^2} + {{\left( {r\sin \phi \sin \theta } \right)}^2} + {{(r\cos \phi  - R)}^2})}^{3/2}}}}} \right)\left| {{T_\phi } \times {T_\theta }} \right|dA}  \cr 
   = \int\!\!\!\int_D {\left( {{{r\cos \phi  - R} \over {{{\left( {{r^2} + {R^2} - 2rR\cos \phi } \right)}^{3/2}}}}} \right)\left( {r^2\sin \phi } \right)dA}  \cr 
   = \int\limits_0^{2\pi } {\int\limits_0^\pi  {\left( {{{r\cos \phi  - R} \over {{{\left( {{r^2} + {R^2} - 2rR\cos \phi } \right)}^{3/2}}}}} \right)\left( {r^2\sin \phi } \right)d\phi d\theta } }  \cr} $$
solve this integral.
