I've been following this excellent resource on abstract algebra and became stuck on proving a corollary to a lemma (18.26 in the text):
Let $D$ be a UFD and $F$ its field of fractions. Suppose that $p(x)\in D[x]$ and $p(x)=f(x)g(x)$, where $f(x)$ and $g(x)$ are in $F[x]$. Then $p(x)=f_1(x)g_1(x)$, where $f_1(x)$ and $g_1(x)$ are in $D[x]$. Furthermore, $deg~f(x)=deg~f_1(x)$ and $deg~g(x)=deg~g_1(x)$.
The corollary is that:
Let $D$ be a UFD and $F$ its field of fractions. A primitive polynomial $p(x)$ in $D[x]$ is irreducible in $F[x]$ if and only if it is irreducible in $D[x]$.
My problem is that I can prove both directions, but nowhere do I use the fact that $p(x)$ is primitive:
$\Rightarrow$ : Let $p(x)$ be irreducible in $F[x]$, then it must be that $p(x)$ must take the form $a \cdot g(x)$, for $a\in F$, $g(x)\in F(x)$. Now suppose $p(x) = f_1(x) g_1(x)$, with $f_1(x)$, $g_1(x)$ $\in D[x]$. But since every polynomial in $D[x]$ is in $F[x]$, we must have that $f_1(x) \in F[x]$ a constant (which is some multiple of $a$), and $deg~g_1(x)=deg~g(x)$ (or vice versa). Hence $p(x)$ is irreducible in $D[x]$.
$\Leftarrow$: Let $p(x)$ be irreducible in $D[x]$. Suppose $p(x)=f(x)g(x)$, where $f(x)$ and $g(x)$ are in $F[x]$. Then by the lemma above, we have $p(x)=f_1(x)g_1(x)$, where $f_1(x)$,$g_1(x)$ $ \in D[x]$ and have the appropriate degrees. Since $p(x)$ is irreducible in $D[x]$, then we must have $f_1(x)$ a constant, and $deg~g_1(x)=deg~p(x)$ (or vice versa). Then $deg~f(x)=0$, $deg~g(x)=deg~p(x)$, and so $p(x)$ is irreducible in $F[x]$.
I'm probably missing something obvious so if some kind soul could point this out to me, I'd be grateful!
EDIT: Incorporating @TokenToucan's hint in the comments, for the $\Leftarrow$ part, I append:
Let $f_1(x)=a_1 (\neq 0) \in D$, and let the content of $g_1(x)$ be $b_1$. Since $p(x)$ is primitive, we have $1=a_1 b_1$, hence $a_1$ is a unit.
But my issue with this is that while I use the fact that $p(x)$ is primitive, I no longer need to use the lemma that the corollary depends upon! I could just do:
$\Leftarrow$: Let $p(x)$ be irreducible in $D[x]$ .Then we have $p(x)=f_1(x)g_1(x)$. Since $p(x)$ is irreducible in $D[x]$, then we must have $f_1(x)$ a constant, and $deg~g_1(x)=deg~p(x)$ (or vice versa). Let $f_1(x)=a_1 (\neq 0) \in D$, and let the content of $g_1(x)$ be $b_1$. Since $p(x)$ is primitive, we have $1=a_1 b_1$, hence $a_1$ is a unit. Since $D\subset F$, we have $p(x) = a_1 g_1(x)$ with $a_1 \in F$ and $g_1(x) \in F[x]$ so $p(x)$ is irreducible over $F[x]$.