Derivation of formula used in calculating molecular mass from a mixture In a solution to a problem, to calculate Molecular mass of unknown gas from a mixture containing $\ce{O2}$ in $80~\%$, the author used the formula :


  $\frac{1}{\sqrt{M_\text{mix}}}=\frac{X_{\ce{O2}}}{\sqrt{M_{\ce{O2}}}}+\frac{X_\text{gas}}{\sqrt{M_\text{gas}}}$.


The exact problem is:


  Pure $\ce{O_2}$ diffuses through an aperture in $224\mathrm{s}$, where as mixture of $\ce{O_2}$ and another gas containing $80~\%\ \ce{O_2}$ diffuses from the same in $234\mathrm{s}$. The molecular mass of gas will be?


Solution by author:


  $$\begin{align}\frac{t_\text{mix}}{t_{\ce{O2}}} &amp;= \frac{r_{\ce{O2}}}{r_\text{mix}} = \sqrt{\frac{M_\text{mix}}{32}}\\[1em]
\frac{234}{224} &amp;= \sqrt{\frac{M_\text{mix}}{32}}\\[0.5em]
M_\text{mix} &amp;= 34.92\\[1em]
\Longrightarrow \qquad \frac{1}{\sqrt{M_\text{mix}}} &amp;= \frac{X_\text{gas}}{\sqrt{M_\text{gas}}} + \frac{X_{\ce{O2}}}{\sqrt{M_{\ce{O2}}}}\\[1em]
\Longrightarrow \qquad \frac{1}{\sqrt{34.92}} &amp;= \frac{0.2}{\sqrt{M_\text{gas}}} + \frac{0.8}{\sqrt{32}}\\[0.5em]
M_\text{gas} &amp;= 51.5\end{align}$$


I wish to know why this works here?
Hint: $$v_{rms}=\sqrt{\frac{3RT}M}$$

And weighted average of speeds for mixture.

EDIT:

$$ v_{mix} ^{rms}= x_1 v_1^{rms}+ x_2 v_2^{rms}$$ 

This will complete the derivation of the formula you gave.