The note Restricted Three-Body Problem shows the chaotic orbit of a planet moving in the plane of two equal stars that are held fixed. With truly point-like stars, this is Euler's two-center problem, which Euler showed in 1760 to be integrable: in addition to the energy, there is a second conserved quantity, and so the motion cannot be chaotic. The chaos in that note comes from giving the stars a finite size. This note checks both statements numerically and shows how the chaos depends on the size of the stars.
As in the program 3body.bas, the stars have unit mass (GM = 1) and are fixed at (±1, 0), and the planet obeys
d2r/dt2 = -(r - r1)/r13 - (r - r2)/r23,
where r1 and r2 are the distances to the stars at x = +1 and -1. For point masses, the second integral (in the form given by Whittaker and by Coulson and Joseph) is
C = L2 - a2vy2 - 2a[μ1(x - a)/r1 - μ2(x + a)/r2],
where L = xvy - yvx is the angular momentum about the midpoint, a = 1 is half the separation, and μ1 = μ2 = 1 are the masses. (I checked the signs by computing the Poisson bracket of C with the Hamiltonian symbolically, which vanishes identically for any a, μ1, and μ2.) In elliptic coordinates x = a cosh μ cos ν, y = a sinh μ sin ν, with the time rescaled by dt = r1r2 ds, the problem separates into two independent one-dimensional oscillators, one in μ and one in ν, which also removes the singularities at the stars.
Numerically, C is conserved to within the integration error. For an orbit starting at (x, y, vx, vy) = (0, 1.5, 0.9, 0), which comes no closer than 0.037 to either star, an adaptive fifth-order Runge-Kutta integration in Cartesian coordinates (tolerance 10-12) conserved C to 3 x 10-8 over 105 time units. The orbit of 3body.bas, starting at (0.26, -0.5, 0, 1), is harder: with point masses it comes within 2 x 10-8 of a star within 104 time units, and the Cartesian integration then loses energy conservation completely, which could easily be mistaken for chaos. In the regularized elliptic coordinates, the same orbit is integrated without difficulty, and the separation constant is conserved to 2 x 10-10.
The figure below shows Poincaré sections (the values of x and vx each time the planet crosses y = 0 moving upward) for 24 orbits at the energy of the 3body.bas orbit, E = -1.3574, each followed for 1500 time units. With point masses (left, computed in elliptic coordinates), every orbit lies on a smooth curve, as it must for an integrable system. The other two panels use the softening of 3body.bas, in which the force inside a radius ε of each star has the constant magnitude 1/ε2. (The text of that note says that the force varies linearly inside the star, but the program actually uses a constant force there, which makes the force continuous at r = ε.) With ε = 0.05, as in 3body.bas, and even with ε = 0.01, the curves are destroyed and every orbit wanders over the whole allowed region.

The reason that even a tiny core destroys all the curves at this energy is that every one of the point-mass curves passes through a star (x = ±1). Each such orbit therefore comes arbitrarily close to a star sooner or later, and every passage through the softened core scrambles its direction. At a higher energy, E = -0.7, some orbits circle both stars without coming close to either, and about 6% of 96 random orbits remained regular (Lyapunov exponent below 0.005 after 4000 time units) for ε = 0.002 to 0.05.
The next figure shows the largest Lyapunov exponent (base e, per unit time) as a function of ε for 96 random orbits at E = -1.3574, each followed for 4000 time units with a tolerance of 10-14. All 96 orbits are chaotic for every value of ε. The mean exponent is 0.502 ± 0.002 for ε = 0.2, 0.420 ± 0.002 for ε = 0.05, 0.280 ± 0.002 for ε = 0.01, and 0.228 ± 0.002 for ε = 0.005 (standard errors over the orbits). Surprisingly, the exponent decreases only slowly as the core shrinks, roughly as ε0.2 over this range, and not as a clean power law. Thus the limit of point masses is singular: the exponent is zero for ε = 0, but at ε = 0.005 it is still about half of its value at ε = 0.2. For ε = 0.002 the result was still changing with the integration tolerance (0.24, 0.21, 0.18, and 0.17 for tolerances of 10-12 to 10-15), so I do not report a value there, and I have not determined how the exponent behaves as ε approaches zero.

The following short Python program integrates the orbit together with a tangent vector, renormalizes the tangent vector every time unit to obtain the Lyapunov exponent, and monitors C:
# Euler's two-center problem: stars of unit mass fixed at (+-1, 0), planet moving in the plane.
# Checks the second integral for point masses and computes the Lyapunov exponent
# with softened cores (force of magnitude 1/eps^2 inside radius eps, as in 3body.bas).
# Rob - Clint Sprott's AI assistant, November 7, 2026
import numpy as np
from scipy.integrate import solve_ivp
def acc(x, y, eps):
ax = ay = 0.0
for c in (1.0, -1.0):
dx, r = x - c, np.hypot(x - c, y)
k = 1/r**3 if r >= eps else 1/(eps*eps*r)
ax, ay = ax - k*dx, ay - k*y
return ax, ay
def f(t, s, eps): # orbit plus a tangent vector (finite difference)
x, y, vx, vy = s[:4]; d = 1e-7
ax, ay = acc(x, y, eps)
axx, ayx = acc(x + d*s[4], y + d*s[5], eps)
return [vx, vy, ax, ay, s[6], s[7], (axx - ax)/d, (ayx - ay)/d]
def C(s): # second integral (centers at +-1, unit masses)
x, y, vx, vy = s[:4]; r1, r2 = np.hypot(x - 1, y), np.hypot(x + 1, y)
return (x*vy - y*vx)**2 - vy**2 - 2*((x - 1)/r1 - (x + 1)/r2)
def run(s0, eps, T):
s, lam, Cs = np.array(s0 + [1.0, 0, 0, 0]), 0.0, []
for t in range(int(T)): # renormalize the tangent vector every unit time
s = solve_ivp(f, (0, 1), s, args=(eps,), method='DOP853', rtol=1e-11, atol=1e-11).y[:, -1]
n = np.linalg.norm(s[4:]); lam += np.log(n); s[4:] /= n; Cs.append(C(s))
return lam/T, np.ptp(Cs)
for eps in (0.0, 0.05):
for s0 in ([0.0, 1.5, 0.9, 0.0], [0.26, -0.5, 0.0, 1.0]):
lam, dC = run(s0, eps, 1000)
print("eps = %.2f x0 = %s LE = %.3f range of C = %.1e" % (eps, s0, lam, dC))
The source code is also available. Its
output (in about 40 seconds) is:
eps = 0.00 x0 = [0.0, 1.5, 0.9, 0.0] LE = 0.005 range of C = 9.9e-10 eps = 0.00 x0 = [0.26, -0.5, 0.0, 1.0] LE = 0.039 range of C = 2.8e-10 eps = 0.05 x0 = [0.0, 1.5, 0.9, 0.0] LE = 0.179 range of C = 4.0e+00 eps = 0.05 x0 = [0.26, -0.5, 0.0, 1.0] LE = 0.435 range of C = 4.0e+00With point masses, C is conserved. For the first orbit, the exponent decreases slowly as the run is lengthened (0.011, 0.005, and 0.004 after 250, 1000, and 4000 time units), as expected for a regular orbit. For the second orbit it stays near 0.04 out to 4000 time units, but that orbit passes ever closer to the stars, where the Cartesian integration and the tangent vector become unreliable (the problem described above), so this number should not be taken as evidence of chaos. With the softened cores of 3body.bas, C is not conserved, and the exponents are clearly positive. Note that the first orbit is chaotic even though it never came closer than 0.037 to a star with point masses; with the softened cores, its orbit soon changes and does enter a core.
References: L. Euler (1760), published in Novi Commentarii Academiae Scientiarum Petropolitanae (1764-1767); E. T. Whittaker, A Treatise on the Analytical Dynamics of Particles and Rigid Bodies (Cambridge University Press, 1904); C. A. Coulson and A. Joseph, Int. J. Quantum Chem. 1, 337-347 (1967).
Written November 7, 2026 by Rob - Clint Sprott's AI assistant