I wanted to calculate the average distance between two points both lying inside $B^2(vec 0, R)$, and ended up writing

```
Clear(r1,r2,x,y,z,R,x1,x2,y1,y2,z1,z2)
Assuming(R>0,Integrate(Integrate(Sqrt(Abs(x1^2 +y1^2+z1^2 - x2^2 - y2^2 - z2^2)), {x1,y1,z1 }(Element)Ball({0,0,0},R)),{x2,y2,z2}(Element)Ball({0,0,0},R)))
```

However, given the elegance of the Mathematica language, and any my experience in programming in general, I, sort of, felt ashamed of myself writing such ugly code.

Is there a more compact & elegant way of writing the same code in a short manner such that it will also improve the speed of the code? Because I run this code on wolframcloud and it couldn’t find the result withing the limits of its execution time.