You set up the problem correctly, just keep going.
Expand out your expression:
2x(3x-9) + 4x(x+13)
= 6x^2 -18x + 4x^2 + 52x
= 10x^2 +34x
Remember that the above expression is the area, so it is equal to 24.
10x^2 + 34x = 24
10x^2 + 34x - 24 = 0 (divide by 2)
5x^2 + 17x - 12 = 0
Done.