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? 

For the titled question: $\ {\rm mod}\,\ x^2\!-\!1\!:\,\ \color{#c00}{x^2\equiv 1}\,\Rightarrow\, (ax\!+\!b)\color{#c00}{x^2}\!+cx\!+\!d\,\equiv\, (ax\!+\!b)+cx\!+\!d$
To solve the problem it is better to use Lagrange interpolation (= CRT) to solve the system  $\ P \equiv P(-1)\,\pmod{x\!+\!1},\, $ $\ P\equiv P(1)\,\pmod {x\!-\!1},\ $ yielding
$$ \begin{align}  1\  \ =\ \ \color{#0a0}{\frac{1}2}\ \ & (x+1) \quad\! -\!\quad \color{#c00}{\frac{1}2}\ \ (x-1)\\[4pt] \iff \ P \,\equiv\, \frac{P(1)}{\color{#0a0}2} &(x+1) \color{#c00}- \frac{P(-1)}{\color{#c00}2} (x-1) \pmod{x^2-1}\end{align}$$
where we used the method of reading the CRT solution from the Bezout identity for the moduli.
