TITLE: Distance Between Two Ellipsoids
QUESTION [8 upvotes]: Find the shortest distance between $\begin{align}
&\frac{x_1^2}{a_1^2}+...+\frac{x_n^2}{a_n^2}=1\\
&\frac{x_1^2}{a_1^2}+...+\frac{x_n^2}{a_n^2}=2
\end{align}$.
My thinking is when $n=2$, we have two ellipses where the axes of the second are the same as the first scaled by a factor of $\sqrt{2}$. WLOG, assume $|a_1|<|a_2|$. Then the shortest distance would be $|a_1|(\sqrt{2}-1)$. For the ellipsoid case, I would say the shortest distance is $|a_{\text{min}}|(\sqrt{2}-1)$. I don't know how to prove this formally. I thought about using Lagrange multipliers but had difficulties even setting it up. Any suggestions?

REPLY [3 votes]: Here is a solution using Lagrange multipliers: The key is to note that if $(x,y)$ solves the problem (with $x,y$ being on the two ellipses), then $x$ is a closest point to the '$y$'-ellipse, and $y$ is a closest point to the '$x$'-ellipse.
Let $f(x) = \sum_k ({x_k \over a_k } ) ^2$. Let $E_k = f^{-1} (\{ k \})$, $k=1,2$
The $E_k$ are compact, so we know there are minimisers. Suppose $(x,y)$ is a minimiser with $x \in E_1, y \in E_2$.
Since $y$ minimises the distance to $E_1$, we have $x-y\parallel \nabla f(y)$. Similarly, since $x$ minimises the distance to $E_2$, we have $y-x \parallel \nabla f(x)$.
Hence $\nabla f(y) = \lambda \nabla f(x)$ for some $\lambda$, and
so $y = \lambda x$. Since $y \in E_2, x \in E_1$, we find
that $\lambda = \sqrt{2}$.
Hence any minimiser $(x',y')$ satisfies $y' = \sqrt{2} x'$. If $x' \in E_1$, we see that $\sqrt{2}x' \in E_2$, hence we can restrict our search to
minimising the distance between $x'$ and $\sqrt{2} x'$, with $x' \in E_1$.
That is, we need to solve $\min \{ (\sqrt{2}-1) \|x'\| | x' \in E_1 \}$,
and it is clear that the minimising point is a closest point on $E_1$ to the origin. It is clear that if $i$ is such that $|a_i| = \min_k |a_k|$, then
$x'=a_i e_i$ is a minimiser, from which we conclude that the minimum distance
is $(\sqrt{2}-1) \min_k |a_k|$.