For two bubbles in vacuum, with radii $r_1$ and $r_2$, number of moles $n_1$ and $n_2$, pressure $p_1$ and $p_2$, and volume $V_1$ and $V_2$ assuming that they coalesce under isothermal conditions to form a bubble of radius $r$, number of moles $n$ ($=n_1 + n_2$), pressure $p$, and volume $V$.

Now, assuming that the gas / air in the bubbles behaves like an ideal gas, meaning the gas follows the ideal gas law: $pV = nRT$ or $\cfrac{pV}{RT} = n$

Then, it follows that $\cfrac{p_1V_1}{RT} + \cfrac{p_2V_2}{RT} = \cfrac{pV}{RT}$ [$n_1 + n_2 = n$ ]

Or, $p_1 r_1^3 + p_2 r_2^3 = p r^2$

Now, from earlier, for a bubble of radius $r$, $\Delta p = p_i – p_o = \cfrac{4T}{r}$,

In vacuum this reduces to $p_i = \cfrac{4T}{r}$

or $4T r_1^2 + 4T r_2^2 = 4T r^2$

or $r_1^2 + r_2^2 = r^2$