When two pure substances mix under normal conditions there is usually an increase in the entropy of the system. 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 an impermeable partition(s) between them, followed by a time for the establishment of a new thermodynamic state of internal equilibrium in the new unpartitioned closed system. Changes in temperature will lead to changes in entropy.
For the mixing of two ideal gases, it is straightforward to obtain an expression for the entropy of mixing. Gas will always flow into a newly available volume and does so because its molecules are rapidly bouncing off one another and hitting the walls of their container, readily moving into a new allowable space. It follows from the second law of thermodynamics that a process will occur in the direction towards a more probable state. In terms of entropy, this can be expressed as a system going from a state of lesser probability (fewer microstates) towards a state of higher probability (more microstates). Since the molecules of ideal gases do not interact the increase in entropy must simply result from the extra volume available to each gas on mixing.
In general, the mixing may be constrained to occur under various prescribed conditions. Changes in volume will lead to changes in entropy. In the customarily prescribed conditions, the materials are each initially at 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. Entropy as a function of temperature at constant volume, S(T), can be determined by integrating the molar specific entropy capacity CV/T (CV: molar specific heat capacity at constant volume). 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 is transferred to or from the surroundings, because of the maintenance of constant pressure and temperature.
When solids, liquids, or gases are combined, the thermodynamic quantities of the system experience a change as a result of the mixing. 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.