Since the triangles are similar, we can use ratios to find what x equals.
Ratios:
3x+8/4 = 25/5
The easiest way to solve ratios, in my opinion is to cross multiply.
3x+8*5 = 4*25. Simplify to get 15x + 40 = 100.
Subtract 40 on both sides. 15x = 60.
Divide 15 on both sides. x = 4.