# Can Mathematica help me evaluate an integral over disjoint disks $I = \int_{D_1} \int_{D_2} \log|x-y| dy dx$?

I want to evaluate an integral that involves two disjoint unit disks $$D_1$$ and $$D_2$$. $$D_1$$ is centered at $$(-2,0)$$ and $$D_2$$ is centered at $$(0,2)$$. The integral I want to compute is

$$I = \int_{D_1} \int_{D_2} \log|x-y| dy dx.$$

I looked at the in-built Python integration methods and also the quadpy library but although they have lots of options for integration over a single disk, I couldn't find anything that can help me with integrating over two disjoint disks.

Is it possible to evaluate this integral in Mathematica? I don't need an optimum method, I just need to obtain the value of this integral.

• The exact value of the integral under consideration is $\pi^2\log 4$. The function $\log |x-y|$ is harmonic and the mean value property can be twice applied (see en.wikipedia.org/wiki/Harmonic_function). Feb 2, 2019 at 21:18
• Mathematica calculates the integral under consideration, producing $\frac{1}{4} \pi ^2 (-1+2 i \pi +\log (16))$. A bug was submitted by me. Feb 3, 2019 at 18:51

NIntegrate[
Log[Norm[{x1, x2} - {y1, y2}]],
{x1, x2} ∈ Disk[{-2, 0}, 1],
{y1, y2} ∈ Disk[{2, 0}, 1]
]


13.6822

(the actual result being 13.682176919165677),

In order to enter ∈, just type Esc e l Esc.

In order to increase the precision, use the option PrecisionGoal.

## Edit

Another possibility that relieves Mathematica from the need to discretize the disks and that allows her to use higher-order quadrature formulas is to employ polar coordinates on each of the disks:

NIntegrate[
Log[Norm[{r1 Cos[θ1] - 2,r1 Sin[θ1]} - {r2 Cos[θ2] + 2,r2 Sin[θ2]}]] r1 r2,
{r1, 0, 1}, {θ1, -Pi, Pi},
{r2, 0, 1}, {θ2, -Pi, Pi},

• Whoah, that's very nice thanks! I actually just managed to get it going in with some manual change of variables in Python with nquad and I got the result $13.682176927714263$ Feb 2, 2019 at 15:55
• You can also lower the PrecisionGoal for more speed... Feb 2, 2019 at 15:58