# What is the probability density function of pairwise distances of random points in a ball?

Suppose that one selects two random points x,y in a sphere of radius R. Is there a closed-form expression for the probability density P(d_x,y), i.e. the probability that x and y have Euclidean distance d in the sphere? Note that I'm referring to points within a sphere, not the probability density over the surface area.

• In mathematics it is conventional to use "sphere" to refer to the surface and "ball" to refer to the enclosed region. You mean the points are selected from the latter, yes?
– user856
Jan 4, 2016 at 18:50
• I found an existing question about the CDF. One of the answers there mentions the PDF. Or you could use the method in the accepted answer to find the CDF and then differentiate. Jan 4, 2016 at 18:55
• Thanks - I can see why "sphere" would cause confusion.
– Max
Jan 4, 2016 at 18:59

Where $d$ is the distance and $R$ is the radius.
$$f(d)=3\frac{d^2}{R^3}-\frac{9}{4}\frac{d^3}{R^4}+\frac{3}{16}\frac{d^5}{R^6}$$