Introduction
There exist different approaches to determining the greatest common divisor (gcd) for two polynomials, most of them are based on the Euclid algorithm [1] or matrix manipulation [2,3], or subresultant technics [4]. All these methods require long manipulations and calculations around O(n2) for polynomials of degree n. Bezout identity could be another approach. It is a polynomial of degree n and Qn(x) is a polynomial of degree at least n, the Bezout identity says that where t(x) and s(x) are polynomials of degree less then n. Finding s(x) and t(x) requires also O(n2) manipulations. If we know that we propose here another approach that uses only a linear combination of pn(x) and Qn(x) division by x to decrease the degree of both polynomials by 1.
Method
Let's take two polynomials
:
with
and
. The corresponding list of coefficients is:
Let's define
. If
, we can build two new polynomials of degree n-1 by canceling the lowest degree term and the highest degree term:
If
then we replace
it by
:
This corresponds to the manipulation on the list of coefficients:
Note also that
this will remains true at all iterations ending with
.
Note that the new
.
In terms of list manipulation we have:
where First[list] and Last[list] take the first and the last element of the list respectively, while Drop[list,1] and Drop[list,-1] drop the first and the last element of the list respectively. If
then we know that
so the list
ends with 0 so the list manipulation is :
where RotateRight[list] rotate the list to the right (RotateRight[{a,b,c}]={c,a,b}).
So we have the same Bezout argument, they gcd(Pn (x),Qn (x)). must divide Pn-1 (x) and Qn-1 (x) or Pn (x) and . Repeating k times the iteration, it must divide Pn-1 (x) and Qn-1 (x).
If we reach a constant:
and
then
. If we reach, some stage j of iteration,
or
then the previous stage j-1 contains the gcd.
Repeating these steps decrease the degree of polynomials. Reversing the process enables us to find a combination of Pn (x) and Qn (x) which gives a monomial xk and the polynomials are co-prime, or we reach a 0-polynomial before reaching the constant and Pn (x), Qn (x) have a nontrivial gcd.
Results
When dealing with numbers the recurrence could give large numbers so we can normalize the polynomials by some constant
Choosing for example α and β such that the sum of the absolute value of the coefficients of Pn-1 (x) and Qn-1 (x) are :
,
, or that the maximum of the coefficients is always :
,
.
For example
and let's use the ``max" normalization. The first iteration says that gcd must divide P7 (x) and Q7 (x):
then gcd divide
then gcd divide
etc.. finally gcd divide
the next step will give
(
), with the last step:
so we have
Doing the algorithm on formal polynomials gives automatically the resultant or the discriminant of Pn (x) and Qn (x).
For example for the gcd of Pn (x) and for formal polynomials (we always cancel the term xm-1 by translation) we have:
gives after 3 iterations the well-known discriminant , and the Bezout expression is:
For the general polynomial of degree :
in 5 iterations we have the discriminant is [5]
A more formal case [5] is:
so we have successively:
so
then
this structure will repeat, indeed, if
then
,
,
,
, then
and the next coefficients are:
so we have the recurrence
,
and
from
(with
,
,
) up to
. At
we arrive then to:
with
,
,
and
so
and the last iteration gives the constant:
the recurrence on
,
and
gives (
)
so the final constant term is
we can factorize the constant and the discriminant is then [5]
Discussion
The algorithm developed here could be used for formal or numerical calculation of the gcd of two polynomials, or the discriminant and the resultant. It doesn't use matrix manipulation nor determinant calculations and for polynomials of order n, it takes n steps to achieve the goal. It provide also the two polynomials needed for Bezout identity.
Supplementary information
Data sharing is not applicable to this article as no datasets were generated or analyzed during the current study.
Appendix