Solution (source code)

= Solution

The <disturbing function> may be expanded in harmonics of the planets' orbital angles. Its terms fall into three useful classes:

* <short-period orbital perturbations> involve rapidly varying combinations of mean longitudes and produce bounded oscillations associated with conjunctions;
* <mean-motion resonance> terms have a nearly stationary integer combination of mean longitudes and apsidal angles, so repeated conjunctions act coherently and can drive libration, migration, or eccentricity growth;
* <secular perturbations> survive averaging over both mean longitudes and describe slow exchange of eccentricity and apsidal precession.

Well-separated planets far from resonance are governed on long timescales mainly by the secular terms.