Find $f \in \mathbb{Q}(X)$ so that the ideal $(2,X)f = (2f,Xf) \subset \mathbb{Z}[X]$ In the title $(2, X)$ is the ideal in $\mathbb{Z}[X]$ generated by $2$ and $X$.
I'm reading that the answer should be $f \in \mathbb{Z}[X]$ because $\mathbb{Z}[X]$ is a $UFD$ and $2$ and $X$ are relatively prime. Can anyone elaborate? I understand that $2$ and $X$ are relatively prime and $\mathbb{Z}[X]$ is an $UFD$. Of course, I would also be interested in a direct proof.
Possible answer: Let $f=\dfrac {p}{q}$, with $p,q \in \mathbb{Z}[X]$ without common prime factors. $f(2,X) \subset \mathbb{Z}[X]$ if and only if $2f$ and $Xf$ in $\mathbb{Z}[X]$. First condition gives: $2p=z_1q$ so $2 | z_1$ or $2|q$. If $2|z_1$ then $q | p$, impossible (unless $q=1$), so $2 | q$. In a similar way, $X | q$, so $f= \dfrac{p}{2Xq'}$, but then $2f \notin \mathbb{Z}[X]$ since $X$ does not divide $p$.

Hint $ $ If $\,g,h\,$ are denominators for a fraction $f\,$ then so too is their gcd $\,(g,h).\,$ So in particular (OP), a fraction writable with $\rm\color{#c00}{coprime}$ denominators  is "integral" (writable with denominator $\color{#c00}1$).  
Theorem $ $ If $\,g,h\in \Bbb Z[x],\ f \in \Bbb Q[x]\,$ then $\,gf,hf\in\Bbb Z[x]\,\Rightarrow\, (g,h)f\in \Bbb Z[x].$ 
Proof $\ $  Write $f = p/q,\ p,q\in \Bbb Z[x].\,$  Then  $\, gf,hf =  gp/q, hp/q\in \Bbb Z[x]\,$ hence
$$q\mid gp,hp\,\overset{\rm\color{#90f}U}\Rightarrow\, q\mid (gp,hp) \overset{\color{#0a0}{\rm D}}= \color{c00}{(g,h)}p\ \ {\rm so}\ \ (g,h)f \in \Bbb Z[x]\qquad $$
where we used $\,\color{#0a0}{\rm D} = $ GCD Distributive Law, valid in every GCD doamin (e.g. here the UFD $\,\Bbb Z[x])$, $ $ and we also used: $ $ $\rm\color{#90f}U = $ GCD Universal Property.
Remark $ $ This property of denominators often proves (conceptually) handy, e.g. see here and here and here. See also various posts one denominator and order ideals.
