# Curious about composite of polynomials

I've recently been looking at the relationships between divisibility of polynomials and their degrees. This following idea has eluded me for a while.

Suppose $p$ and $q$ are polynomials in $F[X]$ for $F$ a field, with $p$ irreducible. If $d$ is another irreducible polynomial that divides $p(q(X))$, then how can you conclude that the degree of $p$ divides the degree of $d$?

I've whittled it down as much as I can. If $p$ has degree $n$ and $q$ has degree $m$ then $p(q(X))$ has degree $nm$, and if $p(q(X))=d(X)f(X)$, where $\deg(d)=a$ and $\deg(f)=b$, then $nm=a+b$. Then it's enough to show $n$ divides either $a$ or $b$, but I'm not sure how to see that, or why irreducibility of $p$ and $d$ are a factor. I thought maybe if I assume neither is divisible by $n$, I could find a contradiction, but I did not see anything immediate.

Thanks.

-
Hint (assuming that you have done some field theory): Let $\alpha$ be a zero of $d(x)$ in some extension field of $F$. Because $d(x)$ is irreducible, we know that $\deg d(x)=[F(\alpha):F]$. Show that $p(x)$ is a minimal polynomial of $q(\alpha)\in F(\alpha)$, and...