Let `(8 + x)/(21 + x) = (13 + x)/(31 + x)`. Then, ` (8 + x)(31 + x) = (13 + x)(21 + x)` or `39x + 248 = 34x + 273` or `5x = 25` or ` x = 5`.