Distance between two circles on a cube I found this problem in a book on undergraduate maths in the Soviet Union (http://www.ftpi.umn.edu/shifman/ComradeEinstein.pdf):

A circle is inscribed in a face of a cube of side a. Another circle is circumscribed about a neighboring face of the cube. Find the least distance between points of the circles.

The solution to the problem is in the book (page 61), but I am wondering how to find the maximum distance between points of the circles and I cannot see how the method used there can be used to find this.
 A: I'll consider just the two-spheres method.
For simplicity, I'll assume $a = 2$; the general solution will be
proportional to the solution for this special case.
Both spheres have their centers at the body center of the cube;
call that point $O$.
The sphere containing the smaller circle is tangent to all twelve
edges of the cube, radius $\sqrt2$, and the larger sphere is circumscribed around the cube, radius $\sqrt3$.
The difference of the radii is clearly a lower bound of the "minimum" distance,
since no two points (one on each sphere) can be closer and every point on
each circle is on the corresponding sphere.
For similar reasons the sum of the radii is an upper bound on the "maximum" distance.
To paraphrase a remark by grand_chat, for the difference of the radii to
be the exact answer to the "minimum" question, there must be a line through $O$ that intersects both circles on the same side of $O$.
For the sum of the radii to be the exact answer to the "maximum" question, 
there must be a line through $O$ that intersects the two circles on opposite sides of $O$.
[Update: The following is (I think) a much simpler argument than I
originally posted here.]
Consider the double cone defined by all the lines through $O$ that intersect
the smaller circle. This cone is tangent to the edges of the square face
inscribed in the larger circle, and the points on the large circle near
the centers of those edges are inside the cone; but other points on the
larger circle (such as the vertices of the square) are outside the cone.
In fact, the large circle must intersect the cone in at least four points.
Take one of these points nearest to the small circle and call it $Q$;
then $Q$ is collinear with $O$ and a point $P$ on the small circle
(because every point on the cone is collinear with $O$ and a point
on the small circle), $P$ and $Q$ are on the same side of $O$, and the
lower bound of the distance between points on the circles
is achieved at $PQ = \sqrt3 - \sqrt2$.
Now take one of the intersection points farthest from the small circle
and call it $Q'$; then then $Q'$ is collinear with $O$ and a point $P$ 
on the small circle, but $P$ and $Q'$ are on opposite sides of $O$, so the
upper bound of the distance between points on the circles
is achieved at $PQ' = \sqrt3 + \sqrt2$.

[For reference, the following was my earlier argument.]
Let $C$ be the center of the small circle.
Consider the set of planes through $O$ and $C$;
parameterize this set, using an arbitrary point $P$ on the small circle
as the parameter, by defining
$\mathop{plane}(P)$ as the plane through $O$, $P$, and $C$.
The angle $\angle COP$ is $\pi/4$.
For certain choices of $P$, $\mathop{plane}(P)$ intersects the larger circle.
For the "minimum" question, let $Q$ be the intersection
point of the larger circle and $\mathop{plane}(P)$ closer to $P$.
If $P = P_0$ is the single point of the smaller circle in the plane of the larger circle, clearly $\angle COQ < \pi/4$.
If $P = P_1$ is one of the two nearest points such that $\mathop{plane}(P)$
is tangent to the larger circle, $\angle COQ = \pi/2 > \pi/4$.
For $P$ between $P_0$ and $P_1$, $\angle COQ$ is a continuous function of the arc distance from $P_0$ to $P$.
Therefore there  is an intermediate point $P$ at which $\angle COQ = \pi/4$.
Then $PQ = \sqrt3 - \sqrt2$ and the previously-stated
lower bound of the distance is achieved.
For the "maximum" question, we do a similar parameterization $\mathop{plane}(P)$, but we take $P_0$ as the point on the small circle
farthest from the plane of the larger circle (at the midpoint of the
opposite edge of the cube, in fact) and let $Q$ be the intersection of
the larger circle with $\mathop{plane}(P)$ farthest from $P$.
Then for $P = P_0$, $\angle COQ > 3\pi/4$,
but for $P = P_1$, $\angle COQ = \pi/2$.
Hence for some intermediate point $P$, $\angle COQ = 3\pi/4$,
and then $P$ and $Q$ are collinear with $O$ and on opposite sides of $O$,
so the upper bound of the distance is achieved at $PQ = \sqrt3 + \sqrt2$.
A: To find the maximum distance instead of the minimum distance, you can follow the same method, but interchange "maximize" with "minimize" everywhere. In particular the analog of Lemma 21.1 is
Lemma 21.1b. Let $\alpha$ and $\beta$ be real numbers. Then 
$$\min_{t\in[0,2\pi)}\alpha\cos t +\beta\sin t=-\sqrt{\alpha^2+\beta^2}.$$
The rest of the proof can be followed. You'll see negative signs popping up where they used to be positive.
A: I placed the inscribed circle on the top face (+y direction) and the circumscribed circle on the front face (+z direction). Their locus of points is
$$ \begin{align} 
\vec{r}_1 & = \begin{bmatrix} r_1 \cos \theta_1 & \frac{a}{2} & r_1 \sin \theta_1 \end{bmatrix} \\
\vec{r}_2 & = \begin{bmatrix} r_2 \cos \theta_2 & r_2 \sin \theta_2 & \frac{a}{2} \end{bmatrix} 
\end{align} $$
where $r_1 = \frac{a}{2}$, $r_2 = \frac{a}{\sqrt{2}}$ and $a$ is the side of the cube.
The distance (squared) is $$d^2 = \| \vec{r}_1 -\vec{r}_2 \|^2 $$ which is a function of $\theta_1$ and $\theta_2$.
It comes out as
$$ \frac{d^2}{a^2} = \frac{5}{4} - \frac{\sqrt{2} \cos\theta_1 \cos \theta_2 + \sin \theta_1 + \sqrt{2} \sin \theta_2}{2} $$
To minimize this you have to set $$\frac{\partial}{\partial \theta_1} \frac{d^2}{a^2} = 0$$ and at the same time $$\frac{\partial}{\partial \theta_2} \frac{d^2}{a^2} = 0$$
The system to solve is $$\begin{align} \frac{\sin \theta_1 \cos \theta_2}{\sqrt{2}} - \frac{\cos\theta_1}{2} & = 0 \\ \frac{\cos \theta_1 \sin \theta_2}{\sqrt{2}} - \frac{\cos\theta_2}{\sqrt{2}} & = 0 \end{align} $$
From the first equation $\cos \theta_2 = \frac{\cot \theta_1}{\sqrt{2}}$. When used in the second equation I get $\theta_1 = \arctan \sqrt{2}$.
The result I get was $$\frac{d^2}{a^2} = \frac{5}{4} - \frac{\sqrt{6}}{2} $$
