Whenever we have a segment in a triangle drawn parallel to a base.....it splits the sides proportionally
Thus
AB / BC = AE / ED
25 / 15 = 7x - 40 / 18 reduce the fraction on the left
5 / 3 = 7x - 40 / 18 cross-multiply
18 * 5 = 3 [ 7x - 40 ] simplify
90 = 21x - 120 add 120 to both sides
210 = 21x divide both sides by 21
10 = x