In the late 19th century, George Hill first derived a set of equations that approximately govern the motion of a small mass in a hierarchical 3-body system.
In the 2-D case, Hill's equations become (in non-dimensional terms)
| x'' - 2 y' | = | 3(-1/d3 + 1) x |
| y'' + 2 x' | = | -3y/d3 |
Where the frame is fixed on m2 and x points away from m1. d is the distance to m2 (sqrt(x2+y2)).