text: The Hamiltonian is a function of J only, and in the simple case of the harmonic oscillator,
  When H has no time dependence, J is constant. When H is slowly time-varying, the rate of change of J can be computed by re-expressing the integral for J:
  The time derivative of this quantity is
  Replacing time derivatives with theta derivatives, using  and setting  without loss of generality ( being a global multiplicative constant in the resulting time derivative of the action) yields 
  So as long as the coordinates J,  do not change appreciably over one period, this expression can be integrated by parts to give zero. This means that for slow variations, there is no lowest-order change in the area enclosed by the orbit. This is the adiabatic invariance theorem the action variables are adiabatic invariants.
  For a harmonic oscillator, the area in phase space of an orbit at energy E is the area of the ellipse of constant energy,
  The x radius of this ellipse is  while the p radius of the ellipse is . Multiplying, the area is . So if a pendulum is slowly drawn in, such that the frequency changes, the energy changes by a proportional amount.