In classical density functional theory, one traditionally calculates the chemical potential by taking the variational derivative, \begin{equation} \mu_{i} = \frac{\delta F}{\delta \rho_{i}}\tag{1} \end{equation} of the Helmholtz free energy \begin{equation} F[\rho] = \int d\textbf{r} f(\rho, \nabla \rho, ...) \textrm{.}\tag{2} \end{equation}
However, this is not directly analogous to the chemical potential in classical thermodynamics. In the latter theory, the chemical potential is defined as a partial derivative with respect to the number of moles, \begin{equation} \hat{\mu}_{i} = \frac{\partial A}{\partial n_{i}} \end{equation} where $A$ is the homogeneous Helmholtz free energy analogous to $F$. Importantly, $n_{i}$ is an extensive quantity (e.g. $n_{i} = \rho_{i} V$, where $V$ is the system volume). This means that $\mu_{i}$, defined in DFT is actually analogous to the derivative \begin{equation} \mu_{i} = \frac{\partial A}{\partial \rho_{i}}\tag{3} \end{equation}
How then does one obtain the actual analogue, \begin{equation} \hat{\mu}_{i} = \frac{\delta F}{\delta n_{i}}\tag{4} \end{equation} to the traditional chemical potential? Is this generalization correct? If so, how does one go about computing such a quantity when the number of moles $n_{i}$ is now itself a functional of the density, \begin{equation} n_{i} = \int d\textbf{r} \rho_{i}(\textbf{r})\tag{5} \end{equation}
Aside:
- It is clear that $\partial A/\partial \rho_{i}$ is related to the difference between chemical potentials for an incompressible, multicomponent system, e.g. http://dx.doi.org/10.1103/PhysRevE.83.061602. Because of this, it is sometimes called an "exchange" chemical potential, e.g. https://doi.org/10.1039/C6SM02839J.
- There is also a connection between the exchange chemical potentials and the osmotic pressure, $\pi = \partial A/\partial V$. It is not clear to me how one can calculate the osmotic pressure from a functional either, since it is also an extensive quantity.
Related: