How come chemical potential is $RT \ln c$? For years, I just assumed that chemical potential μ is RT ln c. This equation is terribly important, as it helps calculate equilibrium in chemical reactions, electrochemical potentials over membranes, van't Hoff analysis, you name it.
However, when I looked up the way this assumption was made, I came empty handed. Most textbooks just say it is this way.
The most impressive attempt at rationalizing it is in Job's "new paradigm". In https://www.job-stiftung.de/pdf/skripte/Physical_Chemistry/chapter_5.pdf, he states that Δμ = γ × Δc, and, for some reason, γ is RT/c. Integrating μ, all falls in place. However, even he seems to glean over details. Why RT/c?
Is there any self-consistent explanation of RT ln c, preferably inferred from the fundamental laws of thermodynamics?
 A: First, we know that for a pure material,
$$\mu = G(T,P, N)/N =  \underline{G}(T,P) =  - \underline{S} dT + \underline{V} dP $$
where the underline is just my way of saying "per mole". With this, we see that
$$ \frac{\partial \underline{G}}{\partial P} = \underline{V} $$
so say you change the pressure of a pure system without changing anything else then
$$ \Delta \underline{G} = \int_{P_i}^{P_f} \frac{\partial \underline{G}}{\partial P} d P = \int_{P_i}^{P_f} \underline{V} dP \xrightarrow[\text{Ideal Gas}]{} \int_{P_i}^{P_f} \frac{RT}{P} d P  = RT \ln (\frac{P_f}{P_i}) $$
Note also that if we're taking our system to be a mixture, then the chemical potential definition is
$$\mu_i = \frac{\partial G(T,P,N)}{\partial N_i } \xrightarrow[\text{constant T,P}]{} G_\text{entire mixture} = \sum_i N_i \mu_i(T,P)   $$
This is called the partial molar Gibbs Free Energy which just describes how the Gibbs Free energy of a mixture depends on the amount of one component of the mixture. For a pure material $G = N \underline{G}(T,P)$, so $ \underline{G} = \mu $.
Keep in mind that the partial derivatives we are taking are 'nice' in that
$$ \frac{\partial }{\partial P} \frac{\partial G}{\partial N_i} = \frac{\partial }{\partial N_i} \frac{\partial G}{\partial P}$$
so this means that
$$ \frac{\partial }{\partial P} \frac{\partial G}{\partial N_i} = \frac{\partial \mu_i}{\partial P} = \frac{\partial V}{\partial N_i}  $$
Consider a binary mixture of ideal gasses of pressure $P$, total volume $V$, temperature $T$, and total number of moles $N$. Then we know that $$ P V = N R T $$
where $N = N_1 + N_2$, then $$ P V = (N_1 + N_2) RT$$
Define the partial pressure of gas $i$ to be
\begin{gather}
P_i = x_i P = \frac{N_i}{N} \frac{N RT}{ V} = \frac{N_i R T}{V} = c_i R T
\end{gather}
where $P$ is the total pressure of the mixture, and $x_i$ is the mole fraction of $i$. Using
$$\frac{\partial \mu_i}{\partial P} = \frac{\partial V}{\partial N_i}$$
we see
\begin{gather}
\frac{\partial \mu_i}{\partial P} = \frac{\partial V}{\partial N_i} = \frac{\partial }{\partial N_i} \left[ \frac{(N_1 + N_2)RT}{P} \right] = \frac{R T}{P}
\end{gather}
Now we have everything we need.
Isothermally mix two ideal gasses that both are at pressure $P$ before mixing. The change in chemical potential of species $i$ is
$$  \Delta \mu_i = \mu_i(P_\text{final}) - \mu_i(P_\text{initial}) =  \int_{P_\text{initial}}^{P_\text{final}} \frac{\partial \mu_i}{\partial P} d P = \int_{P_\text{initial}}^{P_\text{final}} \frac{RT}{P} dP = RT \ln(\frac{P_\text{final}}{P_\text{intial}}) $$
so we have
\begin{gather}
\Delta \mu_i = RT \ln \frac{x_i P}{P} = RT \ln \frac{P_i}{P} = RT \ln \frac{c_i }{c_0} \\
\Delta \mu_i = RT \ln x_i = RT \ln ( \frac{c_i}{c_0} )
\end{gather}
Now we use the fact that initially, the gasses weren't mixed, which means they were pure thus
\begin{align}
\mu_i(T,P) &= \mu_i(T,P^*) + RT \ln ( \frac{c_i}{c_0} ) \\
&= \mu_i^\circ +  RT \ln c_i - RT \ln c_0  \\
&= \mu_i^\circ + RT \ln c_i - RT \ln 1 \\
&= \mu_i^\circ + RT \ln c_i
\end{align}
here I used $P^* = P$ to signify the starting pressure. I'm sure you've seen this equation before but we can see that the chemical potential is the standard state chemical potential plus the natural logarithm term.
There's a couple other ways to show this, but another sort of way is to notice that \begin{gather}
\frac{\partial \mu_i}{\partial P} = \frac{1}{c_i}
\end{gather}
so
\begin{gather}
\frac{\partial \mu_i}{\partial c_i} = \frac{\partial \mu_i}{\partial P} \cdot \frac{\partial P}{\partial c_i} = \frac{1}{c_i} \cdot RT
\end{gather}
because $\frac{\partial P}{\partial c_i} = \frac{\partial }{\partial c_i}[c_i RT]$
\begin{gather}
\Delta \mu_i = \int \frac{\partial \mu_i}{\partial c_i} = \int \frac{RT}{c_i} = RT\ln c_i \\
\implies \mu_i(T,P) = \mu_i^\circ + RT \ln c_i
\end{gather}
Lastly, as more of an aside, the activity coefficient, $\gamma$, just comes from the modified Raoult's law which I like to think of as a perturbation from ideality
\begin{gather}
P_i = x_i \gamma_i(x_i) P = a_i P
\end{gather}
where $a_i$ is the activity of species $i$. If you carry out the same analysis as above but with the modified Raoult's law instead of $P_i = x_i P$, you will see where the activity/activity coefficient comes into it.
