Calculating the mean distance of a point to all points on a circle, maybe with an integral? I want to consider this problem: Given a point $p(x,y)$ within the 2-ball $B_R(0)$, connecting it to all points of the circumference, what is the mean value of those distances ($D$)?
My idea was to cut the circumference into segments $\Delta \phi = \frac{2\pi}{n}$, calculate the distances, sum them up, divide by $n$ and then let $n$ approach infinity.
$$D(p) = \lim_{n\to \infty} \sum_{i=0}^n \frac{\sqrt{[x-R cos(i\frac{2\pi}{n})]^2+[y-R sin(i\frac{2\pi}{n})]^2}}{n}$$
My questions: Is this correct?
Is there a way to convert this sum into an integral? Can this be done easier?
 A: $1)$ Yes, your sum is correct. $2)$ The sum can be converted into an integral by using a Riemann sum from $0$ to $1$, giving $$\int_0^1\sqrt{(x-R\cos(2\pi t))^2+(y-R\sin(2\pi t))^2}dt$$
You already figured out (in the comments) how the integral is formed from the sum.
$3)$ An easier way than creating the Riemann sum, then coverting that to an integral would be to directly create the integral. In general, the average value of a function, $f(t)$ over an interval is given by $$\frac{1}{b-a} \int_a^b f(t) dt$$
You are trying to find the average distance from $t = 0$ to $t = 2\pi$. This would result in the integral $$\frac{1}{2\pi}\int_0^{2\pi} \sqrt{(x-R\cos(t))^2+(y-R\sin(t))^2}dt$$
An intuitive explanation could be figured as going around the circle and taking the average distance from the infinitesimal points on the circle to $(x, y)$.

For now, we can assume that the radius is $1$, because $$\frac{1}{2\pi}\int_0^{2\pi}\sqrt{(x-R\cos(t))^2+(y-R\sin(t))^2}dt = \frac{R}{2\pi}\int_0^{2\pi}\sqrt{\left(\frac{x}{R}-\cos(t)\right)^2+\left(\frac{y}{R}-\sin(t)\right)^2}dt$$
Also, we can assume that $y = 0$ because the point could be rotated around the origin.
Now to solve: $$\frac{1}{2\pi} \int_0^{2\pi}\sqrt{(x-\cos(t))^2 + (0-\sin(t))^2} dt$$
$$\frac{1}{2\pi} \int_0^{2\pi}\sqrt{x^2 + 1 - 2x\cos(t)} dt$$
This can only be solved by special functions, giving $$2\left( |x-1|E\left( -\frac{4x}{(x-1)^2} \right) + |x+1| E\left( \frac{4x}{(x+1)^2} \right) \right)$$ where $E(x)$ denotes the complete elliptic integral of the second kind.
A: Thanks a lot, you answered my questions about this!
Now I want to go on with this and calculate the mean distance in the way described above over all points $p$ within the ball.
Therefore I would integrate the function $$D(x,y) = \frac{1}{2\pi}\int_0^{2\pi}\sqrt{(x-R\cos(t))^2+(y-R\sin(t))^2}dt$$ over the 2-Ball and divide it by the area like this:
$$\bar{D}_R = \frac{1}{\pi R^2}\int_{B_R(0)} D(x,y) \,dx\,dy$$
I would try to rewrite this using spherical coordinates such that
$$\bar{D}_R = \frac{1}{\pi R^2}\int_0^{2\pi}\int_0^{R} D(r\cos(\phi),r\sin(\phi))\,r\,dr\,d\phi$$
$$= \frac{1}{2\pi^2 R^2}\int_0^{2\pi}\int_0^{R} \int_0^{2\pi}\sqrt{(r\cos(\phi)-R\cos(t))^2+(r\sin(\phi)-R\sin(t))^2}\,r\,dt\,dr\,d\phi $$
Is this correct? Do you see a way to solve or simplify this integral?
