Many quantum mechanical Hamiltonians are time dependent. Methods to solve problems where there is an explicit time dependence is an open subject nowadays. It is important to look for constants of motion or invariants for problems of this kind. For the (time dependent) harmonic oscillator it is possible to write several invariants, among them, the Ermakov–Lewis invariant which is developed below.