Because the figures are similar, they have same proportion for the sides.
Compare the sides
hypotenuse/base = hypotenuse/base
(x - 9) / 4 = (x + 1) / 9
Do cross multiplication, then simplify
9(x - 9) = 4(x + 1)
9x - 81 = 4x + 4
9x - 4x = 4 + 81
5x = 85
x = 85/5
x = 17
For clear understanding, see my attachment