construct polynomial from other polynomials

If I have a polynomial, P, with root $a$ and a polynomial, Q, with root $b$, is there a way to construct polynomial R such that $a+b$ is a root of R?

Here’s a concrete example. a = $\sqrt2$. $P(x) = x^2 -2$ and $P(a) = 0$.

b = $\sqrt3$. $Q(x) = x^2 – 3$ and $Q(b) = 0$.

From another method, I know that $x^4 -10x^2 + 1$ has $\sqrt2 + \sqrt3$ as a root.
Is there a way to construct $R(x)$ from $P(x)$ and $Q(x)$? $P$, $Q$, and $R$ are polynomials with integer coefficient.

Thank you.

Solutions Collecting From Web of "construct polynomial from other polynomials"

Gaussian elimination is the key. The ring
$$ \mathbb{Q}[x,y]/(P(x),Q(y)) $$
is a vector space over $\mathbb{Q}$ with dimension $\partial P\cdot \partial Q$, and a base given by $x^i y^j$ for $i\in[0,\partial P-1],j\in[0,\partial Q-1]$. By representing $1,(x+y),(x+y)^2,\ldots,(x+y)^{\partial P\cdot\partial Q}$ in such a base we get $\partial P\cdot\partial Q+1$ elements in a vector space with dimension $\partial P\cdot\partial Q$: it follows that $(x+y)^{\partial P\cdot \partial Q}$ can be represented as a linear combination of $1,(x+y),\ldots,(x+y)^{\partial P\cdot \partial Q-1}$ with rational coefficients: that provides a polynomial that vanishes at $a+b$.

In our concrete example, $P(x)=x^2-2$ and $Q(y)=y^2-3$, so from:

$$\begin{pmatrix} 1 \\ x+y \\ (x+y)^2 \\ (x+y)^3 \\ (x+y)^4\end{pmatrix}=\begin{pmatrix} 1 & 0 & 0 & 0\\ 0 & 1 & 1 & 0 \\ 5 & 0 & 0 & 2 \\ 0 & 11 & 9 & 0 \\ 49 & 0 & 0 & 20\end{pmatrix}\begin{pmatrix}1 \\ x \\ y \\ xy\end{pmatrix}$$
we get $(x+y)^4 = 10(x+y)^2 – 1$, and $R(t)=\color{red}{t^4-10t^2+1}$ is a polynomial that vanishes at $\sqrt{2}+\sqrt{3}$. By studying the rank of the previous matrix, we also have that $R(t)$ is the minimal polynomial of $\sqrt{2}+\sqrt{3}$ over $\mathbb{Q}$.

Hint $ $ We do a slightly less trivial case $\,a=\sqrt2,\,b=\sqrt[3]3.\,$ $\Bbb Q(a,b)\cong \Bbb Q\langle1,b,b^2, a,ab,ab^2\rangle$ as a vector space. $\,x\mapsto (a\!+\!b)\,x\,$ is a linear map on this vector space. Compute its matrix, then apply Cayley-Hamilton, to compute a (characteristic) polynomial having $\,a\!+\!b\,$ as root (e.g. by computing a determinant).

Remark $\ $ Such “determinant tricks” generalize to arbitrary rings. More efficiently (and precisely), one can use Grobner bases to do the elimination (e.g. via ideal-contraction).

Mechanically, we can use resultants to eliminate $\,z,y\,$ from $\,x = y+z,\ x^2=2,\ y^3 = 3.$ First eliminating $\,z\,$ we have ${\rm res}(x\!-\!y\!-\!z,z^2\!-\!2,z) = (x\!-\!y)^2\!-\!2,\,$ then eliminating $\,y\,$ we have $\,{\rm res}((x\!-\!y)^2\!-\!2,y^2\!-\!3,y) = x^6\!-\!6x^4\!-\!6x^3\!+\!12x^2\!-\!36x\!+\!1\,$ (e.g. computed via Alpha)

Alternatively we can contract the ideal $\,(x\!-\!y\!-\!z,z^2\!-\!2,y^3\!-\!3)\,$ to $\,\Bbb Q[x],\,$ using Grobner bases.

The same methods generalize to roots of higher degree polynomials.

We have $\alpha=\sqrt{2}+\sqrt{3} \in K=\mathbb Q(\sqrt2, \sqrt3)$.

$\mathcal B = \{1, \sqrt2, \sqrt3, \sqrt6\}$ is a basis for $K$ over $\mathbb Q$.

Write the matrix of $\mathbb Q$-linear map $\mu : x \mapsto \alpha x$ with respect to $\mathcal B$.

Since $\mu^k : x \mapsto \alpha^k x$,
if $p$ is a polynomial over $\mathbb Q$, then $p(\mu)x=p(\alpha)x$ for all $x$.
Therefore,
$\alpha$ is a root of every polynomial $p$ such that $p(\mu)=0$.
In particular,
$\alpha$ is a root of the characteristic polynomial of $\mu$ because
of the Cayley–Hamilton theorem.

The matrix of $\mu$ is
$$
\pmatrix{ 0 & 2 & 3 & 0 \\ 1 & 0 & 0 & 3 \\ 1 & 0 & 0 & 2 \\ 0 & 1 & 1 & 0 }
$$
and its characteristic polynomial is $x^4-10 x^2+1$. Therefore, $\alpha=\sqrt{2}+\sqrt{3}$ is a root of that polynomial.

(Although not relevant here, this polynomial happens to be irreducible; see Show that $x^4-10x^2+1$ is irreducible over $\mathbb{Q}$.)