If these are similar triangles, this means that the ratio of corresponding sides is equivalent. In this case, AB corresponds to DE as CB corresponds to CE. In ratio and proportion form:
AB / CB = DE / CE
x / 5 = (18 - x) / 25
5x = 18 - x
6x = 18
x = 3