# Deriving remainder of the division of a polynomial using two methods

If $$f(x)=x^3+2x^2+x+2$$, find the remainder when $$f(x)$$ is divided by $$(x+2)^2$$.

I tried two methods.

1. First, using polynomial long division, I got the answer $$5x+10$$.

2. I factored the polynomial as $$f(x)=(x^2+1)(x+2)$$.

So, $$\dfrac{f(x)}{(x+2)^2}=\dfrac{x^2+1}{x+2}$$

But this one gives $$5$$ as the remainder, with long division.

Why is the second method incorrect or what did I miss?

• Both are incorrect. Check your long division, there's only a sign error there... In the second case, how did you conclude $5$ is the remainder, unless you assume divisor is $(x+2)$, which is obviously incorrect? Dec 31, 2021 at 11:59
• @Macavity, sorry it was a typo. Dec 31, 2021 at 12:05

You are doing two different operations. Try to understand this with numbers. If you divide $$10$$ by $$4$$ you get a reminder $$2$$. That's different then when you divide both by $$2$$ first, and the reminder of $$5$$ divided by $$2$$ is $$1$$. So in the first case you write $$p(x)=(x+2)^2q(x)+r(x)$$ In the second case, $$\frac{p(x)}{(x+2)}=(x+2)q(x)+r'(x)$$