We study a quantum harmonic oscillator undergoing thermalization. To describe
the thermalization process, we generalize the Ermakov-Lewis-Riesenfeld (ELR)
invariant method for the oscillator. After imposing appropriate conditions on
the thermalization process, we introduce an ansatz equation that describes the
time evolution effectively. We write down the first law for thermalization in
the same form as that for ordinary thermodynamics. Here, the thermalization
effect appears through a change of the ELR frequency. Finally, we obtain the
oscillator’s energy undergoing thermalization as a function of entropy and its
time derivative.