I am sure there is a better strategy that someone smarter than me would use, but I am not that person.
I am trying to factor$$x^3 - 3x^2 - 4x + 12 .$$
I do not know how, so I attempt to guess with long division. I cheat and look at the answer so find out one of the factors to save myself time, so I try $x - 2$.
I am not sure how to type out long division, but I get$$ (x - 2) \mid (x^3 - 3x^2 - 4x + 12) .$$
So I know I can have an $x^2$ for how many times $x$ goes into the leading term.
Subtracting it all, I am left with$$ (x - 2 ) \mid (-x^2 - 4x + 12) .$$
I know that the leading term goes into the inner leading term $-x$ times or however you say that.$$ (x - 2 ) \mid (- 2x + 12) .$$
Now $-2$:$$ (x - 2 ) \mid 8 .$$
Now I do not know what to do, how did this go so wrong? I have $x^2 - x -2$ on top, and I have a remainder of $8$. This cannot be right; I cheated, so I know that this should be a factor.
Your first term, upon division: $x^2$ is correct $\large\checkmark$ (in the quotient), leaving
Here you subtracted incorrectly: We should have $x^2 - x$ in the quotient, that's correct, but multiplying $-x(x - 2) = -x^2 + 2x$
So when we subtract, we subtract, from $(-x^2 - 4x + 12) - (-x^2 + 2x) = -6x + 12$.
Now, we have $$ x -2 \mid -6x + 12$$ and so our ongoing quotient becomes $x^2 - x {\bf - 6}$
which, leaves a zero remainder since $-6(x-2) = -6x + 12$, as desired.
So...we have that $$\frac{x^3 - 3x^2 -4x + 12}{x - 2} = x^2 - x - 6$$
Or, that is, $$x^3 - 3x^2 - 4x + 12 = (x -2)(x^2 - x - 6) = (x-2)(x +2)(x - 3)$$