Thermodynamics of n-type extrinsic semiconductors