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?



5 Answers 5


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...

  • $\begingroup$ Sorry: $\mathcal{L}$ is the Lebesgue measure in $\mathbb{R}^n$, maybe this symbol is not very common in vector analysis. $\endgroup$
    – Siminore
    Commented Apr 24, 2012 at 14:27
  • $\begingroup$ Thank you for your help but where does the equation comes from? $\endgroup$
    – Braten
    Commented Apr 24, 2012 at 14:36
  • 3
    $\begingroup$ But the $f$ above isn't symmetic on $B_R(0)$ if $x \ne 0$, is it? $\endgroup$
    – martini
    Commented Apr 24, 2012 at 14:44
  • $\begingroup$ Yes martini is right!!! $\endgroup$
    – Braten
    Commented Apr 24, 2012 at 14:50
  • $\begingroup$ Sorry, I read $B_R(x)$ instead of $B_R(0)$. In this case the answer depends on $x$. I remeber a solution by noticing that $y \mapsto \frac{1}{|y|}$ is a harmonic function (where defined) in $\mathbb{R}^3$. I must try to recall the details... $\endgroup$
    – Siminore
    Commented Apr 24, 2012 at 15:05

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$.


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)$$


$$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:

X1 = X(Y<R,:);
N1 = size(X1,1);
X1(:,3) = X1(:,3)-s;
V = 1./sqrt(sum(abs(X1).^2,2));

It feels right.


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.

  • $\begingroup$ @nbusis: do you know how to compute the integral? $\endgroup$
    – Braten
    Commented Apr 25, 2012 at 13:57
  • $\begingroup$ @Braten - see my edited answer. $\endgroup$ Commented Apr 27, 2012 at 7:21

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


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .