Answer:
imagine the upper triangle as the same as the lower one, but rotated by 180° around the corner point they share, and resized.
the base of the smaller triangle is resized by a factor of 3/4.5, or reduced: 1/1.5
we just take the length from the hypotenuse of the bigger triangle and resize it to, either by multiplying with 1/1.5 or by dividing by 1.5
personally, I find the latter easier.
x = 7.5/1.5 = 5