This is in the original post, in the form

  num(b)/denom(b) = b - 2 + (b-1)/denom(b)
so you just need to clear the denominator.