solve the equation for r: S= (rL-a)/(r-x)

Sr -Sx = rL -a

r(S - L)= Sx -a

r = (Sx -a)/(S - L)