Chemical potential
In thermodynamics and chemistry, chemical potential, symbolized by , is a term introduced in  by the American mathematical physicist Willard Gibbs, which he defined as follows:
Gibbs noted also that for the purposes of this definition, any chemical element or combination of elements in given proportions may be considered a substance, whether capable or not of existing by itself as a homogeneous body. Chemical potential is also referred to as partial molar Gibbs energy.

# Example
Suppose the chemical potential function defined over a 2D region shown in the figure. Particles will tend to move from regions of high chemical potential (shown as lighter shades in plot) to regions of low chemical potential (shown as darker shades in plot).
Various thermodynamic properties define what the chemical potential is. For example, consider charged particles in a fluid. The pressure gradient in a fluid may push particles in one direction, and the electric potential gradient may push the particles in another. The chemical potential would take both the pressure and electric effects into account and describe a potential distribution, which particles will tend to move down.

# History
In his 1873 paper A Method of Geometrical Representation of the Thermodynamic Properties of Substances by Means of Surfaces Gibbs introduced the preliminary outline of the principles of his new equation able to predict or estimate the tendencies of various natural processes to ensue when bodies or systems are brought into contact.  By studying the interactions of homogeneous substances in contact, i.e. bodies, being in composition part solid, part liquid, and part vapor, and by using a three-dimensional volume-entropy-internal energy graph, Gibbs was able to determine three states of equilibrium, i.e. "necessarily stable", "neutral", and "unstable", and whether or not changes will ensue.  In 1876, Gibbs built on this framework by introducing the concept of chemical potential so to take into account chemical reactions and states of bodies which are chemically different from each other.  In his own words, to summarize his results in 1873, Gibbs states:
In this description, as used by Gibbs,  refers to the internal energy of the body,  refers to the entropy of the body, and \nu is the volume of the body.

# Related terms
The precise meaning of the term chemical potential depends on the context in which it is used.
- When speaking of thermodynamic systems, chemical potential refers to the thermodynamic chemical potential.  In this context, the chemical potential is the change in a characteristic thermodynamic state function per change in the number of molecules. Depending on the experimental conditions, the characteristic thermodynamic state function is either: internal energy, enthalpy, Gibbs energy, or Helmholtz energy. This particular usage is most widely used by experimental chemists, physicists, and chemical engineers.
- Theoretical chemists and physicists often use the term chemical potential in reference to the  electronic chemical potential, which is related to the functional derivative of the density functional, sometimes called the energy functional, found in Density Functional Theory.  This particular usage of the term is widely used in the field of electronic structure theory.
- Physicists sometimes use the term chemical potential in the description of relativistic systems of fundamental particles.

# Thermodynamic chemical potential
The chemical potential of a thermodynamic system is the amount by which the energy of the system would change if an additional particle were introduced, with the entropy and volume held fixed. If a system contains more than one species of particle, there is a separate chemical potential associated with each species, defined as the change in energy when the number of particles of that species is increased by one. The chemical potential is a fundamental parameter in thermodynamics and it is conjugate to the particle number.
The chemical potential is particularly important when studying systems of reacting particles. Consider the simplest case of two species, where a particle of species 1 can transform into a particle of species 2 and vice versa. An example of such a system is a supersaturated mixture of water liquid (species 1) and water vapor (species 2). If the system is at equilibrium, the chemical potentials of the two species must be equal.  Otherwise, any increase in one chemical potential would result in an irreversible net release of energy of the system in the form of heat (see second law of thermodynamics) when that species of increased potential transformed into the other species, or a net gain of energy (again in the form of heat) if the reverse transformation took place. In chemical reactions, the equilibrium conditions are generally more complicated because more than two species are involved. In this case, the relation between the chemical potentials at equilibrium is given by the law of mass action.
Since the chemical potential is a thermodynamic quantity, it is defined independently of the microscopic behavior of the system, i.e. the properties of the constituent particles. However, some systems contain important variables that are equivalent to the chemical potential. In Fermi gases and Fermi liquids, the chemical potential at zero temperature is equivalent to the Fermi energy. In electronic systems, the chemical potential is related to an effective electrical potential.
A way to understand the chemical potential is to consider one mole of methane and 2 moles of oxygen. If a flame is brought near this mixture, the following reaction will occur: CH4 + 2 O2 --> CO2 + 2 H2O  and energy (heat) will be released.
This energy comes from the difference in chemical potential between CH4 and O2 on one hand (higher potential) and CO2 and H2O on the other hand (lower).
The whole energy that will be released will be given by (CH4) + 2 (O2) - (CO2) - 2 (H2O)
Similar examples can be found within batteries where chemical energy is converted into electrical energy.

## Precise definition
Consider a thermodynamic system containing n constituent species. Its total internal energy U is postulated to be a function of the entropy S, the volume V, and the number of particles of each species N1,..., Nn:
By referring to U as the internal energy, it is emphasized that the energy contributions resulting from the interactions between the system and external objects are excluded.  For example, the gravitational potential energy of the system with the Earth are not included in U.
The chemical potential of the i-th species, i is defined as the partial derivative
where the subscripts simply emphasize that the entropy, volume, and the other particle numbers are to be kept constant.
In real systems, it is usually difficult to hold the entropy fixed, since this involves good thermal insulation. It is therefore more convenient to define the Helmholtz free energy A, which is a function of the temperature T, volume, and particle numbers:
In terms of the Helmholtz free energy, the chemical potential is
Laboratory experiments are often performed under conditions of constant temperature and pressure.  Under these conditions, the chemical potential is the partial derivative of the Gibbs free energy with respect to number of particles
A similar expression for the chemical potential can be written in terms of partial derivative of the enthalpy (under conditions of constant entropy and pressure).
Here, the chemical potential has been defined as the energy per molecule. A variant of this definition is to define the chemical potential as the energy per mole.

# Electronic chemical potential
The electronic chemical potential is the functional derivative of the density functional with respect to the electron density.
Formally, a functional derivative yields many functions, but is a particular function when evaluated about a reference electron density - just as a derivate yields a function, but is a particular number when evaluated about a reference point.
The density functional is written as
where \nu(\mathbf{r}) is the external potential, e.g., the electrostatic potential of the nuclei and applied fields, and F is the Universal functional, which describes the electron-electron interactions, e.g., electron Coulomb repulsion, kinetic energy, and the non-classical effects of exchange and correlation.
With this general definition of the density functional, the chemical potential is written as
Thus, the electronic chemical potential is the effective electrostatic potential experienced by the electron density.
The ground state electron density is determined by a constrained variational optimization of the electronic energy.  The Lagrange multiplier enforcing the density normalization constraint is also called the chemical potential, i.e.,
where N is the number of electrons in the system and \mu is the Lagrange multiplier enforcing the constraint.  When this variational statement is satisfied, the terms within the curly brackets obey the property
where the reference density is the density that minimizes the energy.  This expression simplifies to
The Lagrange multiplier enforcing the constraint is, by construction, a constant; however, the functional derivative is, formally, a function.  Therefore, when the density minimizes the electronic energy, the chemical potential has the same value at every point in space.  The gradient of the chemical potential is an effective electric field.  An electric field describes the force per unit charge as a function of space.  Therefore, when the density is the ground state density, the electron density is stationary, because the gradient of the chemical potential (which is invariant with respect to position) is zero everywhere, i.e., all forces are balanced.  As the density undergoes a change from a non-ground state density to the ground state density, it is said to undergo a process of chemical potential equalization.
The chemical potential of an atom is sometimes said to be the negative of the atom's electronegativity.  Similarly the process of chemical potential equalization is sometimes referred to as the process of electronegativity equalization.  This connection comes from the Mulliken definition of electronegativity.  By inserting the energetic definitions of the ionization potential and electron affinity into the Mulliken electronegativity, it is possible to show that the Mulliken chemical potential is a finite difference approximation of the electronic energy with respect to the number of electrons., i.e.,
where IP and EA are the ionization potential and electron affinity of the atom, respectively.

# The values of the chemical potential
For standard conditions (T = 298.15 K; p = 101,325 Pa) the values of the chemical potential are tabulated, see under "Weblinks". If the chemical potential is known in a certain state  (e.g. for standard conditions), then it can be calculated in linear approximation for pressures and temperatures in the vicinity of this state: 
(T) = (T0) + (T  T0)
and 
(p) = (p0) + (p  p0)
Here
\alpha
\left(
		\frac{\partial \mu}{\partial T} 
	\right)_{p,n}
is the temperature coefficient and
\beta
\frac{\partial \mu}{\partial p} 
	\right)_{T,n}
is the pressure coefficient. 
With the Maxwell relations
\left(
		\frac{\partial \mu}{\partial T} 
	\right)_{p,n}
\left(
		\frac{\partial S}{\partial n} 
	\right)_{T,p}
and
\left(
		\frac{\partial \mu}{\partial p} 
	\right)_{T,n}
\left(
		\frac{\partial V}{\partial n} 
	\right)_{T,p}
it follows that the temperature coefficient is equal to the negative molar entropy and the pressure coefficient is equal to the molar volume.

# Fundamental particle chemical potential
In recent years, thermal physics has applied the definition of chemical potential to systems in particle physics and its associated processes.  In general, chemical potential measures the tendency of particles to diffuse.  This characterization focuses on the chemical potential as a function of spatial location.  Particles tend to diffuse from regions of high chemical potential to those of low chemical potential.   Being a function of internal energy, chemical potential applies equally to both fermion and boson particles,  That is, in theory, any fundamental particle can be assigned a value of chemical potential, depending upon how it changes the internal energy of the system into which it is introduced.  The application of chemical potential concepts for systems at absolute zero has significant appeal.
For relativistic systems, i.e., systems in which the rest mass is much smaller than the equivalent thermal energy, the chemical potential is related to symmetries and charges.  Each conserved quantity is associated with a chemical potential.
In a gas of photons in equilibrium with massive particles, the number of photons is not conserved, and so in this case, the chemical potential is zero. Similarly, for a gas of phonons, there is also no chemical potential. However, if the temperature of such a system were to rise above the threshold for pair production of electrons, then it might be sensible to add a chemical potential for the electrical charge. This would control the electric charge density of the system, and hence the excess of electrons over positrons, but not the number of photons. In the context in which one meets a phonon gas, temperatures high enough to pair produce other particles are seldom relevant. QCD matter is the prime example of a system in which many such chemical potentials appear.