  We discuss the phenomenon of Bose-Einstein condensation under general
external conditions using connections between partition sums and the
heat-equation. Thermodynamical quantities like the critical temperature are
given in terms of the heat-kernel coefficients of the associated Schr\"odinger
equation. The general approach is applied to situations where the gas is
confined by arbitrary potentials or by boxes of arbitrary shape.
