Solution (source code)

= Solution

For an isolated system with equally probable accessible microstates, <Boltzmann entropy> is $S=k_B\ln\Omega$. The second law states that an isolated system's total <entropy> cannot decrease; it remains constant in a reversible process and increases in an irreversible one.

The insulated mixture exchanges no heat with its surroundings. At constant pressure, with only pressure-volume work, its <enthalpy> is conserved. Constant and equal <specific heat capacities> therefore give $T_f=(T_1+T_2)/2$. Calculate each <entropy> change along a hypothetical reversible <temperature> path:
$$
\Delta S=Mc_P\ln\frac{T_f}{T_1}+Mc_P\ln\frac{T_f}{T_2}
=\boxed{2Mc_P\ln\left[\frac{T_1+T_2}{2\sqrt{T_1T_2}}\right].}
$$
The surroundings gain no <entropy> through heat exchange; ideal mechanical work carries no <entropy>. The <arithmetic-geometric mean inequality> gives \b[$\Delta S\ge0$], with equality only for $T_1=T_2$. Mixing unequal <temperatures> is irreversible even though total <energy> is conserved.