<s>[INST] Remainder of $\frac{3x^{2019}+5x^{1019}-7x+4}{x^2-1}$ I don't understand how I should go about solving the following question:

Find the remainder when polynomial $f(x)=3x^{2019}+5x^{1019}-7x+4$ is divided by $x^2-1$.

I tried to use the factor theorem, but I never encountered a problem with a divisor which, in this case, is $(x+1)(x-1)$, so I simply found $f$ of both roots, so $f(1)$ and $f(-1)$.
Allegedly the remainder is a linear polynomial in the form $ax+b$ but I fail to see how they derived that fact. Apparently they made use of simultaneous equations, but I'm not sure how or why.
Any help would be appreciated!
 [/INST] Degree of the remainder less then degree of quotient then remainder is linear , $R(x)=ax+b$
$f(x)=3x^{2019}+5x^{1019}-7x+4=Q(x)(x-1)(x+1)+ax+b$
$f(1)=a+b=5$
$f(-1)=-a+b=3$
then $a=1,b=4$
$R(x)=x+4$
OR
To find remainder when
$f(x)=3x^{2019}+5x^{1019}-7x+4$ is divided by $x^2-1$.
By using remainder theorem
$x^2-1=0$
then
$x^2=1$
$f(x)=3x^{2018+1}+5x^{1018+1}-7x+4=3((x^2))^{1009}\times x +5((x^2))^{509}\times x -7x+4=3\times 1 \times x +5\times x\times 1\times x-7x+4=x+4$
Hence
$R(x)=x+4$
</s>