# Remainder of polynomial divisions(with degrees more than 1)

Let's say we want to calculate the remainder of $$x^7+5x^3+2x+3$$ divided by $$x^2 + 1$$

My teacher told us to this:

$$x^7+5x^3+2x+3=(x^2+1)Q_{(x)}+r {(x)}$$ $$({x^2})^3x+5(x^2)x +2x+3=(x^2+1)Q_ {(x)}+r _{(x)}$$

Let $x^2=-1$

$$({-1})^3x+5(-1)x +2x+3=((-1)+1)Q_ {(x)}+r _{(x)}$$

So

$$r_{(x)}=-x-5x+2x+3=-4x+3$$

The only problem is: i don't understand why it's legal (!) to assign a value to $x^2$ and not $x$ (won't x be equal to $i$ anyway?) and then calculate the function.

(I know that If it was $x+1$ instead of $x^2+1$ i could calculate the function for $x=-1$ with no problem!)

• If you set $x^2=-1$ then you also must set $x=i$. – StubbornAtom Nov 18 '16 at 6:23
• So is this method wrong? but it ends up with the right answer – Rima Nov 18 '16 at 6:25
• Maybe the reason is that if you have $x=i$, it's like if you changed of variable your polynomial. – MonsieurGalois Nov 18 '16 at 6:30

The "trick" is legitimate, though maybe not entirely obvious.

Let $P(x)=x^7+5x^3+2x+3$, and define the polynomial in $2$ variables:

$$S(u,v)=v^3 u + 5 v u + 2 u + 3$$

It is easily verified that $P(x)=S(x,x^2)$.

Consider now $S$ as a polynomial in $v$ alone with $u$ as a parameter, then the remainder of the division by $v+1$ will be $S(u,-1) = -4u+3$ so for some quotient $T(u,v)$:

$$S(u,v)=(v+1)T(u,v) + (-4u+3)$$

Now substitute $u=x, v=x^2$ back and you get:

$$P(x)=(x^2+1)Q(x) + (-4x+3)$$

where $Q(x)=T(x,x^2)$ so $\;-4x+3\;$ is indeed the remainder of the division of $P(x)$ by $x^2+1$.

• So by assuming a two variable function: yes i can assign a value to any part(variable) of function i want. Is that correct? – Rima Nov 18 '16 at 7:30
• @Rima At that point, think of $S$ as a polynomial in one variable, $v$. More formally, you can call that polynomial $S_u(v) = S(u,v)$. Then everything you know about polynomials in one single variable applies to $S_u(v)$ as well, including the remainder of the division by $v+1$ being $S_u(-1)$. – dxiv Nov 18 '16 at 7:41