Let r_{1} and r_{2} be the positive radii of the two masses, M_{1} and M_{2}, about their common center of gravity.
Equating the gravitational force to the centrifugal forces generally gives

M_{1}M_{2}G/(r_{1}+r_{2})^{2} =
ω^{2}r_{1}M_{1} = ω^{2}r_{2}M_{2}

To shorten the equations I will assume that the angular velocity ω = 1 and that the sum of the two masses is 1—indeed that the masses are m and (1− m). I also assume units that make the gravitational constant G = 1. In our case this becomes

m(1−m)/(r_{1}+r_{2})^{2} = r_{1}m = r_{2}(1−m)

r_{1} and r_{2} are measured from the center of gravity and their ratio is the inverse of the mass ratio:

r_{1}/r_{2} = (1−m)/m,

or

r_{1} = r_{2}(1−m)/m

Substituting this r_{1} into the first equation gives

m(1−m)/(r_{2}(1−m)/m+r_{2})^{2} = r_{2}(1−m)

and multiplying by r_{2}^{2}/(1−m) gives

m/((1−m)/m+1)^{2} = r_{2}^{3}

or

m^{3} = r_{2}^{3}

or

r_{2} = m

and by symmetry

r_{1} = 1−m

I find this suspiciously simple!
We will take the position of the first particle to be negative, for they are on opposite sides of the origin.
r_{1} is the distance from the origin so the r coordinate of the first particle is m − 1.
Now the acceleration of a test particle at radius r on the line thru the two masses:

a = r + m/(r − (m − 1))^{2} + (1 − m)/(r − m)^{2}

Alas the plus signs in the above equation must be changed to minus depending on which Lagrange point we seek as the masses always attract (push towards the mass, whichever direction) whereas the terms are always positive and push towards positive r.
The above form is for L2, nearer the secondary than the primary.
As the expression stands this leads to a polynomial in r which must be 0 for equilibrium:
This scheme code finds the following:

p = ((1)r^{5} + (−4m + 2)r^{4} + (6m^{2} + −6m + 1)r^{3} + (−4m^{3} + 6m^{2} + −2m + 1)r^{2}
+ (1m^{4} + −2m^{3} + 1m^{2} + −4m + 2)r
+ (3m^{2} + −3m + 1)).

First I try m = 0.1 to calculate a real number for L1:

r^{5} + 1.6r^{4} + .46r^{3} + .856r^{2}
+ 1.6081r + .73 = 0

With the kind help of Polynomial root finder, Newton’s method and Mathematica we find a root at − 1.2596998329023314374. That solution makes the expression for the acceleration vanish and seems physically reasonable.

Now we move to the interval between the two masses to seek L1 and flip the sign of the attraction of the first mass getting:

a = r − m/(r − (m − 1))^{2} + (1 − m)/(r − m)^{2}

from which our program derives:

((1)r^{5} + (−4m + 2)r^{4} + (6m^{2} + −6m +
1)r^{3} + (−4m^{3} + 6m^{2} + −4m + 1)r^{2}
+ (1m^{4} + −2m^{3} + 5m^{2} + −4m + 2)r
+ (−2m^{3} + 3m^{2} + −3m + 1))

And in our case for m = 0.1:
(1r^{5} + 8/5r^{4} + 23/50r^{3} + 82/125r^{2}
+ 16481/10000r + 91/125)

which has a root at −0.60903511002320256380.

And finally:

a = r − m/(r − (m − 1))^{2}
− (1 − m)/(r − m)^{2}

for L3 yielding polynomial

((1)r^{5} + (−4m + 2)r^{4} + (6m^{2} + −6m
+ 1)r^{3} + (−4m^{3} + 6m^{2} + −2m + −1)r^{2}
+ (1m^{4} + −2m^{3} + 1m^{2} + 4m + −2)r
+ (−3m^{2} + 3m + −1))

which for m = 0.1 is

(1r^{5} + 8/5r^{4} + 23/50r^{3}
− 143/125r^{2} − 15919/10000r − 73/100)

which has a root at 1.07164421940572131 .

For m = 0.000002, as for the Sun-Earth combination, we get solutions:

L2: −1.0087591722713581551

L1: −0.99128770335330933876

L3: 1.0000008333333333507

The units are AU’s. Keep in mind that these locations are relative not to the Sun but to the center of gravity. The distance from the Sun to L3 is 0.9999988333333335.

We call the three points at the top tl, tc and tr, and the three at the bottom, bl, bc and br. Each horizontal cut thru this picture locates the two masses and the three Lagrange points. The center of gravity is the always the center of the cut. The vertical coordinate is m with m=0 at the top and m=1 at the bottom. The horizontal coordinate is r and r=0 at tc and bc, the center of gravity. The first mass, M

The surprise is that for m=1/2 those points are unstable.

distance from center | gravitational force | centrifugal force |

.86 | .8736 | .86 |

.87 | .8610 | .87 |

Here is a promising applet with source. See too this compound pendulum together with source code.