  We provide an exact solution for the interplay between Bose-Einstein
condensation and the Dicke-Hepp-Lieb self-organization transition of an ideal
Bose gas trapped inside a single-mode optical cavity and subject to a
transverse laser drive. Based on an effective action approach, we determine the
full phase diagram at arbitrary temperature, which features a bi-critical point
where the transitions cross. We calculate the dynamically generated band
structure of the atoms and the associated supression of the critical
temperature for Bose-Einstein condensation in the phase with a spontaneous
periodic density modulation. Moreover, we determine the evolution of the
polariton spectrum due to the coupling of the cavity photons and the atomic
field near the self-organization transition, which is quite different above or
below the Bose-Einstein condensation temperature. At low temperatures, the
critical value of the Dicke-Hepp-Lieb transition decreases with temperature and
thus thermal fluctuations can enhance the tendency to a periodic arrangement of
the atoms.
