The Hamiltonian is . On a regular family of closed phase-space trajectories, action-angle variables are canonical coordinates in which is periodic modulo and . Hamilton's equations then give and .
The action variable is
The orientation is that of the motion, so the integral is the positive enclosed phase-space area divided by .
A constant-energy phase-space trajectory of the harmonic oscillator is the ellipse
Its area is . Thus the action and slow energy change are
The action variable is an adiabatic invariant when , with staying positive. Averaging over many short oscillations therefore keeps approximately fixed; an increase in frequency increases the energy in the same proportion.