Years ago I heard my teacher say that the motivation that Poincaré had to arrive at the famous Poincaré-Bendixson theorem was that a King would give a prize to whoever solves the problem of the trajectories of the solar system, that is, to prove that the trajectory that describes the earth is a closed path, etc etc.
I would like to have a reliable source to read about it, does anyone know where I can find the history of this famous theorem?
Four relevant initiatory references are as follows:
Some notes: Popp's translation is quite readable. Barrow-Green's analysis is quite thorough and it seems to include all the historical intricacies implicit in your question. The final two references are valuable in that they outline how some ideas of Poincaré flourished in time.
As a note, based on the account in Barrow-Green's book, the way the statement is formulated is not accurate (from the historical point of view). Scientists were interested in the $n$-body problem for a long time (Newton worked on the problem), and in particular Poincaré's interest in studying differential equations from the qualitative point of view was motivated by celestial problems. And indeed, as far as I understand the Poincaré-Bendixson Theorem is part of his memoirs on the qualitative study of differential equations which predates the competition.
It also seems to me that Poincaré's Poincaré-Bendixson theorem and his competition work is related mostly in philosophy: the emphasis ought to be in qualitative/geometric methods, instead of analytic calculations. Indeed, in Popp's translation Poincaré cites (p.27) his earlier work on the qualitative theory of differential equations which includes the Poincaré-Bendixson theorem exactly once (and the citation seems to be about normal forms of vector fields, instead of a Poincaré-Bendixson-type statement). This is to be expected, since the Poincaré-Bendixson theorem is about curves on the plane (or more generally codimension-$1$ foliations), whereas the $3$-body problem involves curves in a space of dimension higher than $2$ (or points on the plane).