If derivative of an irreducible polynomial is non zero then the polynomial is separable

My problem is that I don't have idea how to complete one side of the proof.

For any field $k$ an irreducible polynomial $p \in k[x]$ is called separable if for all field extensions of $k$ all roots of $p$ are simple or equivalently $p$ has no multiple roots.

Theorem

An irreducible polynomial $p$ is separable iff $p' \neq 0$ as $k \to k$ function.

Proof

(assume for simplicity that $p$ is monic)

($\Rightarrow$) If $p$ is separable then in splitting field $K$ $$p'(x) = \sum^d_{i =1}\frac{1}{x- a_i}\prod^d_{j=1}(x - a_j)$$ where $a$ are roots of $p$ in $K$ (all distinct) and $d = \deg p$. It's clear that $p'(a_1) = \prod_{j = 2}^d(a_i - a_j)$ is non zero by definition of the field. And hence $p'$ is non zero as function over $K$ and as consequence over $k$.

($\Leftarrow$) And here I am stacked.

Here we just assume that $p' \neq 0$ as a function. It's clear that $\deg p' = d -1$ and that if $a$ is a multiple root of $p$ then $p'(a) = 0$ . Moreover, multiplicity of such roots is reduced by one. I don't understand how to deduce contradiction from this facts, for example that $p | p'$ and $\deg p' > \deg p$ or that $p' |p$ and $p$ is not irreducible, so I need Your help here.

Thank You in advance.

Suppose $p$ has a multiple root $r$ in some field extension $K$ of $k$. Then $r$ is a root of both $p$ and $p'$, so $x - r$ divides both $p$ and $p'$, i.e. the gcd $g$ of $p$ and $p'$ (over $K$) has degree $\ge 1$. Moreover if $p' \ne 0$, $g$ has degree less than that of $p$. But the gcd over $K$ is the same as the gcd over $k$ (it is computed by the same extended Euclidean algorithm), so $p$ is divisible by $g$ as a polynomial over $k$ and is not irreducible.
• Thank you, It turned out hat my problem was that I forgot that gcd is field invariant, so I was imagening it as something exclusively belonging to $K[X]$. – Nik Pronko Oct 6 '16 at 22:12
• Why do you need to consider $K[x]$ at all? Isn't $p'\in k[x]$? – Akababa Jan 31 '18 at 17:27