text: The chemical potential μ of species i (atomic, molecular or nuclear) is defined, as all intensive quantities are, by the phenomenological fundamental equation of thermodynamics. This holds for both reversible and irreversible infinitesimal processes:
  where dU is the infinitesimal change of internal energy U, dS the infinitesimal change of entropy S, dV is the infinitesimal change of volume V for a thermodynamic system in thermal equilibrium, and dN is the infinitesimal change of particle number N of species i as particles are added or subtracted. T is absolute temperature, S is entropy, P is pressure, and V is volume. Other work terms, such as those involving electric, magnetic or gravitational fields may be added.
  From the above equation, the chemical potential is given by
  This is because the internal energy U is a state function, so if its differential exists, then the differential is an exact differential such as
  for independent variables x, x, ... , x of U. This expression of the chemical potential as a partial derivative of U with respect to the corresponding species particle number is inconvenient for condensed-matter systems, such as chemical solutions, as it is hard to control the volume and entropy to be constant while particles are added. A more convenient expression may be obtained by making a Legendre transformation to another thermodynamic potential: the Gibbs free energy . From the differential  (for  and , the product rule is applied to) and using the above expression for , a differential relation for  is obtained:
  As a consequence, another expression for  results:
  and the change in Gibbs free energy of a system that is held at constant temperature and pressure is simply
  In thermodynamic equilibrium, when the system concerned is at constant temperature and pressure but can exchange particles with its external environment, the Gibbs free energy is at its minimum for the system, that is . It follows that
  Use of this equality provides the means to establish the equilibrium constant for a chemical reaction.
  By making further Legendre transformations from U to other thermodynamic potentials like the enthalpy  and Helmholtz free energy , expressions for the chemical potential may be obtained in terms of these:
  These different forms for the chemical potential are all equivalent, meaning that they have the same physical content, and may be useful in different physical situations.