(x^2-x-6)/(x-3) factor the numerator
[ (x + 2) (x - 3) ] / (x - 3) cancel the(x - 3)'s
x + 2
Step 1: Divide the first term under the long division line by the first term outside it, \(\frac{x^2}{x}\) in this case
Step 2: Multiply the newest term ontop of the division line with each term on the outside -> \(x*x + x*-3\)
Step 3: Subtract the 2nd line from the 1st -> \((x^2-x) - (x^2-3x) = 2x\)
Step 4: Repeat steps 1 to 3 eg: \(\frac{2x}{x}=2\) ...
Whats left up top is the factorised version.