Rearranging these formulas The entropy of mixing formula is $\Delta S_{\mathrm{mix}} = R(x_1\ln(x_1) + x_2\ln(x_2))$ where $x$ is the mole fraction $x_1 = \frac{n_1}{n_1+n_2}$ and $x_2 = \frac{n_2}{n_2+n_1}$ where $n$ is the number of moles and the subscript denotes which compound it is. I am asked to express this entropy of mixing formula in terms of the mass fraction which is $y_1 = \frac{m_1}{m_1+m_2}$ where $m$ is the mass of the substances. now $m_1 = n_1M_1$ and $m_2 = n_2M_2$ where $M$ is the molar mass, I have tried to rearrange them a lot and could not manage to express $x$ in terms of $y$. Could anyone help me please? 
 A: Given
\begin{align} 
\Delta S_{\mathrm{mix}} 
&= 
R(x_1\ln(x_1) + x_2\ln(x_2))
\tag{1}\label{1}
,\\
x_1 &= \frac{n_1}{n_1+n_2}
\tag{2}\label{2}
,\\
x_2 &= \frac{n_2}{n_1+n_2}
\tag{3}\label{3}
,\\
y_1 &= \frac{m_1}{m_1+m_2}
\tag{4}\label{4}
,\\
m_1 &= n_1M_1
\tag{5}\label{5}
,\\
m_2 &= n_2M_2
\tag{6}\label{6}
.
\end{align}
From \eqref{4}-\eqref{6}
we have 
\begin{align} 
y_1 &= \frac1{1+\displaystyle\frac{n_2}{n_1}\cdot \frac{M_2}{M_1}}
\tag{7}\label{7}
,
\end{align} 
from \eqref{2}-\eqref{3} follows
\begin{align}
x_1+x_2&=1
\tag{8}\label{8}
,\\
\frac{n_2}{n_1}
&=
\frac{x_2}{x_1}
=\frac{1-x_1}{x_1}
\tag{9}\label{9}
,
\end{align} 
so \eqref{9} combined with \eqref{7}, \eqref{8} gives
the desired:
\begin{align}
y_1 &= \frac1{1+\frac{x_2}{x_1}\cdot \tfrac{M_2}{M_1}}
\tag{10}\label{10}
,\\
y_1 &= \frac1{1+\frac{1-x_1}{x_1}\cdot \tfrac{M_2}{M_1}}
\tag{11}\label{11}
,\\
y_1 &= \frac1{1+\left(\frac1{x_1}-1\right)\cdot \tfrac{M_2}{M_1}}
\tag{12}\label{12}
,\\
\frac1{y_1} &= {1+\left(\frac1{x_1}-1\right)\cdot \tfrac{M_2}{M_1}}
\tag{13}\label{13}
,\\
\frac1{y_1}-1 &= {\left(\frac1{x_1}-1\right)\cdot \tfrac{M_2}{M_1}}
\tag{14}\label{14}
,\\
\left(\frac1{y_1}-1\right)\cdot \tfrac{M_1}{M_2} &= \frac1{x_1}-1
\tag{15}\label{15}
,\\
1+\left(\frac1{y_1}-1\right)\cdot \tfrac{M_1}{M_2} &= \frac1{x_1}
\tag{16}\label{16}
,
\end{align}
\begin{align}
x_1 &= \frac 1{1+\displaystyle\frac{1-y_1}{y_1}\cdot \tfrac{M_1}{M_2}}
\tag{17}\label{17}
,\\
x_2 &= \frac 1{1+\displaystyle\frac{y_1}{1-y_1}\cdot \tfrac{M_2}{M_1}}
\tag{18}\label{18}
.
\end{align}
