# Decidability of a problem concerning polynomials

I have come across the following interesting problem: let $p,q$ be polynomials over the field of real numbers, and let us suppose that their coefficients are all integer (that is, there is a finite exact representation of these polynomials). If needed, we may suppose that the degree of both polynomials is equal. Let us denote by $x_p$ (resp. $x_q$) the greatest absolute value of some (real or complex) root of the polynomial $p$ (resp. $q$). Is the property $x_p = x_q$ decidable?

If not, does this property hold for some restricted families of polynomials? In the context from which this problem arises, the polynomials are characteristic polynomials of matrices, and their roots are eigenvalues.

I am aware of some numerical algorithms for computing roots of polynomials / eigenvalues, however these seem to be of no use here, since the output of these algorithms is only approximate. It seems to me that computer algebra might be useful here, however, unfortunately, I do not have almost any knowledge in that field.

I am not searching for a detailed solution to this problem, however any intuition and ideas where to search for the solution would be helpful.

• If you can compute the splitting field then you could just write them both in the form $(x-x_0)(x-x_1)\dots$ and compare; for some fields the splitting field isn't computable but I'm not sure if this holds for extensions of $\mathbb{Q}$? – Xodarap Oct 15 '12 at 15:45

I'm not knowledgeable in that field either, but I think I can provide a non-constructive answer.

The first-order theory of real closed fields is decidable. Your problem can be stated as a system of algebraic equations and inequations over the real algebraic numbers. Consider $$2 (\deg P + \deg Q)$$ variables $$x_1,\ldots,x_{\deg P}, y_1,\ldots,y_{\deg P}, x'_1,\ldots,x'_{\deg P}, y'_1,\ldots,y'_{\deg P}$$. You want to know whether the following system is satisfiable: \begin{align*} P(x_j+i\,y_j) &= 0 & \text{for $$1 \le j \le \deg P$$} \\ Q(x'_k+i\,y'_k) &= 0 & \text{for $$1 \le k \le \deg Q$$} \\ x_j^2 + y_j^k &\le x_1^2 + x_2^2 & \text{for $$2 \le j \le \deg P$$} \\ {x'}_j^2 + {y'}_j^k &\le {x'}_1^2 + {x'}_2^2 & \text{for $$2 \le k \le \deg Q$$} \\ x_1^2 + y_1^2 = {x'}_1^2 + {y'}_1^2 \\ \end{align*}

The first two equation families express that the $$x_j+i\,y_j$$ and $$x'_k+i\,y'_k$$ are roots of the polynomials, the next two inequation families express that $$x_1+i\,y_1$$ and $$x'_1+i\,y'_1$$ have the largest absolute value, and the last inequation compares these largest absolute values.

It is decidable whether this system is satisfiable: your problem is decidable. However, this statement is probably not the most efficient way to go about it.

A more useful answer probably involves the theory of Gröbner bases. If you're trying to solve that problem for yourself, I think reading the first few chapters of any computational algebra book will give you the requisite background. If you're just aiming to solve your underlying problem, there is probably an off-the-shelf algorithm you can implement.

I may be wrong about this: I am also not very knowledgeable in this field (where are the experts!?), but I believe I have a reasonably fast algorithm for what you are asking.

I am going to suppose, for simplicity, that all the roots are real. Find an interval bound on the root of $P$ with highest absolute value (i.e. an interval $I$ such that $x_P\in I$ and $x_P'\notin I$ for all other roots of $P$). Such an interval can be found by the combined use of dichotomy and Sturm's theorem. Now compute the polynomial GCD $R$ of $P$ and $Q$. Verify that $R$ has a root in $I$ (again with Sturm's theorem).

If I am not mistaken, $R$ has such a root if and only if $P$ and $Q$ have a common root in $I$, which in turn is only possible if $x_P$ is a root of $Q$. Both the application of Sturm's theorem and the GCD are rather fast (not more than quadratic in the size of the polynomials in fact).

This is just a sketch, but it doesn't take much to turn this into a bona fide algorithm, in fact I suspect that the use of Maple or Mathematica would make this trivial.

• For root isolation Sturm is better replaced by the lesser known, but more efficient Vincent's theorem. The assumption that the roots are real can be eliminated by replacing the input polynomials by polynomials which roots are the products of all pairs of roots and their conjugates. These can be computed from the coefficients without having to compute the roots. This creates two new polynomials that have a real positive root that the one with largest absolute value. – plop Oct 15 '20 at 13:08

An effective algorithm could be the following:

1. Replace each polynomial by their quotient with their GCD with their own derivative. This is just to make possible multiple roots simple, in case the inputs had them.
2. Replace the polynomials $$P$$ and $$Q$$ by polynomials by the resultant $$R(t)$$ of $$P(x)$$ and $$x^{\deg(P)}P(t/x)$$ and the resultant $$S(t)$$ of $$Q(x)$$ and $$x^{\deg(Q)}Q(t/x)$$, respectively. These have roots equal to the products of pairs of roots of $$P$$, the first one, and pairs of roots of $$Q$$, the second one. In particular, the root $$x_R$$ of $$R$$ of largest absolute value would be $$x_p\overline{x_p}=|x_p|^2$$ and that for $$S$$ would be $$x_S=|x_q|^2$$. Now the original problem has become to determine if $$R$$ and $$S$$ have their largest non-negative real root in common.
3. We can once again make the roots of $$R$$ and $$S$$ simple as in Step 1.
4. Compute the gcd $$D$$ of $$R$$ and $$S$$ and isolate the largest non-negative root of $$R$$, $$S$$ and $$D$$. This means to obtain intervals $$I_R$$, $$I_S$$ and $$I_D$$ such that $$x_R$$ is the only root of $$R$$ in $$I_R$$, $$x_S$$ is the only root of $$S$$ in $$I_S$$ and $$x_D$$, the largest real root of $$D$$ is the only one in $$I_D$$. This can be done using Vincent's theorem or Sturm's theorem. The former is more efficient, while the second is the one taught more often in school. The interval $$I_D$$ isolating the root of $$D$$ can be shrank arbitrarily small using Bisection method, for example, until it is either contained in the intersection $$I_R\cap I_S$$ or is disjoint with it. In the latter case we output false (note that this case contains the case in which $$I_R\cap I_S=\emptyset$$) and in the former we output true. Observe that if $$I_D\subset I_R\cap I_S$$, then the largest root of $$D$$, which is common for $$R$$ and $$S$$ must be the root of $$R$$ in $$I_R$$ and the root of $$S$$ in $$I_S$$. Therefore, the largest roots of $$R$$ and $$S$$ are the same.