Using the results from either Maxwell–Boltzmann statistics, Bose–Einstein statistics or Fermi–Dirac statistics we use the Thomas–Fermi approximation (gas in a box) and go to the limit of a very large trap, and express the degeneracy of the energy states ( g i ) as a differential, and summations over states as integrals. We will then be in a position to calculate the thermodynamic properties of the gas using the partition function or the grand partition function. Only the case of massive particles will be considered, although the results can be extended to massless particles as well, much as was done in the case of the ideal gas in a box. More complete calculations will be left to separate articles, but some simple examples will be given in this article.