Firstly, factor out the GCF, or greatest common factor. To find the GCF, list the factors of each term and the greatest one they share is their GCF. In this case, the GCF is 3:
[tex]3[x^2+3x-18][/tex]
Next, we are going to be factoring by grouping. But first, what two terms have a product of -18x^2 and a sum of 3x? That would be 6x and -3x. Replace 3x with -3x + 6x:
[tex]3[x^2-3x+6x-18][/tex]
Next, factor x^2 - 3x and 6x - 18 separately. Make sure that they have the same quantity on the inside of the parentheses:
[tex]3[x(x-3)+6(x-3)][/tex]
Now you can rewrite it as [tex]3[(x+6)(x-3)][/tex] , which is your final answer.