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$
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$$