finding the remainder of $x^{100}-2x^{51}+1$ I have never been great with polynomials.  Here's my problem.
Find the remainder of $f(x)=x^{100}-2x^{51}+1$ when $f$ is divided by $x^2-1$
This sounds easy right?  Why can't I figure it out? My thought was to try and create it such that $f(x)=q(x)g(x)+r(x)$.  But I can not get past getting $deg[r(x)]<deg[g(x)].$
$$f(x)=x^{100}-2x^{51}+1$$
$$=x^{100}-x^{51}-x^{51}+x^2-x^2+1$$
$$=x^{51}(x^{49}-1)-x^2(x^{49}-1)-x^2+1$$
$$=(x^{51}-x^2)(x^{49}-1)-x^2+1$$
$$=x^2(x^{49}-1)(x^{49}-1)-x^2+1$$
$$=x^2[(x^{49}-1)^2-1]+1=?.......$$
I don't see what I am missing

This is the standard approach, especially if you know the roots of the divisor.
Let $f(x) = x^{100} - 2x^{51} + 1$, and  $f(x) = g(x) (x^2-1) + ax + b$ be the division
Then, $0 = f(1) = g(1) ( 1^2 - 1) + a (1) + b = a + b$,
 and $4 = f(-1) =g(-1) ( (-1)^2 -1) + a(-1) + b = -a + b$.
Hence $a= -2, b = 2$.
Thus the remainder is $-2x+2$.
