Calculation of triple integrals like $ \int_{V'} \frac{ \mathbf{r} - \mathbf{r'}}{\mid \mathbf{r} - \mathbf{r'} \mid ^3} dV' $, on spherical domain 
How could one solve integrals in the form:
  $$ I(\mathbf{r})= \int_{V'} \frac{ \mathbf{r} - \mathbf{r'}}{\mid \mathbf{r} - \mathbf{r'} \mid ^3} dV'  $$
  where the domain of integration is the sphere: 
  $$ x'^2+y'^2+z'^2 \leq R^2 ~?$$ 

I would change the integration variables from $ x' $ to $ x'' = x-x' $ (similarly for  $y $ and $z$), obtaining:
$$ I(\mathbf{r''})=\int_{V''} \frac{ \mathbf{r''}}{\mid \mathbf{r''} \mid ^3} dV'' $$  
where now the domain of integration is the sphere centered at $(x,y,z)$:
$$ V'' = \{(x'',y'',z'') \in R^3 : (x-x'')^2+(y-y'')^2+(z-z'')^2 \leq R^2 \} $$
and then using spherical coordinates $(r,\theta,\phi) $ such that $$ x''=r \text{cos}\theta \text{sin}\phi $$ $$ y''=r \text{sin}\theta \text{sin}\phi $$ $$ z''=r \text{cos}\phi $$
Obtaining, considering for example the first component of $ I$:
$$ I_1(\mathbf{r''})= \int\int\int \frac{ r\text{cos}\theta \text{sin}\phi}{r^3}r^2 \text{sin}\phi dr d\theta d\phi= \int\int\int \text{cos}\theta \text{sin}^2\phi dr d\theta d\phi  $$
At this point my problem here is to find the integration intervals for the varibles $(r,\theta,\phi) $; i.e. the description of the domain of integration $V''$ in spherical coordinates.
These kind of integrals arises for example in electrostatic when one has to compute the electric field produced by a uniformly charged sphere centered at the origin. There one would use Gauss' law, but how the integral itself could be calculated?
 A: Hint:
Let $\mathbf r=(0,0,a)$ with $a>0$.
The z-component of the integral is given by$$\iiint\limits_{V'} \frac {a-z'}{[x'^2+y'^2+(a-z')^2]^{3/2}} \,dx'dy'dz'=$$$$\int_0^R\int_0^{2\pi}\int_0^\pi \frac {\rho^2(a-\rho\cos\phi)\sin\phi}{(\rho^2+a^2-2a\rho\cos\phi)^{3/2}} \,d\phi \,d\theta \,d\rho$$ Now use $$\rho^2+a^2-2a\rho\cos\phi=t^2$$ to find $$\int_0^\pi \frac {(a-\rho\cos\phi)\sin\phi}{(\rho^2+a^2-2a\rho\cos\phi)^{3/2}} \,d\phi=$$$$\frac 1{2a^2\rho} \int _{|\rho-a|}^{\rho+a}\left [1-\frac {\rho^2-a^2}{t^2} \right]\, dt=$$$$\frac 1{2a^2\rho} \left(2\rho-\frac {\rho^2-a^2}{|\rho-a|}-|\rho-a| \right)=\begin {cases} 0\qquad \text{if}\quad a<\rho\\ \\\dfrac 2{a^2}\quad\; \text{if}\quad a>\rho \end {cases}$$ so $$\iiint\limits_{V'} \frac {a-z'}{[x'^2+y'^2+(a-z')^2]^{3/2}} \,dx'dy'dz'=\begin {cases} \dfrac 43\pi a^3\, \cdot \dfrac 1{a^2}\quad\; \text{if}\quad a<R\\ \\\dfrac 43\pi R^3 \cdot \dfrac 1{a^2}\quad\, \text{if}\quad a>R \end {cases}$$ The x- and y-components are zero because the integrand has odd simmetry respectively over the yz-plane and the xz-plane and $V'$ is symmetric over those planes.
