The method is easy, but the format is difficult to show. I'll do my best.

#(x^2 -3x -18) div (x-6)#

#" (dividend) " div " (divisor)"#

#color(magenta)("step 1:")# Dividend must be in descending powers of x.

#color(white)(xxxxxxxxxxxxxxxxxxxxxxxx)x^2 " "-3x" " -18#

Only use the numerical coefficients # rArr 1" "-3" "-18 "#

(If there are any missing, leave a space or fill in a zero).

#color(orange)("Step 2")#: Make the divisor = 0. # " "(x-6) = 0 rArr x = color(orange)(6) " this goes outside"#

#color(white)(xxxxxxxxx) | color(brown)(1)" "-3" "-18 " "color(magenta)("step 1")#

#color(white)(xxxxxx)color(orange)(6) " "| darr " "color(red)(6) " "color(blue)(18)#

#color(white)(xxxxxxxxxx) ul(" ")#

#color(white)(xxxxxxxxxxx) color(brown)(1) " "color(blue)(3) " "color(teal)(0) larr "no remainder!"#

#color(white)(xxxx.. xxxxx)uarr " "uarr#

#color(white)(xxxxxxxxxxx) x " "x^0#

Step 3: Begin the division:

-#"Bring down the " color(brown)( 1
) " to below the line"#

-#"multiply " color(orange)(6) xx color(brown)(1) = color(red)(6)#

#"Add" -3+color(red)(6) = color(blue)(3)#

-#"multiply " color(orange)(6) xx color(blue)(3) = color(blue)(18)#

#"Add" -18+color(blue)(18) = color(teal)(0)#

That's it Folks!

We have now found the numerical coefficients of the terms in the quotient (answer)

We divided an expression with #x^2# by an expression with #x#,

so the first term will be #x^2/x = x#

The last value is the remainder. In this case it is #color(teal)(0)#

This means that #x-6# is a factor of #x^2 -3x -18#

#(x^2 -3x -18) div (x-6) = color(brown)(1)x +color(blue)(3), "rem " color(teal)(0)#