Explanation:
the upper (smaller) triangle and the complete triangle are similar.
that means the angles in both triangles are the same. and the lengths of all corresponding pairs of sides correlate with the same scaling factor.
therefore,
(8x - 10) / (8x - 10 + 18) = 25 / (25 + 15)
(8x - 10) / (8x + 8) = 25 / 40 = 5/8
8(8x - 10) = 5(8x + 8)
64x - 80 = 40x + 40
24x = 120
x = 5