Mixing and separation are fundamental processes in material making. Here, thermodynamic bases of mixing and separation are discussed for solutions (a mixture of solute and solvent) and gels (a mixture of polymer network and solvent). It is shown that all equilibrium properties of these materials are calculable from the free energy function, written as a function of temperature and concentration (for solutions) or temperature and stretch ratio (for gels).