## Remainder

What is the remainder when $x^{2006}-x^{2005}+(x+1)^2$ is divided by $x^2-1$?
Source: NCTM Mathematics Teacher, November 2006

SOLUTION
If a polynomial $P(x)$ is divided by a polynomial $D(x)\neq 0$, there exists a quotient polynomial $Q(x)$ and a remainder polynomial $r(x)$ such that
$P(x)=D(x)Q(x)+r(x)$ with $r(x).
$P(x)= x^{2006}-x^{2005}+(x+1)^2$
$D(x)=x^2-1$
$x^{2006}-x^{2005}+(x+1)^2=x^{2006}-x^{2005}+x^2+2x+1$
Though tedious it is not hard to do the long division by $(x^2-1)$. A first few steps reveal that the quotient equals $x^{2004}-x^{2003}+x^{2002}-x^{2001}+x^{2000}-x^{1999}+\cdots$. Since we are after the remainder and not the quotient, let’s focus our attention on the last stage of the operation. It looks like the following
$.\qquad\quad x^2$
$x^2-1|\overline{x^4-x^3+x^2+2x+1}$
$.\qquad\quad x^4 -x^2$
$.\qquad\quad\overline{\textrm{-}x^3+2x^2}+2x+1$

$.\qquad\quad x^2-x$
$x^2-1|\overline{x^4-x^3+x^2+2x+1}$
$.\qquad\quad x^4 -x^2$
$.\qquad\quad\overline{\textrm{-}x^3+2x^2}+2x+1$
$.\qquad\quad\textrm{-}x^3 +x$
$.\qquad\quad\overline{2x^2+x+}1$

$.\qquad\quad x^2-x+2$
$x^2-1|\overline{x^4-x^3+x^2+2x+1}$
$.\qquad\quad x^4 -x^2$
$.\qquad\quad\overline{\textrm{-}x^3+2x^2}+2x+1$
$.\qquad\quad\textrm{-}x^3 +x$
$.\qquad\quad\overline{2x^2+x+}1$
$.\qquad\quad 2x^2 -2$
$.\qquad\quad\overline{x+3}$
The remainder equals $x+3$.

Answer: $x+3$

Alternative Solution
The divisor $x^2-1=(x-1)(x+1)$. We are going to make two divisions, first by $(x-1)$ then by $(x+1)$. We will get two remainders from which we calculate the final remainder.
The first division (either long or synthetic) by $(x-1)$ yields a remainder of $4$
$\dfrac{x^{2005}(x-1)+x^2+2x+1}{x-1}=x^{2005}+\dfrac{x^2+2x+1}{x-1}$
$=x^{2005}+x+3+\dfrac{4}{x-1}$
The second division of the above expression by $(x+1)$ yields a remainder of $1$.
The rational expressions of the two remainders are $\dfrac{4}{x^2-1}$ and $\dfrac{1}{x+1}$.
$\dfrac{4}{x^2-1}+\dfrac{1}{x+1}=\dfrac{4+x-1}{x^2-1}$
$=\dfrac{x+3}{x^2-1}$
The remainder equals $x+3$.