how do you solve for x in this case?

Answer:
x=12
Step-by-step explanation:
since the triangles are similar their sides are in proportion
50/40 = ( -6+3x) / 24; multiply both sides by 24
50 * 24 / 40 = -6 +3x; simplify the fraction
30 = -6 +3x; add 6 on both sides
30+6 = 3x; add and divide both sides by 3
36/ 3 = x
12 =x
the x is 12
the side is -6 +3*12