Heisenberg equation and constants of the motion for an anharmonic oscillator in the high-frequency limit