For a component in an ideal or dilute ideal solution, the chemical potential is given by: \begin{equation} \mu_{i}^{id}=\mu_{i}^{0}+RTlnx_i \end{equation} Solving for $x_i$

\begin{equation} x_i=e^{[(\mu_i-\mu_{i}^{0})/RT]} \end{equation}

We define the activity of component i in a real solution as:

\begin{equation} a_i=e^{[(\mu_i-\mu_{i}^{0})/RT]} \end{equation} Activity plays the same role in real solutions as mole fraction in ideal ones.

Therefore, the chemical potential of a component in any solution (ideal or real) is given by:

\begin{equation} \mu_{i}=\mu_{i}^{0}+RTlna_i \end{equation}

The coefficient of activity, $\gamma_i$, measures the degree of divergence of the behavior of substance i with respect to the ideal behavior. \begin{equation} \mu_i-\mu_{i}^{id}=\mu_{i}^{0}+RTlna_i-(\mu_{i}^{0}+RTlnx_i)=RTln\frac{a_i} {x_i} \end{equation}

Where, $\gamma_{i}=\frac{a_i}{x_i}$, the activity coefficient. Clearing the activity, $a_i=x_i\gamma_i$.

\begin{equation} \mu_{i}=\mu_{i}^{0}+RTlnx_i\gamma_i \end{equation}

Both the activity and the activity coefficient depend on the same variables as the chemical potential $\mu_i$

\begin{equation} a_i=a_i(T,P,x_1,x_2,......)\;\;\Rightarrow \;\; \gamma_i=\gamma_i(T,P,x_1,x_2........) \end{equation}