Finding a condition on the real $a$ such that $P$ is divisible by $(x-a)^2$ Let $P(x)=\frac{x^3}{6}+\frac{x^2}{2}+x+1$. I have to find a condition on the real $a$ such that $P$ is divisible by $(x-a)^2$.
I tried to use Polynomial long division and solve a system (we need that the  remainder is the zero polynomial).
Using this theorem we have $P(x)=(x-a)^2Q(x)+q_0+q_1x$ where $(q_0,q_1)\in\Bbb{R}^2$.
So using the fact that $a$ is a root and to derive the relation we have to solve
$$
 \left\{
    \begin{array}{ll}\frac{a^3}{6}+\frac{a^2}{2}+a+1=q_0+q_1a\\
    \frac{a^2}{2}+a+1=q_0
    \end{array}
\right.
$$
My problem is that the polynomial $\frac{a^2}{2}+a+1$ doesn't vanish on $\Bbb{R}$.
Where is my mistake?
 A: A nicer trick to determine such $a$ (if it exists) is to note that $a$ is root both of $P$ and of $P'(x)=(2(x-a)Q(x)+(x-a)^2Q'(x)$.
Now $P'(x)= \frac{x^2}2+x+1$, so $a$ must also be a root of $P(x)-P'(x)=\frac {x^3}6$, in other words, we must have $a=0$.
But obviously $0$ isn't even a root of $P$. In other words: No such $a$ exists (and that is also the result of your findings)
A: Hint $\,\ (x\!-\!a)^2\mid P(x)\,\color{#C00}\Rightarrow\, \color{#0a0}{x\!-\!a}\mid P'(x)\,\Rightarrow\, 0 = P'(a) = \frac{a^2}2+a+1,\,$ contra $\,a\in R\ \ $ QED
${\rm\color{#c00}{Indeed}}\,\ P = (x\!-\!a)^2 Q\,\Rightarrow\, P'\! = (\color{#0a0}{x\!-\!a})^2 Q' + 2(\color{#0a0}{x\!-\!a}) Q\,\Rightarrow\,P'(a) = 0$
Remark $\ $ It generalizes as follows. Let $\,P_n(x)$ be the Taylor series of $\,e^x\,$ truncated to order $\,n.$ Then $(e^x)' = e^x\,$ implies $\,P'_n(x) = P_{n-1}(x),\,$ so proceeding by induction as above we find
$\qquad\qquad (x\!-\!a)^n\mid P_{n+1} \Rightarrow\, (x\!-\!a)^{n-1}\mid P_n\,\Rightarrow\,\cdots\Rightarrow\,(x\!-\!a)^2\mid P_3,\ $ contra above
