## Find a polynomial over ZZ having a given set of roots

Verify that the roots of $q(x) = x^3 + (2-\sqrt{7})x + 1+3i$ are algebraic integers.

Note that the minimal polynomial of $2 - \sqrt{7}$ is $a(x) = x^2 - 4x - 3$ and of $1+3i$ is $b(x) = x^2 - 2x + 10$; so the conjugates of $2 - \sqrt{7}$ are $2 \pm \sqrt{7}$ and of $1 + 3i$ are $1 \pm 3i$.

Every root of $q(x)$ is also a root of $\prod_{a,b=0}^1 (x^3 + (2 + (-1)^a \sqrt{7})x + 1 + (-1)^b3i)$; evidently, $p(x) = x^{12}+8 x^{10}+4 x^9+10 x^8+24 x^7+20 x^5+105 x^4+16 x^3+208 x^2+80 x+100$. (WolframAlpha agrees.)