Kepler's third law: the equations $\frac{T^2}{\langle r\rangle^3}=\text{constant}$ and $\frac{T^2}{a^3}=\text{constant}$ are equivalent? Kepler's third law or periods affirms that:

"The squares of the times that the planets use to cover their orbits are proportional to the cube of their average distances from the Sun".

font from as an example https://it.wikipedia.org/wiki/Leggi_di_Keplero

(the first definition) and


from the English book PHYSICS, James Walker, 5^ edition


I write $r=\mathrm{d}(\text{Planet,Sun})$ and $r_i$ for $i=1,\ldots n$, are the radius vectors of the planet when it moves during its period of revolution around the Sun. I have written only $r_1, r_2$ and $r_3$. Considering that in the starting definition we speak of average distances, is it possible to write
$$\frac{T^2}{\langle r\rangle^3}=\text{constant}\tag 1$$
where I indicate the arithmetic average of the distances of a planet from the Sun when it travels through its elliptical orbit?
For example we have an equation of an canonical ellipse,
$$\frac{x^2}{a^2}+\frac{y^2}{b^2}=1$$
where $a$ is the major semi-axis, $b$ the minor semi-axis with $a>b>0$. Supposing to keep the numerator constant in the $(1)$ if I take just three distances $r_1$, $r_2$ and $r_3$ and I consider, using for example, Geogebra with a drawing
$$\langle r \rangle=\frac{r_1+r_2+r_3}{3}\approx a \tag 2$$
If this approach is meaningful then I can also write, with good approximation, that
$$\frac{T^2}{a^3}=\text{constant}\tag 3$$
So the $(3)$ is justified by the $(1)$. But in almost all books in Italian language of an high school books, the first definition is not given, but it is written that

The ratio between the square of the revolution period and the cube of the semi-axis major of the orbit is the same for all planets.

My question is:

Is there a correlation of average distances $\langle r \rangle$ with the $a$ or $\langle r \rangle\equiv a$?

Any answer is welcome and I hope with a lot of serenity.
 A: It is not an approximation to write $T^2 \propto a^3$, it is the actual Kepler's law. There are many ways to show it, but a simple one is to start from his area law to write:
$$\mathcal{A} = \pi a b = \frac{LT}{2m}$$
On the other hand, one can show using Newton's third law that the parameter $p=b^2/a$ of the ellipsis is given by:
$$p = \frac{L^2}{GMm}$$
Combining these two to eliminate $L$, we obtain:
$$\frac{a^3}{T^2} = \frac{GM}{4\pi^2} = \mathrm{const}$$
A: 
Is there a correlation of average distances $\langle r \rangle$ with the $a$ or $\langle r \rangle\equiv a$?

Since $r$ changes continuously, most people would assume that $\langle r \rangle$ means either a continuous average over all angles $\theta$ around the ellipse,
$$\langle r \rangle_\theta\equiv\frac{1}{2\pi}\int_0^{2\pi}r(\theta)d\theta,\tag1$$
or a continuous time average over one period $T$ of the orbit,
$$\langle r \rangle_t\equiv\frac{1}{T}\int_0^T r(t)dt.\tag2$$
Let's calculate these two averages.
The elliptical orbit is given by
$$r(\theta)=\frac{a(1-e^2)}{1-e\cos\theta}\tag3$$
where $a$ is the semimajor axis and $e$ the eccentricity. Substituting this into (1) and doing the integral gives
$$\langle r \rangle_\theta\equiv\frac{a(1-e^2)}{2\pi}\int_0^{2\pi}\frac{d\theta}{1-e\cos\theta}=\frac{a(1-e^2)}{2\pi}\frac{2\pi}{\sqrt{1-e^2}}=a\sqrt{1-e^2}.\tag4$$
So the angular average is not equal to $a$; it is less than $a$.
To compute the time average, it is easiest to turn it into another integral over $\theta$ by writing it as
$$\langle r \rangle_t=\frac{1}{T}\int_0^{2\pi}\frac{r(\theta)d\theta}{\dot\theta}.\tag5$$
where the overdot means a time derivative.
To evaluate this, use Kepler's Second Law, which says that
$$\frac{dA}{dt}=\frac12r^2\dot\theta=\text{const}=\frac{A}{T}=\frac{\pi ab}{T}=\frac{\pi a^2\sqrt{1-e^2}}{T}\tag6$$
(here $b=a\sqrt{1-e^2}$ is the semiminor axis)
so
$$\dot\theta=\frac{2\pi a^2\sqrt{1-e^2}}{T}\frac{1}{r^2}.\tag7$$
Putting (7) into (5), we get
$$\langle r \rangle_t=\frac{1}{2\pi a^2\sqrt{1-e^2}}\int_0^{2\pi}r(\theta)^3d\theta.\tag8$$
Putting (3) into (8) and doing the integral, we get
$$\begin{align}\langle r \rangle_t&=\frac{a(1-e^2)^{5/2}}{2\pi}\int_0^{2\pi}\frac{d\theta}{(1-e\cos\theta)^3}=\frac{a(1-e^2)^{5/2}}{2\pi}\frac{(2+e^2)\pi}{(1-e^2)^{5/2}}\\&=a\left(1+\frac12e^2\right).\tag9\end{align}$$
So the time average of $r$ is not equal to $a$; it is greater than $a$.
Thus neither the continuous angular average of $r$ nor the continuous time average of $r$ is equal to $a$.
The way in which to understand $a$ as an "average" distance is simply as a discrete average of $r$ at two particular points on the orbit, namely aphelion and perihelion:
$$a=\frac12(r_\text{max}+r_\text{min}).\tag{10}$$
P.S. I did the two integrals with Mathematica. One way to do them by hand is to turn them into contour integrals around the unit circle in the complex plane and evaluate them using residues.
