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? 
 A: We have
\begin{align}
p(x) & = (x-1)q(x) +3\\
p(x) & = (x+1)r(x) - 7\\
p(x) & = (x^2-1)h(x) + (ax+b)
\end{align}
This gives us $p(1) = 3$, $p(-1) = -7$. Hence, we have
$$a+b = 3 \text{ and }-a+b = -7$$
Trust you can finish now.
A: $$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)$.
A: 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.
