# How to divide a polynomial by a binomial using factoring when there could be a “remainder”

I've learned how to divide a polynomial by a binomial by using the long division trick, and although I get how it works, i'd rather use factoring to get the answer. For example: $(3x^2 + 16x -35)/(x + 7)$ = $(3x^2 + 21x -5x -35)/(x + 7)$ = $((3x^2 + 21x) + (-5x - 35)) / (x + 7)$ = $3x(x + 7) -5(x + 7)) / (x + 7)$ = $(3x - 5)(x + 7)) / (x + 7)$ = $(3x - 5)$. It looks complex but that because I typed every step, it's a lot more simple and easy to understand than the long division trick.

However, I am having trouble factoring out the denominator when there would be a remainder if you did the log division way. For example: $(x^4 - 2x^3 - 42x + 20) / (x - 4)$. I can't find any way to factor out $(x - 4)$. In the long division way, you would put the remainder over the denominator, in this case the answer is $x^3 + 2x^2 +8x - 10 + (-20 / (x - 4))$. Any help would be appreciated, thanks.

Just like in the long division method, each step you should ask "by what do I need to multiply $(x - 4)$ to get the leading coefficient"? In the beginning, you can't necessarily factor out $(x-4)$ (because then there would be no remainder) but you can factor out $(x-4)$ modulo powers of $x^3$ and reduce your problem to a problem in which the nominator has a lower degree and so on.
$$\frac{x^4 - 2x^3 - 42x + 20}{x - 4} = \frac{(x-4)(x^3) + (4x^3 - 2x^3 - 42x + 20)}{x - 4} = x^3 + \frac{2x^3 - 42x + 20}{x - 4} \\ = x^3 + \frac{2x^2(x-4) + 8x^2 - 42x + 20}{x - 4} \\ = x^3 + 2x^2 + \frac{8x^2 - 42x + 20}{x-4} = x^3 + 2x^2 + \frac{8x(x - 4) -10x + 20}{x - 4} \\ = x^3 + 2x^2 + 8x - \frac{10x - 20}{x-4} = x^3 + 2x^2 + 8x - \frac{10(x-4) + 20}{x-4} \\ = x^3 + 2x^2 + 8x - 10 - \frac{20}{x-4}.$$
• What do you mean by "(x - 4) modulo powers of $x^3$" – Vityou Oct 11 '16 at 2:41
• @codersarecool I mean that when you try to factor out $(x-4)$ out of $x^4 - 2x^3 - 42x + 20$, you shouldn't expect to be able to write $x^4 - 2x^3 - 42x + 20 = (x-4)f(x)$ but you can always write $x^4 - 2x^3 - 42x + 20 = (x-4)f(x) + g(x)$ where $g$ is of degree three or less (and so involves powers of $x$ up to at most $x^3$). – levap Oct 11 '16 at 2:46
• @codersarecool: Try to do for example $\frac{3x^2 + 16x - 36}{x + 7}$. How would you factor out $x + 7$? In your first example, you were lucky in that there is no remainder but in general, you can only factor $(x+7)$ out "ignoring lower order terms". – levap Oct 11 '16 at 2:49