When factoring polynomials does not result in repeated factors I found the following statement in the book introduction to finite fields and their applications:

Let $x^n-1 = f_1(x)f_2(x)\dots f_m(x)$ be the decomposition of $x^n-1$ into monic irreducible factors over $\mathbb{F}_q$. If $\text{GCD}(n,q)=1$, then there are no repeated factors; i.e., polynomials $f_1, f_2, \ldots, f_m$ are all distinct.

Firstly, please indicate why this statement holds.
Secondly, are there similar theorems for polynomials other than $x^n-1$?

If $f(x)=g(x)^2h(x)$ then by the product rule of polynomial derivatives: $$f'(x)=2g(x)g'(x)h(x)+g(x)^2h'(x) =g(x)\left(2g'(x)h(x)+g(x)h'(x)\right)$$
So when $f(x)$ has a repeated factor, $f'(x)$ has a common factor with $f(x)$.
