This question is very similar (but not identical) to this one:
Finding the distance between two gears
(actually, we are trying to solve it on Bicycle Exchange: https://bicycles.stackexchange.com/q/8608/2355)
The exact question is: "given two gears (pulleys, cilinders) with known radius, and a closed belt (chain, loop, rope) with known length (perimeter), how to calculate the maximum distance between the axles of the gears (that is, when they are pulled apart from each other)"?
The ilustration:
The equation we got so far:
$2B = L - R \left( \pi + 2\tan^{-1} \left( \frac{(R-r)}{B} \right) \right) - r \left( \pi - 2\tan^{-1} \left( \frac{(R-r)}{B} \right) \right)$
The main problem is that the unknown B appears on both sides and doesn't seem to be possible to isolate it.
Would it be possible to solve this problem algebrically, or only iteratively?