Low-Degree Polynomial Roots

Low-Degree Polynomial Roots

Low-Degree Polynomial Roots David Eberly, Geometric Tools, Redmond WA 98052 https://www.geometrictools.com/ This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA. Created: July 15, 1999 Last Modified: September 10, 2019 Contents 1 Introduction 3 2 Discriminants 3 3 Preprocessing the Polynomials5 4 Quadratic Polynomials 6 4.1 A Floating-Point Implementation..................................6 4.2 A Mixed-Type Implementation...................................7 5 Cubic Polynomials 8 5.1 Real Roots of Multiplicity Larger Than One............................8 5.2 One Simple Real Root........................................9 5.3 Three Simple Real Roots......................................9 5.4 A Mixed-Type Implementation................................... 10 6 Quartic Polynomials 12 6.1 Processing the Root Zero...................................... 14 6.2 The Biquadratic Case........................................ 14 6.3 Multiplicity Vector (3; 1; 0; 0).................................... 15 6.4 Multiplicity Vector (2; 2; 0; 0).................................... 15 6.5 Multiplicity Vector (2; 1; 1; 0).................................... 15 6.6 Multiplicity Vector (1; 1; 1; 1).................................... 16 1 6.7 A Mixed-Type Implementation................................... 17 2 1 Introduction Consider a polynomial of degree d of the form d X i p(y) = piy (1) i=0 where the pi are real numbers and where pd 6= 0. A root of the polynomial is a number r, real or non-real (complex-valued with nonzero imaginary part) such that p(r) = 0. The polynomial can be factored as p(y) = (y − r)mf(y), where m is a positive integer and f(r) 6= 0. The power m is the multiplicity of the root. If m = 1, the root is said to be a simple root. If m ≥ 2, the root is said to be a multiple root. The fundamental theorem of algebra states that p(y) has exactly d roots, counting the multiplicities. If the K PK−1 distinct roots are yk for 0 ≤ k < K and if mk is the multiplicity of root yk, then d = k=0 mk. We are assuming that the pi are real numbers, so if a root is non-real, say, r = u + {v, where v 6= 0, thenr ¯ = u − {v is also a root. The pair (r; r¯) is referred to as a complex conjugate pair of roots. The roots of polynomials of degrees 2, 3, or 4 can be written using closed-form algebraic expressions. The theory of polynomials shows us that there cannot be general closed-form algebraic expressions for the roots of p(y) for d ≥ 5. In practice, numerical root finders must be used to locate the roots. For degrees 2, 3, and 4, one may compute the roots using the closed-form expressions, but this approach is typically ill conditioned when using floating-point arithmetic. The main problem occurs in sign tests used to classify the roots, both in domain (real or non-real) and in multiplicity (determine m). This document provides a robust approach for computing the roots using the closed-form expressions. The assumption is that the polynomial coefficients are floating-point numbers. In an implementation, they are converted to exact rational representations so that the root classification is performed with exact rational arithmetic and the result is theoretically correct. Naturally, the coefficients themselves might have been computed in a manner that introduced floating-point rounding errors. The discussion here does not take the coefficient errors into account, because only you the programmer have|and can take advantage of|that knowledge. 2 Discriminants The first step in classification uses a concept called the discriminant of a polynomial p(y) and is defined as 2d−2 Y 2 d(d−1)=2 2d−2 Y ∆ = pd (ri − rj) = (−1) pd (ri − rj) (2) i<j i6=j where r0 through rd−1 are the roots of p(y) counting the multiplicities: a root r with multiplicity m occurs m times in the set fr0; : : : ; rd−1g. In the event a root exists with multiplicity 2 or larger, it is clear that ∆ = 0; thus, at its highest level the discriminant lets you know whether or not a polynomial has repeated roots. More information is actually known regarding the sign of ∆, • ∆ > 0: for some integer k with 0 ≤ k ≤ d=4, there are 2k distinct complex-conjugate pairs of roots and d − 4k distinct real roots. Each root has a multiplicity of 1. • ∆ < 0: for some integer k with 0 ≤ k ≤ (d − 2)=4, there are 2k + 1 distinct complex-conjugate pairs of roots and d − 4k − 2 distinct real roots. Each root has a multiplicity of 1. 3 • ∆ = 0: at least one root r has multiplicity m ≥ 2 and r may be either real or non-real. If r is non-real, then its conjugater ¯ also has multiplicity m. 2 2 The prototypical case is p(y) = p0 + p1y + p2y . The discriminant is ∆ = p1 − 4p0p2. If ∆ > 0, the square root is a positive real number and there are two distinct real roots, p p −p1 − ∆ −p1 + ∆ r0 = ; r1 = 2p2 2p2 The integer k in the sign tests is 0, so we have 2 distinct real roots and 0 distinct complex-conjugate pairs of roots. If ∆ < 0, the square root is a pure imaginary number and the roots are non-real, p p −p1 − { −∆ −p1 + { −∆ r0 = ; r1 = 2p2 2p2 The integer k in the sign tests is 0. If ∆ = 0, we have a repeated real root, −p1 r0 = r1 = 2p2 so its multiplicity is m = 2. Of course we usually do not know the roots of p(y), so Equation (2) is not immediately helpful. However, the discriminant is related to another concept called the resultant of two polynomials, which is the product of 0 Pd−1 i the differences between the roots of the polynomials. The first derivative of p(y) is p (y) = i=0 (i+1)pi+1y and the resultant of p(y) and p0(y) is denoted R(p; p0). It is the determinant of a (2d − 1) × (2d − 1) matrix called the Sylvester matrix, 2 3 pd pd−1 pd−2 : : : p1 p0 0 :::::: 0 6 0 pd pd−1 pd−2 : : : p1 p0 0 ::: 0 7 6 . 7 6 . 7 6 . 7 6 7 6 0 ::: 0 pd pd−1 pd−2 : : : p1 p0 7 R(p; p0) = det 6 7 (3) 6 dpd (d − 1)pd−1 (d − 2)pd−2 : : : p1 0 :::::: 0 7 6 7 6 0 dpd (d − 1)pd−1 (d − 2)pd−2 : : : p1 0 ::: 0 7 6 . 7 6 . 7 4 . 5 0 0 ::: 0 dpd (d − 1)pd−1 (d − 2)pd−2 : : : p1 The discriminant is then d(d−1)=2 0 ∆ = (−1) R(p; p )=pd (4) The discriminant for the degree-2 (quadratic) polynomial is 2 3 p2 p1 p0 6 7 ∆ = −1 det 6 2p p 0 7 p2 6 2 1 7 4 5 0 2p2 p1 (5) 2 = p1 − 4p0p2 4 The discriminant for the degree-3 (cubic) polynomial is 2 3 p3 p2 p1 p0 0 6 7 6 7 6 0 p3 p2 p1 p0 7 6 7 ∆ = −1 det 6 3p 2p p 0 0 7 p3 6 3 2 1 7 6 7 6 7 6 0 3p3 2p2 p1 0 7 (6) 4 5 0 0 3p3 2p2 p1 2 2 3 3 2 2 = −27p0p3 + 18p0p1p2p3 − 4p0p2 − 4p1p3 + p1p2 The discriminant for the degree-4 (quartic) polynomial is 2 3 p4 p3 p2 p1 p0 0 0 6 7 6 7 6 0 p4 p3 p2 p1 p0 0 7 6 7 6 7 6 0 0 p4 p3 p2 p1 p0 7 6 7 ∆ = 1 det 6 4p 3p 2p p 0 0 0 7 p4 6 4 3 2 1 7 6 7 6 7 6 0 4p4 3p3 2p2 p1 0 0 7 6 7 6 7 6 0 0 4p4 3p3 2p2 p1 0 7 (7) 4 5 0 0 0 4p4 3p3 2p2 p1 3 3 2 2 2 2 2 2 2 2 4 2 2 2 2 = 256p0p4 − 192p0p1p3p4 − 128p0p2p4 + 144p0p2p3p4 − 27p0p3 + 144p0p1p2p4 − 6p0p1p3p4 2 3 4 3 2 4 2 3 3 3 − 80p0p1p2p3p4 + 18p0p1p2p3 + 16p0p2p4 − 4p0p2p3 − 27p1p4 + 18p1p2p3p4 − 4p1p3 2 3 2 2 2 − 4p1p2p4 + p1p2p3 For larger d, the discriminant expressions become quite complicated. These occur in a simpler format for preprocessed polynomials. 3 Preprocessing the Polynomials Preprocessing steps may be applied that make the root classification and construction simpler. The steps are error free when performed with exact rational arithmetic. In the analysis of p(y), the polynomial is made monic by dividing through by its leading coefficient to obtain d−1 X i d q(y) = qiy + y (8) i=0 where qi = pi=pd for 0 ≤ i ≤ d−1. The polynomials p(y) and q(y) have the same set of roots and multiplicities. The monic polynomial is made depressed by eliminating the yd−1 term using a simple translation, y = 5 x − qd−1=d, to obtain d−2 X i d c(x) = cix + x (9) i=0 The coefficients ci are obtained from binomial expansions of powers of (x − qd−1=d). These will be listed for each low-degree polynomial discussed in later sections. It is possible that low-order coefficients of c(x) are zero, so the analysis must allow for this. The roots of c(x) of Equation (9) are computed and then inverse transformed to obtain roots to p(y). Specifically, ifx ^ is a root of c(x), the corresponding root of p(y) is y^ =x ^ − qd−1=d.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    21 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us