In thermodynamics, the entropy of mixing is the increase in the total entropy when several initially separate systems of different composition, each in a thermodynamic state of internal equilibrium, are mixed without chemical reaction by the thermodynamic operation of removal of impermeable partition(s) between them, followed by a time for establishment of a new thermodynamic state of internal equilibrium in the new unpartitioned closed system.

In general, the mixing may be constrained to occur under various prescribed conditions. In the customarily prescribed conditions, the materials are each initially at a common temperature and pressure, and the new system may change its volume, while being maintained at that same constant temperature, pressure, and chemical component masses. The volume available for each material to explore is increased, from that of its initially separate compartment, to the total common final volume. The final volume need not be the sum of the initially separate volumes, so that work can be done on or by the new closed system during the process of mixing, as well as heat being transferred to or from the surroundings, because of the maintenance of constant pressure and temperature.

The internal energy of the new closed system is equal to the sum of the internal energies of the initially separate systems. The reference values for the internal energies should be specified in a way that is constrained to make this so, maintaining also that the internal energies are respectively proportional to the masses of the systems.Prigogine, I. (1955/1967). Introduction to Thermodynamics of Irreversible Processes, third edition, Interscience Publishers, New York, p. 12.

For concision in this article, the term 'ideal material' is used to refer to either an ideal gas (mixture) or an ideal solution.

In the special case of mixing ideal materials, the final common volume is in fact the sum of the initial separate compartment volumes. There is no heat transfer and no work is done. The entropy of mixing is entirely accounted for by the diffusive expansion of each material into a final volume not initially accessible to it.

On a molecular level, the entropy of mixing is of interest because it is a macroscopic variable that provides information about constitutive molecular properties. In ideal materials, intermolecular forces are the same between every pair of molecular kinds, so that a molecule feels no difference between other molecules of its own kind and of those of the other kind. In non-ideal materials, there may be differences of intermolecular forces or specific molecular effects between different species, even though they are chemically non-reacting.

The statistical concept of randomness is used for statistical mechanical explanation of the entropy of mixing. Mixing of ideal materials is regarded as random at a molecular level, and, correspondingly, mixing of non-ideal materials may be non-random.

Mixing of ideal species at constant temperature and pressure

In ideal species, intermolecular forces are the same between every pair of molecular kinds, so that a molecule "feels" no difference between itself and its molecular neighbors. This is the reference case for examining corresponding mixing of non-ideal species.

For example, two ideal gases, at the same temperature and pressure, are initially separated by a dividing partition.

Upon removal of the dividing partition, they expand into a final common volume (the sum of the two initial volumes), and the entropy of mixing is given by

where is the gas constant, the total number of moles and the mole fraction of component , which initially occupies volume . After the removal of the partition, the moles of component may explore the combined volume , which causes an entropy increase equal to for each component gas.

In this case, the increase in entropy is entirely due to the irreversible processes of expansion of the two gases, and involves no heat or work flow between the system and its surroundings.

Gibbs free energy of mixing The Gibbs free energy change determines whether mixing at constant (absolute) temperature and pressure is a spontaneous process. This quantity combines two physical effects—the enthalpy of mixing, which is a measure of the energy change, and the entropy of mixing considered here.

For an ideal gas mixture or an ideal solution, there is no enthalpy of mixing (), so that the Gibbs free energy of mixing is given by the entropy term only:

For an ideal solution, the Gibbs free energy of mixing is always negative, meaning that mixing of ideal solutions is always spontaneous. The lowest value is when the mole fraction is 0.5 for a mixture of two components, or 1/n for a mixture of n components.

Solutions and temperature dependence of miscibility

Ideal and regular solutions The above equation for the entropy of mixing of ideal gases is valid also for certain liquid (or solid) solutions—those formed by completely random mixing so that the components move independently in the total volume. Such random mixing of solutions occurs if the interaction energies between unlike molecules are similar to the average interaction energies between like molecules.Atkins, P.W., de Paula, J. (2006). Atkins' Physical Chemistry, eighth edition, W.H. Freeman, New York, .K. Denbigh, "The Principles of Chemical Equilibrium" (3rd ed., Cambridge University Press 1971) p.432 The value of the entropy corresponds exactly to random mixing for ideal solutions and for regular solutions, and approximately so for many real solutions.P.A. Rock "Chemical Thermodynamics. Principles and Applications.(MacMillan 1969) p.263

For binary mixtures the entropy of random mixing can be considered as a function of the mole fraction of one component.

For all possible mixtures, , so that and are both negative and the entropy of mixing is positive and favors mixing of the pure components.

The curvature of as a function of is given by the second derivative

This curvature is negative for all possible mixtures , so that mixing two solutions to form a solution of intermediate composition also increases the entropy of the system. Random mixing therefore always favors miscibility and opposes phase separation.

For ideal solutions, the enthalpy of mixing is zero so that the components are miscible in all proportions. For regular solutions a positive enthalpy of mixing may cause incomplete miscibility (phase separation for some compositions) at temperatures below the upper critical solution temperature (UCST). This is the minimum temperature at which the term in the Gibbs energy of mixing is sufficient to produce miscibility in all proportions.

Systems with a lower critical solution temperature Nonrandom mixing with a lower entropy of mixing can occur when the attractive interactions between unlike molecules are significantly stronger (or weaker) than the mean interactions between like molecules. For some systems this can lead to a lower critical solution temperature (LCST) or lower limiting temperature for phase separation.

For example, triethylamine and water are miscible in all proportions below 19 °C, but above this critical temperature, solutions of certain compositions separate into two phases at equilibrium with each other.M.A. White, "Properties of Materials" (Oxford University Press 1999) p.175 This means that is negative for mixing of the two phases below 19 °C and positive above this temperature. Therefore, is negative for mixing of these two equilibrium phases. This is due to the formation of attractive hydrogen bonds between the two components that prevent random mixing. Triethylamine molecules cannot form hydrogen bonds with each other but only with water molecules, so in solution they remain associated to water molecules with loss of entropy. The mixing that occurs below 19 °C is due not to entropy but to the enthalpy of formation of the hydrogen bonds.

Lower critical solution temperatures also occur in many polymer-solvent mixtures.Cowie, J.M.G. "Polymers: Chemistry and Physics of Modern Materials" (2nd edn, Blackie 1991) p.174-176 For polar systems such as polyacrylic acid in 1,4-dioxane, this is often due to the formation of hydrogen bonds between polymer and solvent. For nonpolar systems such as polystyrene in cyclohexane, phase separation has been observed in sealed tubes (at high pressure) at temperatures approaching the liquid-vapor critical point of the solvent. At such temperatures the solvent expands much more rapidly than the polymer, whose segments are covalently linked. Mixing therefore requires contraction of the solvent for compatibility of the polymer, resulting in a loss of entropy.

Statistical thermodynamical explanation of the entropy of mixing of ideal gases Since thermodynamic entropy can be related to statistical mechanics or to information theory, it is possible to calculate the entropy of mixing using these two approaches. Here we consider the simple case of mixing ideal gases.

Proof from statistical mechanics Assume that the molecules of two different substances are approximately the same size, and regard space as subdivided into a square lattice whose cells are the size of the molecules. (In fact, any lattice would do, including close packing.) This is a crystal-like conceptual model to identify the molecular centers of mass. If the two phases are liquids, there is no spatial uncertainty in each one individually. (This is, of course, an approximation. Liquids have a "free volume". This is why they are (usually) less dense than solids.) Everywhere we look in component 1, there is a molecule present, and likewise for component 2. After the two different substances are intermingled (assuming they are miscible), the liquid is still dense with molecules, but now there is uncertainty about what kind of molecule is in which location. Of course, any idea of identifying molecules in given locations is a thought experiment, not something one could do, but the calculation of the uncertainty is well-defined.

We can use Boltzmann's equation for the entropy change as applied to the mixing process

where is the Boltzmann constant. We then calculate the number of ways of arranging molecules of component 1 and molecules of component 2 on a lattice, where

is the total number of molecules, and therefore the number of lattice sites. Calculating the number of permutations of objects, correcting for the fact that of them are identical to one another, and likewise for ,

After applying Stirling's approximation for the factorial of a large integer m: ,

the result is

where we have introduced the mole fractions, which are also the probabilities of finding any particular component in a given lattice site.

Since the Boltzmann constant , where is the Avogadro constant, and the number of molecules , we recover the thermodynamic expression for the mixing of two ideal gases,

This expression can be generalized to a mixture of components, , with

The Flory–Huggins solution theory is an example of a more detailed model along these lines.

Relationship to information theory

The entropy of mixing is also proportional to the Shannon entropy or compositional uncertainty of information theory, which is defined without requiring Stirling's approximation. Claude Shannon introduced this expression for use in information theory, but similar formulas can be found as far back as the work of Ludwig Boltzmann and J. Willard Gibbs. The Shannon uncertainty is not the same as the Heisenberg uncertainty principle in quantum mechanics which is based on variance. The Shannon entropy is defined as: