<s>[INST] What is the remainder $ax+b$ when a cubic polynomial $P(x)$ is divided by $x^2-1$? If a cubic polynomial $P(x)$ with real coefficients has remainder 3 when divided by $x-1$ and remainder -7 when divided by $x+1$,
What is the remainder $ax+b$ when divided by $x^2-1$?
I see that since $$P(n) = ax^3 + bx^2 + cx + d$$ then $$P(1) = a + b + c + d = 3 $$ while $$P(-1) = -a + b - c + d = -7$$
I know $x^2-1$ is $(x-1)(x+1)$
I'm stuck here - how can I solve this? Could you please help? 
 [/INST] $$P(x)\equiv 3\pmod{x-1}\\P(x)\equiv -7\pmod{x+1}$$
Now $(x+1)\cdot \frac{1}{2} + (x-1)\cdot\frac{-1}{2}=1$
So applying Chinese remainder theorem on polynomials;
$$P(x)\equiv 3\cdot\frac{x+1}{2} + (-7)\cdot (-\frac{x-1}{2})=5x-2\pmod{(x-1)(x+1)}$$
This is true for any $P(x)$, not just cubic $P(x)$.
</s>