Largest cube that fits between spheres. Two spheres, one of radius 2 and the other of radius 4, have the same centre. What is the edge size of the largest cube that fits between them? (AMC Senior, 2015)
diagram: http://imgur.com/6sm6YTi
I tried taking a cross-section of the shape, and used Pythagoras but kept getting the (same) wrong answer. The answer is $\frac {2}{3}(\sqrt 22 - 2)$.
 A: To elaborate on Michael Rozenberg's answer, we can let $x$ be the side length of the cube, and draw a right triangle. One vertex, A, is at the center of the spheres. The second, B, is at the center of the outermost face of the cube. The third, C, is at one of the vertices of the cube that touches the outer sphere. 
AB contains a radius of the inner circle and also extends through the center of the cube, so it has length $2+x$. C is on the outer sphere, so AC has length $4$ (this is the hypotenuse). BC extends from the center of a face to one of that face's vertices, so it is half of the diagonal of a square of length $x$. Thus it has length $\frac {\sqrt 2}2x$. From the Pythagorean theorem, we have:
$$(x+2)^2+\frac 12x^2=16$$
Here's a rough sketch:

A: Just
$$(x+2)^2+\left(\frac{x}{\sqrt2}\right)^2=4^2$$
A: Suppose the largest such cube has side length $s$.  The face of the cube whose vertices lie on the larger sphere is a square inscribed in a circle of some radius which we will call $r_1 = s/\sqrt{2}$.  How far is this face from the center of the spheres?  Well, we know that the outer sphere has radius $4$, and the circle formed by the intersection of this sphere with a plane some distance $d$ from the center is simply $$r_1 = \sqrt{4^2 - d^2},$$ from which it follows that $$d = \sqrt{4^2 - r_1^2} = \sqrt{16 - s^2/2}.$$  But it is evident that if the edge length is $s$, then the plane containing the opposite face of the cube is parallel to the plane through the outermost face and is separated by $s$.  But this "inner" plane is by definition a distance $2$ away from the center.  Hence we have the relationship $$s + 2 = d = \sqrt{16 - s^2/2},$$ or $$\frac{3}{2} s^2 + 4s - 12 = 0,$$ or $$s = \frac{2}{3}(\sqrt{22} - 2),$$ as claimed.
