Finding the radius of the largest sphere possible between a corner and another sphere In a 3 dimensional Cartesian plane there is a sphere A that is in the first octant and is tangent to all coordinate planes. Now, imagine we want to find the another sphere B also tangent to all coordinate planes, but also tangent to A. There are two possible solutions, but the solution I am interested in is the one where the radius r of B is less than R. Here is my reasoning: the distance between the center of A and the origin is 3R^2-R. This means that the maximum distance between B and the origin is 3R^2-R (it can be easily shown that if A has radius R, then its center is the point (R,R,R), therefore, the centers of A and B and the origin are collinear). The maximum distance between B and the origin is given by 3r^2+r. Setting these two expressions equal to each other and solving for r does not give me the correct answer in terms of R. What is wrong with my reasoning? Also, a correct derivation of r would be appreciated. Thank you
 A: It might be worthwhile to first work out the analogous problem for the plane, where one can draw nice pictures.  But we will go directly to spheres.
The notation here is more or less the one that you have implicitly chosen.  But in almost any geometric problem about circles or spheres, the centers are important. So we need names for them, say $C_R$ and $C_r$.
The distance from $C_R$ to the origin is $\sqrt{3}R$, for this distance is simply the length of the "long diagonal" of a $R\times R\times R$ cube. Let us compute this distance in another way.
Draw a line from $C_R$ to the origin.  This line will pass through $C_r$.
In going from $C_R$ to the origin, we must first travel a distance $R$ to reach the point of tangency between the two spheres.  Then we must travel a distance $r$ to reach $C_r$.  Then we must travel a distance $\sqrt{3}r$ to reach the origin.
Thus
$$\sqrt{3}{R}=R+r+\sqrt{3}r.$$
Solve for $r$. We get
$$r=\frac{\sqrt{3}-1}{\sqrt{3}+1}R.$$
There are various equivalent expressions for $r$.  For instance, one can "rationalize the denominator" by multiplying top and bottom by $\sqrt{3}-1$.  That gives us 
$$r=(2-\sqrt{3})R.$$
Added: Now you should be able instantly, without any computation at all, to write down the radius of the huge sphere, the one you did not want.  
