If you take three bodies of unknown masses

It's actually a harder problem than you suggest.

Even if you know the masses of all three objects precisely, along with their exact positions and velocities, there is no formula that will predict the exact positions at all points of time in the future (or the past).

Lagrange discovered 5 special cases which have a stable solution, but they require that one of the masses be very small (almost reducing it to a 2-body problem). But this doesn't help the general case.

Mathematically, the restriction is on "

closed form" expressions like the sine function, which has a defined value at all points in time.

The three-body problem is a chaotic system; even the smallest error in the initial conditions can produce arbitrarily large errors in the future. Chaotic systems can be

*simulated* on a computer, but any errors in the initial conditions or rounding errors in the calculations will cause errors to accumulate rapidly, quickly overwhelming the actual answer.

See:

https://en.wikipedia.org/wiki/Three-body_problemPS: Many real planetary systems have far more than 3 planets!