∆PQR and ∆SQT are similar, so corresponding sides occur in fixed ratios with one another. This means
SQ / PQ = ST / PR
Solve for x :
8 / ((x + 5) + 8) = (x - 9) / 21
8 / (x + 13) = (x - 9) / 21
168 = (x - 9) (x + 13)
168 = x² + 4x - 117
x² + 4x - 285 = 0
(x + 19) (x - 15) = 0
⇒ x = -19 or x = 15
But x can't be smaller than 9, otherwise ST = x - 9 would be a negative length. So x = 15.