integration over a ball I try to compute the value of the following integral:
Let $V=B_R(0)\subset \mathbb{R}^3$ be the Ball with radius $R$ around zero. How can I compute
\[\int_V \frac{1}{\left|\vec{x}-\vec{y}\right|}d^3y.\]
First I substitute $z:=y-x$. Then I get the integral:
\[\int_{V+z} \frac{1}{\left|\vec{z}\right|}d^3z\]
 Then I introduce spherical coordinates and I get:
\[\int_{} \sin^2(\theta) \;d\theta \,dr\,d\phi.\]
I can evaluate the integral,
But I don't know how the integration area is changed by the transformation into spherical coordinates. Can you help me?
Regards
 A: Basically, you are integrating a radially simmetric function over a ball. In general, in $B \subset \mathbb{R}^n$ is the unit ball and $f=f(r)=f(|x|)$, then $$\int_B f \, d \mathcal{L}=|S^{n-1}| \int_0^1 f(r) r^{n-1}\, dr$$ where $|S^{n-1}|$ is the surface of the sphere $S^{n-1}$. In dimension $n=3$, the surface of $S^2$ is...
A: The value of the integral only depends on the distance $a:=|{\bf x}|\geq0$. Therefore you may assume ${\bf x}=(0,0,a)$ and introduce spherical coordinates. One has
$$|{\bf y}-{\bf x}|=\sqrt{(r\sin\theta -a)^2+r^2\cos^2\theta}=\sqrt{a^2+r^2-2ar\sin\theta}\ ,$$  $${\rm d}(x,y,z)=r^2\cos\theta\ {\rm d}(r,\phi,\theta)\ ,$$
and the integrand is independent of $\phi$. Therefore the quantity $Q$ to be computed is given by the double integral
$$Q=2\pi\int_0^R\int_{-\pi/2}^{\pi/2}r^2{\cos\theta\over\sqrt{a^2+r^2-2ar\sin\theta}}\ d\theta\ dr\ .$$
For the inner integral substitute $\ \sin\theta:= t$ $\ (-1\leq t\leq1)$; when dealing with the outer integral you may have to distinguish the cases $a<R$ and $a>R$.
A: The value of this integral depends on whether or not $x$ is in $B_R(0)$. In general, you can think of this as the potential from a charged ball.
Note that your function is the Green's function for the 3D Laplace equation. You can now write the solution $\phi(x)$: 
$$\nabla^2\phi(\vec{x})=-\rho(\vec{x})$$
Where $\rho(x)$ is $1$ inside $B_R(0)$, and $0$ elsewhere.
Use the Laplace Operator in spherical coordinates to separate the equation.
A: In physics (molecular theory of liquids), the following integral sometimes appears (and don't have proper reference at hand, only a spanish textbook) :
$$I(s) = \int_{V_R} f_1(r_1) f_2(r_2) d{\bf x}$$
where $V_R$ is a ball of radius $R$ (usually $R=\infty$), $r_1=|\bf{x}|$, $r_2=|{\bf x}-{\bf s}|$ and  $s=|{\bf s}|$; WLOG, let ${\bf s}=(0,0,s)$ Changing first to polar coordinates ($x =r_1 \sin \theta \cos \phi$, $y =r_1 \sin \theta \sin \phi$ , $z=r_1 \cos \theta$) and then to bipolar coordinates ($r_1=r_1$, $r_2^2=r_1^2+s^2-2 r_1 s \cos \theta$, $\phi = \phi$) we get:
$$I(s) = 2 \pi \int_{0}^{R} \int_{|r_1-s|}^{r1+s}f_1(r_1) f_2(r_2) \frac{r_1 r_2}{s} dr_2 dr_1 $$
This is slightly more general than we need, but it seems a interesting/useful formula.
In our case, $f_1 =1$, $f_2(r_2) = 1/r_2$, (and $s=|x|$), hence
$$I(s)=2\pi \int_{0}^{R} \int_{|r_1-s|}^{r1+s} \frac{r_1}{s} dr_2 dr_1$$
So
$$\frac{I(s)}{2\pi}=  \int_{0}^{s} \frac{r_1}{s} 2 r_1 dr_1 + \int_{s}^{R} \frac{r_1}{s} 2 s dr_1 = \frac{2}{3}s^2 + (R^2 -s^2)$$
and
$$I(s)=2 \pi \left(R^2-\frac{1}{3}s^2\right)$$
This should be valid (unless I've messed something) for ${\bf x}$ inside the ball (i.e. $s \le R$).
Edit: quick and dirty numerical test with Octave/Matlab:
R=5;
s=3.5;
N=30000;
X=rand(N,3)*2*R-R;
Y=sqrt(sum(abs(X).^2,2));
X1 = X(Y<R,:);
N1 = size(X1,1);
X1(:,3) = X1(:,3)-s;
V = 1./sqrt(sum(abs(X1).^2,2));
(4*pi*R^3/3)*sum(V)/N1
2*pi*(R^2-s^2/3)

It feels right.
A: It is actually fairly easy from a physicist's perspective.
It is the gravitational potential caused by a ball of radius R and density 1. It is well know that the potential is simply 4/3 pi R^3/|x|, for |x| > R.
It is a little bit more complicated for |x| < R. But you can still calculate it fairly easily as the gravitational potential by integrating F ds, with the range of s being |x| to infinity. F is 4/3 pi R^3 /|x|^2 for |x| > R and 4/3 pi |x|^3 /|x|^2 for |x| <= R
