Consider two spheres on the x axis, one centered at the origin, separated by a distance d, and of radius r1 and r2.

The equations of the two spheres are
(x - d)2 + y2 + z2 = r22
Subtracting the first equation from the second, expanding the powers, and solving for x gives
The intersection of the two spheres is a circle perpendicular to the x axis, at a position given by x above. Substituting this into the equation of the first sphere gives
where