  In the studies of the Bose-Einstein condensation of ideal gases in finite
systems, the divergence problem usually arises in the equation of state. In
this paper, we present a technique based on the heat kernel expansion and the
zeta-function regularization to solve the divergence problem, and obtain the
analytical expression of the Bose-Einstein condensation temperature for general
finite systems. The result is represented by the heat kernel coefficients, in
which the asymptotic energy spectrum of the system is used. Besides the general
case, for the systems with exact spectra, e.g., ideal gases in an infinite slab
or in a three-sphere, the sums of the spectra can be performed exactly and the
calculation of the corrections to the critical temperatures is more direct. For
the system confined in a bounded potential, the form of the heat kernel is
different from the usual heat kernel expansion. We show that, as long as the
asymptotic form of the global heat kernel can be found out, our method also
works. For Bose gases confined in three- and two-dimensional isotropic harmonic
potentials, we obtain the higher-order corrections to the usual results of the
critical temperatures. Our method also can be applied to the problem of the
generalized condensation, and we give the correction of the boundary on the
second critical temperature in a highly anisotropic slab.
