This is a Non-Perfect Square Trinomial. To factor this type of trinomial, you have to remember this pattern:
[tex](x+b)(x+b)=x^2+(a+b)x+ab[/tex]
So you need to find two numbers [tex]a \ and \ b[/tex] such that the product is [tex]ab[/tex] and the middle term is the sum [tex](a+b)[/tex]. From our polynomial:
[tex]x^2-3x-18[/tex]
Those numbers are:
[tex]a=-6 \\ \\ b=3[/tex]
Because:
[tex]ab=(-6)(3)=-18 \\ \\ a+b=-6+3=-3[/tex]
So:
[tex]\boxed{x^2-3x-18=(x-6)(x+3)}[/tex]