A new, simple but general analytic description of the band discontinuities at a semiconductor heterojunction is derived from the fundamental electrochemical principle. We include the effects of nonuniform band structure and carrier degeneracy (Fermi-Dirac statistics), dielectric image forces, quantum-mechanical exchange-correlation forces, and dipole forces across the interface. These nonideal effects (band model parameters) are expressed in terms of the activity coefficients (thermodynamic parameters) of the carriers. Furthermore, we find a simple but general correlation between the energy band discontinuities and the activity coefficients of the carriers. Such a mathematical link between the two quantities shows that the thermodynamic parameters are important to the physics that determines the band discontinuities.