# Which planet is closest to the Earth, and why is it Mercury?

Which planet is closest to Earth, on average? I used to think it was Venus, followed by Mars. But [this paper](https://fermatslibrary.com/s/venus-is-not-earth-s-closest-neighbor) claims it is instead Mercury.

At first this seemed to make no sense. Just picture the orbits of the planets: they're a bunch of concentric circles (approximately). Venus' orbit completely encloses Mercury's. Every point of it is closer to the Earth's orbit than Mercury's orbit is. And indeed, that's how you get that Venus is the closest planet to Earth, followed by Mars, and then Mercury: take the difference between the radius of their orbits.

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/52ff61fd5a6f08d5eeb42e9fbe376e0d53c5db5b67d14345.jpg)

I don't think you get to call your image "Sized to Scale" when Jupiter occupies half the distance between it and Mars, but okay.

But that doesn't actually get you the average distance. If two planets happen to be lined up (at the same point in their orbit) then yes, the distance between them is the difference between their orbital radii. But if one of them is on the opposite side of the Sun as the other (at the opposite point in their orbit), then the distance between them is the *sum* of their radii, and Mercury is the closest planet to Earth!

So, to figure out what planet is closest to the Earth *on average*, you have to actually do the math.

Actually Doing the Math
-----------------------

Let's calculate the average distance between the Earth (circular orbit of radius $r_2$) and another planet (circular orbit of radius $r_1$). We'll suppose each planet has an independent uniform probability of being at each point in its orbit, but because of symmetry, we can take our coordinate system to have Earth in the x axis, and only worry about the varying position of the other planet relative to it.

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/3059b1c01fbd179fee27303b6b40b0764a8e84cd880b424b.jpg)

The distance between the planets, given by the [cosine rule](https://en.wikipedia.org/wiki/Law_of_cosines),  is $d = \sqrt{r_1^2 + r_2^2 - 2r_1r_2\cos\theta}$. To find the average, we have to integrate this over $\theta$ between $0$ and $2\pi$, and divide by $2\pi$. That looks like a really unpleasant thing to integrate, but luckily our source paper tells us the answer, which turns out to be:

$$
\frac{2}{\pi}(r_1+r_2)E\left(\frac{2\sqrt{r_1r_2}}{r_1+r_2}\right)
$$

where $E$ is the "elliptic integral of the second kind". After looking up [the formula for this elliptic integral](https://en.wikipedia.org/wiki/Elliptic_integral#Complete_elliptic_integral_of_the_second_kind) on Wikipedia, I was able to wrangle our expression for the distance into the paper's formula:

+++ Skippable Math

We start with the average distance by the cosine rule:

$$
\frac{1}{2\pi}\int_0^{2\pi} \sqrt{r_1^2 + r_2^2 - 2r_1r_2\cos\theta}d\theta
$$

And we want to get to an expression involving the elliptic integral of the second kind, which is:

$$
E(k) = \int_0^{\frac{\pi}{2}} \sqrt{1-k^2\sin^2\theta} d\theta
$$

To turn that cosine into a sine squared, we substitute $\phi = \frac{\theta}{2}$ and use the identity $\cos 2\phi = 1 - 2\sin^2\phi$, getting:

$$
\frac{1}{2\pi}\int_0^{\pi} \sqrt{r_1^2 + r_2^2 - 2r_1r_2(1-2\sin^2\phi)} 2d\phi
$$

Now we have the sine squared, but the sign in front of it is positive (two minuses that cancel out), and we want it to be negative. So we substitute again, by $\alpha = \phi - \frac{\pi}{2}$, and use the fact that $\sin^2\alpha = 1 - \sin^2\phi$:

$$
\frac{1}{2\pi}\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \sqrt{r_1^2 + r_2^2 - 2r_1r_2(-1 + 2\sin^2\alpha)} 2d\alpha
$$

Rearranging a bit, we get:

$$
\frac{1}{\pi}\int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \sqrt{(r_1 + r_2)^2 - 4r_1r_2\sin^2\alpha} d\alpha
$$

After all the substitutions, the integral is between $-\frac{\pi}{2}$ and $\frac{\pi}{2}$. However, since $\sin^2$ is an even function, the parts of the integral from $-\frac{\pi}{2}$ to $0$ and from $0$ to $\frac{\pi}{2}$ have the same value, so we can rewrite as:

$$
\frac{2}{\pi}\int_{0}^{\frac{\pi}{2}} \sqrt{(r_1 + r_2)^2 - 4r_1r_2\sin^2\alpha} d\alpha
$$

Dividing and multiplying by $r_1+r_2$, we get:

$$
\frac{2}{\pi}(r_1+r_2) \int_{0}^{\frac{\pi}{2}} \sqrt{1 - \frac{4r_1r_2}{(r_1+r_2)^2}\sin^2\alpha} d\alpha
$$

Where the integral finally looks like our elliptic integral, with $k^2$ equal to $\frac{4r_1r_2}{(r_1+r_2)^2}$. Replacing it in the expression, it becomes:

$$
\frac{2}{\pi}(r_1+r_2) E\left(\frac{2\sqrt{r_1r_2}}{r_1+r_2}\right)
$$

Exactly the expression from the original paper!




+++

According to the paper, this average distance strictly increases with the radius $r_2$.[^wwcqbgzqx88] So, the lowest average distance is to the planet with the smallest orbit, i.e. Mercury. Problem solved!

But Why Though
--------------

...problem not really solved. While this does prove that Mercury is the closest planet to Earth, it doesn't actually help explain why. Is there a simple reason we can actually understand that explains why planets with smaller radii are closer to us?

Yes. Consider, instead of a random point on the inner planet's orbit, *two* points A and B, at the same angle above the vertical:

![](https://39669.cdn.cke-cs.com/rQvD3VnunXZu34m86e5f/images/3cde446accf123c6eb4c5224f3c21ce927628d0bb0787703.jpg)

Between these two points, the average *horizontal* distance to the Earth is just the Earth's orbital radius, $r_2$, and so doesn't depend on the other orbit's radius; and the *vertical* distance is the same for both points, $r_1\cos\theta$. So increasing the radius $r_1$ doesn't change the average horizontal distance at all, and increases the average vertical distance; of course this means the average total distance is increased!

Of course, you may notice this was not completely valid reasoning, since horizontal distances and vertical distances don't add, they combine through Pythagoras' theorem. To turn this verbal insight into an actual proof, we need to write down the formula for the average between the two points A and B's distances, take the derivative with respect to $r_1$, and see if it is positive. As it turns out, it is:

+++ Skippable Math 2

The angle of the point B is $(\pi-\theta)$, so its cosine is $-\cos\theta$. The sum of the distances is then:

$$
d_A + d_B = \sqrt{r_1^2 + r_2^2 - 2r_1r_2\cos\theta} + \sqrt{r_1^2 + r_2^2 + 2r_1r_2\cos\theta}
$$

(The average is just half of this, and the factor of $\frac 12$ doesn't make a difference as to whether it's increasing with $r_1$, so we're discarding it.)

The derivative of this expression with respect to $r_2$ is:

$$
\frac{r_2 - r_1\cos\theta}{\sqrt{r_1^2 + r_2^2 - 2r_1r_2\cos\theta}} + \frac{r_2 + r_1\cos\theta}{\sqrt{r_1^2 + r_2^2 + 2r_1r_2\cos\theta}}
$$

Which, replacing the expressions for $d_A$ and $d_B$, is:

$$
\frac{r_2 - r_1\cos\theta}{d_A} + \frac{r_2 + r_1\cos\theta}{d_B} = \frac{(r_2 - r_1\cos\theta)d_B + (r_2 + r_1\cos\theta)(d_A)}{d_Ad_B}
$$

Since $d_A$ and $d_B$ are positive, this expression is greater than zero if and only if its denominator is positive, so we want:

$$
(r_2 - r_1\cos\theta)d_B + (r_2 + r_1\cos\theta)d_A > 0
$$

Now, if in the expression for $d_A$ we replace $r_1^2$ with $r_1^2\cos^2\theta$, its value becomes lesser or equal (with equality only when $\theta=0$):

$d_A = \sqrt{r_1^2 + r_2^2 - 2r_1r_2\cos\theta} \ge \sqrt{r_1^2\cos^2\theta + r_2^2 - 2r_1r_2\cos\theta} = |r_2-r_1\cos\theta|$

And we can do the same for $d_B$:

$d_B \ge r_2+r_1\cos\theta$

($\cos\theta$ is always positive because we're taking $\theta$ between $-\frac{\pi}{2}$ and $\frac{\pi}{2}$, so we don't need the absolute value here.)

Substituting in our equation, we get:

$$
(r_2 - r_1\cos\theta)d_B + (r_2 + r_1\cos\theta)d_A \ge
$$

$$
(r_2 - r_1\cos\theta)(r_2+r_1\cos\theta) + (r_2 + r_1\cos\theta)|r_2-r_1\cos\theta|
$$

The term in the right side of this inequality is certainly greater than or equal to zero: if $r_2 - r_1\cos\theta$ is less than zero, it's the sum of a term and its negative, which is 0; if it's more than zero, it's the sum of two positive terms, which is more than zero.

Since the inequality is strict when $\theta$ is not 0, our initial expression for the derivative may be zero when $\theta$ is zero, but is positive otherwise. This means that the sum of the distances $d_A+d_B$ grows with the radius $r_2$, and so does their average.$$




+++

The average distance over the entire circle is equivalent to an integral over averages like this (divided by $\pi$), with $\theta$ varying from $-\frac{\pi}{2}$ to $\frac{\pi}{2}$, so it also grows with the radius.

So the intuitive explanation does turn into a viable proof that Mercury really is, on average, the closest planet to Earth and to every other planet.

[^wwcqbgzqx88]: Actually, it doesn't even say that, it just says "the distance between two orbiting bodies is at a minimum when the inner orbit is at a minimum".