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!)
Thanks for your explanation!