2+x-18/(x-3)-(x^2-9)

You should use more parentheses or brackets to clarify what the numerator and denominmator are.

I assume you want to simplify
[2+x-18]/[(x-3)-(x^2-9)]

The numerator can be simplified to x - 16. The denominator can be simplified to (x-3)[1 -(x+3)] = -(x-3)(x+2)