I am trying to solve a problem of the form: find all polynomials $f(x)$ (over the rationals) that are congruent to $a(x)\mod p(x)$ and $b(x)\mod q(x)$. My initial guess is that Chinese Remainder Theorem should be used, and if $p(x),q(x)$ generate all of $Q[x]$, this is pretty straight-forward.
But what if it is not obvious that the ideal generated by $p(x),q(x)$ is all of $Q[x]$? Or what if $p(x),q(x)$ do not generate all of $Q[x]$? What to do in these cases? Are there references I could look into to solve a problem like this? Thanks.