# How to find a polynomial from a given root?

I was asked to find a polynomial with integer coefficients from a given root/solution.
Lets say for example that the root is: $\sqrt{5} + \sqrt{7}$.

1. How do I go about finding a polynomial that has this number as a root?
2. Is there a specific way of finding a polynomial with integer coefficients?

Any help would be appreciated. Thanks.

#### Solutions Collecting From Web of "How to find a polynomial from a given root?"

One can start from the equation $x=\sqrt5+\sqrt7$ and try to get rid of the square roots one at a time. For example, $x-\sqrt5=\sqrt7$, squaring yields $(x-\sqrt5)^2=7$, developing the square yields $x^2-2=2x\sqrt5$, and squaring again yields $(x^2-2)^2=20x^2$, that is, $x^4-24x^2+4=0$.

The simplest polynomial that has $r$ as a root is just $x-r$. But of course, that is not what you are dealing with here.

This is really a question about finding the minimal polynomial of $\alpha=\sqrt{5}+\sqrt{7}$ over $\mathbb{Q}$; such polynomials exist for any algebraic number, by definition of algebraic.

Galois Theory provides all the necessary tools to solve this problem. Basically:

1. Consider the field $\mathbb{Q}(\sqrt{5},\sqrt{7})$; this field contains the number $\alpha=\sqrt{5}+\sqrt{7}$, so we can work there. Every element of this field can be written uniquely as
$$a + b\sqrt{5} + c\sqrt{7} + d\sqrt{35}$$
for some $a,b,c,d\in\mathbb{Q}$.

2. The field $\mathbb{Q}(\sqrt{5},\sqrt{7})$ has four automorphisms (functions $f\colon\mathbb{Q}(\sqrt{5}+\sqrt{7})\to\mathbb{Q}(\sqrt{5},\sqrt{7})$ that are additive, $f(a+b)=f(a)+f(b)$, multiplicative, $f(ab)=f(a)f(b)$, and invertible), and these automorphisms fix elements of $\mathbb{Q}$ (that is, $f(q)=q$ for all $q\in\mathbb{Q}$).

These automorphism are the following:
\begin{align*} \sigma_1\colon a+b\sqrt{5}+c\sqrt{7}+d\sqrt{35} &\longmapsto a+b\sqrt{5}+c\sqrt{7}+d\sqrt{35} &\qquad&\text{(the identity)};\\ \sigma_2\colon a+b\sqrt{5}+c\sqrt{7}+d\sqrt{35} &\longmapsto a-b\sqrt{5}+c\sqrt{7}-d\sqrt{35}\\ \sigma_3\colon a+b\sqrt{5}+c\sqrt{7}+d\sqrt{35} &\longmapsto a+b\sqrt{5}-c\sqrt{7}-d\sqrt{35}\\ \sigma_4\colon a+b\sqrt{5}+c\sqrt{7}+d\sqrt{35} &\longmapsto a-b\sqrt{5}-c\sqrt{7}+d\sqrt{35} &&\text{(equal to }\sigma_3\circ\sigma_2\text{)} \end{align*}
The maps are induced by the conjugation maps $\sqrt{5}\mapsto-\sqrt{5}$ and $\sqrt{7}\mapsto-\sqrt{7}$.

An important feature is that an element of $\mathbb{Q}(\sqrt{5},\sqrt{7})$ lies in $\mathbb{Q}$ if and only if it is fixed by all four maps.

3. Suppose $p(x)$ is a polynomial with coefficients in $\mathbb{Q}$, and that $a\in\mathbb{Q}(\sqrt{5},\sqrt{7})$. If
$$p(x) = a_nx^n + \cdots + a_0$$
then
$$\sigma_i(p(a)) = \sigma_i(a_na^n+\cdots+a_0) = a_n\sigma_i(a)^n+\cdots+a_0 = p(\sigma_i(a)).$$
In particular, if $p(a)\in\mathbb{Q}$, then $p(a)=\sigma_i(p(a)) = p(\sigma_i(a))$ for $i=1,2,3,4$.

4. Now suppose you find a polynomial $p(x)$ with coefficients in $\mathbb{Q}$ that has $\sqrt{5}+\sqrt{7}$ as a root. Then $p(\sqrt{5}+\sqrt{7})=0$, so by 3 above, it must also be true that $p(\sigma_i(\sqrt{5}+\sqrt{7}))=0$ for $i=1,2,3,4$. That means that $p(x)$ must also have $\sqrt{5}-\sqrt{7}$, $-\sqrt{5}+\sqrt{7}$, and $-\sqrt{5}-\sqrt{7}$ as roots. By unique factorization, we conclude that $p(x)$ must be divisible by
$$\left(x – (\sqrt{5}+\sqrt{7})\right)\left(x – (-\sqrt{5}+\sqrt{7})\right)\left(x – (\sqrt{5}-\sqrt{7})\right)\left(x – (-\sqrt{5}-\sqrt{7})\right).$$
That is, any polynomial with coefficients in $\mathbb{Q}$ that has $\sqrt{5}+\sqrt{7}$ as a root must be a multiple of this product.

But if you multiply out this product, you will discover that this polynomial already has coefficients in $\mathbb{Q}$.

Once you have a polynomial with coefficients in $\mathbb{Q}$ that has $\sqrt{5}+\sqrt{7}$ as a root, you can get a polynomial with coefficients in $\mathbb{Z}$ by simply clearing denominators.

1. $x-\sqrt 5 – \sqrt 7$ is a polynomial, so you should specify the kind of coefficients you are seeking.

2. In the case of square roots there exists the low-level technique of “squaring the roots away”.

$$x=\sqrt 5 + \sqrt 7$$
$$x^2=5+7+2\sqrt {35}$$
$$(x^2-12)^2=140$$
$$x^4-24x^2+4=0$$

3. If you know that you should expect the conjugates to be roots, you can multiply four linear factors.

$$(x-\sqrt 5 – \sqrt 7)(x-\sqrt 5 + \sqrt 7)(x+\sqrt 5 – \sqrt 7)(x+\sqrt 5 + \sqrt 7).$$

4. In general, there are methods for constructing a polynomial for the sum of two numbers whose polynomials are known, for example one can use the resultant.
http://en.wikipedia.org/wiki/Resultant

Let me just remark that there are algorithms for doing this even when the number is not given in terms of radicals but only as a decimal expansion (but is suspected to be algebraic). Namely, one uses the LLL algorithm to try to construct an integral linear combination of $1,\alpha,\alpha^2,\alpha^3,\ldots$ that is zero up to a rounding error. If no such linear combination is found then one can conclude that the number is either transcendental, or the minimal polynomial must have enormous coefficients or enormous degree.