An ideal Maxwell-Boltzmann gas confined in various rectangular nanodomains is considered under quantum size effects. Thermodynamic quantities are calculated from their relations with the partition function, which consists of triple infinite summations over momentum states in each direction. To obtain analytical expressions, summations are converted to integrals for macrosystems by a continuum approximation, which fails at the nanoscale. To avoid both the numerical calculation of summations and the failure of their integral approximations at the nanoscale, a method which gives an analytical expression for a single particle partition function (SPPF) is proposed. It is shown that a dimensional transition in momentum space occurs at a certain magnitude of confinement. Therefore, to represent the SPPF by lower-dimensional analytical expressions becomes possible, rather than numerical calculation of summations. Considering rectangular domains with different aspect ratios, a comparison of the results of derived expressions with those of summation forms of the SPPF is made. It is shown that analytical expressions for the SPPF give very precise results with maximum relative errors of around 1%, 2% and 3% at exactly the transition point for single, double and triple transitions, respectively. Based on dimensional transitions, expressions for free energy, entropy, internal energy, chemical potential, heat capacity and pressure are given analytically valid for any scale.