In order to solve for L, the first thing to do in the equation d=LM/r2+r1 is to multiply (r2+r1) to both sides to remove the fraction. This would result in this:
d(r2+r1)=LM
Now that you just have LM left on one side, to isolate L, you must divide both sides by M to get your answer as L=d(r2+r1)/M.