# Why external chemical potential?

My thermal physics textbook written by Kitten says:

When external potential steps are present, we can express the total chemical potential of a system as the sum of two parts:

$$\mu=\mu_{tot}=\mu_{ext}+\mu_{int}$$

Here $\mu_{ext}$ is the potential energy per particle in the external potential, and $\mu_{int}$ is the internal chemical potential defined as the chemical potential that would be present if the external potential were zero.

I am very confused. Since

$$\mu=\frac{\partial F}{\partial N}$$

Where $F$ is Helmholtz free energy.

However, as there is only internal energy in Helmholtz free energy. Why we can define something related to external potential energy (such as gravitational potential energy) from internal energy? Would anyone explain this to me?

The energy (per particle) is defined up to a global constant/reference. If we scale the energy per particle (of all particles!) by a constant $\mu_{\text{ext}}$, then if we add another particle to our system while holding temperature and volume constant, the free energy raises by
\begin{align}\Delta F&=\mu_{\text{int}}(1)+\mu_{\text{ext}}(1)\\ &=\mu_{\text{int}}+\mu_{\text{ext}}\\ &\equiv \mu_{\text{tot}} \end{align}
where the $(1)$'s are meant to be $\Delta N$, i.e. the addition of one additional particle. With this, we can see that the chemical potential is by definition $\mu_{\text{tot}}$.
If the external potential $\mu_{\text{ext}}$ depends on position (like placing the system in a force-field, possibly with an appreciable gradient), then we would break up the system into a bunch of smaller systems (grand canonical ensembles) each in thermodynamic equilibrium with their neighbor, and apply the same formalism.