Rational ratio of frequencies leads to isolating integral of motion Padmanabhan's discussion of dynamics mentions that in general the two dimensional harmonic oscillator fills the surface of a two torus.
He further notes that there will be an extra isolating integral of motion provided that the ratio of frequencies is a rational number.

$ -\frac{\omega_{x}}{\omega_{y}}\cos^{-1}\left(\frac{y}{B}\right)+\cos^{-1}\left(\frac{x}{A}\right)=c$
This quantity $c$ is clearly another integral of motion. But- in general - this does not isolate the region where the motion takes place any further, because $\cos^{-1}z$ is a multiple-valued function. To see this more clearly, let us write 
$ x=Acos\left\{c+\frac{\omega_{x}}{\omega_{y}}\Big[Cos^{-1}\left(\frac{y}{B}\right)+2\pi n \Big]\right\}$
Where $Cos^{-1}z$ (with an uppercase C) denotes the principal value. For a given value of $y$ we will get an infinite number of $x$'s as we take $n=0, \pm 1, \pm 2, \dots $
Thus, in general, the curve will fill a region in the $(x,y)$ plane. 
A special situation arises if $(\omega_{x}/\omega_{y})$ is a rational number. In that case, the curve closes on itself after a finite number of cycles. Then $c$ is also an isolating integral and we have three isolating integrals: $(E_{x}, E_{y}, c)$. The motion is confined to closed (one-dimensional) curve on the surface of the torus. 

This last part is not still clear to me.
Can someone please explain why a rational ratio of frequencies make a candidate integral of motion single valued and therefore the motion takes place on a closed (one dimensional) curve on the surface of the two torus? 
 A: Well, it is simple.
If $\omega_x/\omega_y$ is irrational, then the evolution visits the neighborhood of any allowed point in the phase space arbitrarily closely. This is pretty much a more general form of the claim that $\cos kN$ for $k$ irrational and $N\in{\mathbb Z}$ may belong to any interval $R\pm \epsilon$ for any $-1\lt R\lt 1$ and arbitrarily small $\epsilon$. So in the irrational, aperiodic case, there can't be any extra conservation law. Any initial condition is, with the help of some appropriate waiting (shift in time), equivalent to any other within an arbitrarily small $\epsilon$, so the candidate conserved yet continuous quantity has to change by $O(\epsilon)$ where $\epsilon$ is arbitrarily small: it can't change at all. Only trivial (constant) quantities are conserved.
If the frequency ratio is rational, then the trajectory on the phase space is periodic. For example, the vector 
$$ (\cos (p_1/q_1) t, \cos(p_2/q_2) t) $$
where $p_i,q_i$ are integers is periodic in time $t$ with the period $2\pi$ times $q_1q_2$ (over the greatest common divisor of $q_1,q_2$, if you want to make the period as short as possible, the true one) because both coordinates are periodic with this period.
It follows that the closed trajectories on the phase space are non-intersecting (initial conditions uniquely dictate evolution!) compact 1-dimensional curves, topologically circles, and there exist transverse dimensions to these curves that may be used to parameterize these closed curves. These parameters labeling the curves are therefore obviously conserved quantities, by definition, because I assigned one fixed value to each full curve (i.e. to the points in the phase space at any value $t$ given some initial conditions). So the only remaining work in a particular case is to find a convenient form of these conserved parameters.
Note that the Kepler problem of the planetary motion predicts close elliptical curves. The extra conserved quantity associated with this periodicity is the Runge-Lenz vector (pointing from the center to the focus of the ellipse, and this vector may be calculated from $x,p$ at any point along the elliptical orbit). That's perhaps the simplest example of the concept.
Locally on the phase space, one may always define parameters that label the trajectories, as some parameters transverse (or not parallel) to particular trajectories in the phase space. But trying to extend these candidate parameters globally ends up in trouble: if we return to the same small region where we started, we get contradictory values of these parameters: they are not single-valued if the trajectory isn't periodic.
