P(x) of degree at most 5 leaves remainders -1 and 1 on division by $(x-1)^3$ and $(x+1)^3$ respectively, then the number real roots of P(x)=0 are? This is an interesting question I came across. My attempt to do this is for a 3 degree polynomial is given below, but I don't know how to proceed further $$Let\space  g(x) \space be \space the \space quotient \space when \space P(x) \space is \space divided \space by \space (x-1)^3 \space then, $$
$$P(x)=(x-1)^3g(x)-1$$
$$Let \space g(x)=k $$
$$P(-1)=(-2)^3k-1$$
$$1=-8k-1$$
$$\frac{2}{-8}=\frac{-1}{4}=k$$
$$\frac{(x-1)^3}{-4}-1=0$$
On differentiating we see it's an increasing function and can only have one root. Can someone help me when P(x) is a 4  degree or 5 degree polynomial, since I'm getting too many unknown variables.
 A: If $\deg P(x)=5$, then let $a$ be the coefficient of $x^5$ in $P(x)$. Then$$P(x)=(ax^2+bx+c)(x+1)^3+1\quad\text{and}\quad P(x)=(ax^2+dx+e)(x-1)^3-1,$$for some numbers $b$, $c$, $d$, and $e$. It follows from$$(ax^2+bx+c)(x+1)^3+1=(ax^2+dx+e)(x-1)^3-1$$that$$\left\{\begin{array}{l}6a+b-d=1\\3b+c+3d-e=0\\2a+3b+3c-3d+3e=0\\b+3c +d-3e=0\\c+e=-2\end{array}\right.$$and the only solution of this system is$$a=-\frac38,b=\frac98,c=-1,d=-\frac98,\text{ and }e=-1.$$So,\begin{align}P(x)&=\left(-\frac38x^2+\frac98x-1\right)(x+1)^3+1\\&=-\frac38x^5+\frac54x^3-\frac{15}8x\\&=-\frac x8(3x^4-10x^2+15).\end{align}Since the quadratic equation $3X^2-10X+15$ has no real roots, $P(x)$ has one and only one real root, which is $0$.
If $\deg P(x)=4$ similar (but simpler) computations show that there is no such polynomial.
A: Since $\deg(P)\leq 5$ and $(x-1)^3(x+1)^3$ is a divisor of $P(x)+P(-x)$, it yields that $P(x)=-P(-x)$ for all $x\in\mathbb R$. (At this point we know 0 is a root.) Hence, we have
$$P(x)=ax^5+bx^3+cx.$$
Now from $P(1)=-1$, we get $a+b+c=-1$. Further 1 is a triple root of $P+1$, we have $P'(1)=P''(1)=0$. It yields $5a+3b+c=0$ and $20a+6b=0$. By solving the system of linear equation, we have $a=-\frac 38$, $b=\frac 54$ and $c=-\frac{15}{ 8}$.
edit: i corrected the mistake.
A: $(x-1)^3$ and $(x+1)^3$ both divide $P(x)+P(-x)$ which has degree $\le 5$, hence $P$ is odd.
Similarly, $(x-1)^2$ and $(x+1)^2$ both divide $P'(x)$, which has degree $\le 4$. Hence for some constant $\lambda$ we have
\begin{equation}
P'(x) = \lambda(x-1)^2(x+1)^2 = \lambda (x^2-1)^2 = \lambda (x^4 - 2 x^2 + 1)
\end{equation}
Hence by integration
\begin{equation}
P(x) = \lambda (x^5/5 - 2 x^3/3 + x)
\end{equation}
Using that $P(1)=-1$ we get $\lambda =-15/8$ hence
$P(x) = -3 x^5/8 + 5 x^3/4 - 15 x /8$
Observe that $P'(x)\le 0$ hence $P$ decreases, which means that its only root is $x=0$.
