To solve for r, you would start by subtracting p from both sides.
2m - p = -q/r
Multiply everything by r.
2mr - pr = -q
Factor r out of the left side of the equation.
r(2m - p) = -q
Divide both sides by (2m - p).
r = [tex]\frac{-q}{2m-p} = \frac{q}{2m + p}[/tex].