The triangles are similar
so
(x+8)/42 = 24/(2x-4)
(x+8)(2x-4) = 24 * 42
2x^2 + 16x - 4x - 32 = 1008
2x^2 + 12x - 32 = 1008
2x^2 + 12x - 1040 = 0
2(x^2 + 6x - 520) = 0
2(x + 26)(x - 20) = 0
x + 26 = 0; x = -26
x - 20 = 0; x = 20
Since the side of triangle can't be negative so x = 20
Answer
x = 20