Help with proof of polynomial divisor Given $a \in F$ and $f \in F[x]$, show that $(X-a)^2$ is a divisor of $f$ iff $a$ is a root of $f$ and a root of the derivative of $f$.
Here's what I don't understand -- How to prove in regards to the derivative?
This was my proof so far:
Assume $(X-a)^2$ is a divisor but $a$ is not a root, therefore:
$f = q*(X-a)^2 + r$ where $r = 0$. Also $f(a) \neq 0$
Now, if we test for $a$:
$f(a) = q(a)(a-a)^2 + 0 = q(a)*0^2 \neq 0$
$0 \neq 0$
That's a contradiction, therefore a has to be $a$ root of $f$
 A: Let $(X-a)^2$ is a divisor of $f$, then $f=(X-a)^2q$ for some polynomial $q$. Now
of course $f(a)=0$. Also $$f'(x)=2(X-a)q+(X-a)^2q'\implies f'(a)=0.$$
Now for the converse, suppose $a$ is a root of $f$ and a root of $f'$. From $f(a)=0$ we have $f=(X-a)q$ and therefore
$$f'=q+(X-a)q'$$ From $f'(a)=0$ we see that
$$0=f'(a)=q(a)$$
thus $q=(X-a)p$ for some polynomial  $p$, therefore
$$f=(X-a)q=(X-a)^2p$$
A: Suppose that
$(X - a)^2 \mid f(X) \in F[X]; \tag 1$
then
$\exists g(X) \in F[X], \; f(X) = (X - a)^2 g(X); \tag 2$
we have
$f(a) = (a - a)^2 g(a) = 0g(a) = 0, \tag 3$
and
$f'(X) = 2(X - a)g(X) + (X - a)^2 g'(X), \tag 4$
whence
$f'(a) = 2(a - a)g(a) + (a - a)^2g'(a) = 2 \cdot 0 \cdot g(a) + 0 \cdot g'(a) = 0; \tag 5$
thus $a$ is a root of both $f(X)$ and $f'(X)$.
Conversely, if
$f'(a) = f(a) = 0, \tag 6$
then
$\exists g(X) \in F[X], \; f(X) = (X - a)g(X), \tag 7$
whence
$f'(X) = g(X) + (X - a)g'(X);  \tag 8$
then 
$g(a) = g(a) + (a - a)g'(a) = f'(a) = 0; \tag 9$
this in turn implies
$\exists h(X) \in F[X], \; g(X) = (X - a)h(X), \tag{10}$
so that
$f(X) = (X - a)g(X) = (X - a)^2h(X), \tag{11}$
and we conclude that
$(X - a)^2 \mid f(X). \tag{12}$
