By "x^2+2x-24/3x+18," I'm assuming that you meant
x^2+2x-(24/3)x+18. Combine the x terms: 2x - 8x = -6. I do not think this is the correct interpretation of your problem, so will work on the following instead:
x^2+2x-24/(3x+18) Those parentheses make a huge difference. You
cannot leave them out if you want to be understood
correctly.
24 8
Now we have x^2 + 2x - ---------- = x^2 + 2x - --------
3(x+6) x+6