0% found this document useful (0 votes)
58 views

Solving Multiple-Root Polynomials

The document describes a method for solving multiple-root polynomials by transforming the polynomial into a rational function. It involves: 1) Transforming the given polynomial into a rational function using the greatest common divisor (GCD) of the polynomial and its derivative. 2) Obtaining all the roots and their multiplicities of the original polynomial from the poles and residues of the resulting rational function, instead of directly solving the high-degree polynomial. 3) Providing a MATLAB program that implements this method and tests it on a high-degree polynomial example.

Uploaded by

antonio Scacchi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Solving Multiple-Root Polynomials

The document describes a method for solving multiple-root polynomials by transforming the polynomial into a rational function. It involves: 1) Transforming the given polynomial into a rational function using the greatest common divisor (GCD) of the polynomial and its derivative. 2) Obtaining all the roots and their multiplicities of the original polynomial from the poles and residues of the resulting rational function, instead of directly solving the high-degree polynomial. 3) Providing a MATLAB program that implements this method and tests it on a high-degree polynomial example.

Uploaded by

antonio Scacchi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Solving Multiple-Root Polynomials

Feng Cheng Chang


Allwave Corporation
3860 Del Amo Blvd, Suite 404, Torrance, CA 90503 USA
Tel: +1 (310) 793-9620 ext. 106; Fax: +1 (310) 793-9629; E-mail: [email protected]; [email protected]

Abstract
A given polynomial is transformed herein into a rational function. All the roots and multiplicities of the polynomial are then
easily obtained from the poles and residues of this rational function, instead of solving for them directly using the original,
high-degree multiple-root polynomial. The derived program, using only basic MATLAB built-in routines and existing double-
precision arithmetic, amazingly gives the expected results for test polynomials of very high degree and multiplicity, even as
.
high as p (x) = ( x+98.765 )1234 .

Keywords: Numerical analysis; mathematical programming; polynomial solutions; roots and multiplicities; poles and residues;
rational function; partial fraction expansion; greatest common divisor; Euclidean GCD algorithm

1. Introduction Zk and mk are then simply the poles and residues of the rational
function r(x). In other words, the K desired roots Zk of p (x) are

A polynomial, possibly with several multiple roots, is


transformed into a rational function. All the roots and
multiplicities of the polynomial are then obtained simply by
obtained by solving the K-degree simple-root polynomial
u ( x ) = 0, instead of directly solving the original N-degree

finding the poles and residues of this rational function, instead of multiple-root polynomial p ( x) = 0, where
by directly solving the original, high-degree multiple-root
polynomial. The approach requires computation of the greatest K
common divisor (GCD). The simple and efficient algorithm by u(x)= TI(X-Zk)' (3)
Chang [1] is employed. It requires only simple arithmetic k==1
operations, without the use of any advanced mathematics. A code
in MATLAB is provided, along with a typical numerical example.
This routine, using only existing double precision, gives the The corresponding multiplicities, mk' are simply the partial
expected results for test polynomials of very high degree and fraction expansion coefficients of the rational function
multiplicities. r(x) = v(x)/u(x):

2. Formulation (4)

Let a polynomial, p (x), of degree N, with N + 1 coefficients


It is noted that the transformation between the original polynomial,
b., i = 0,1,..., N , be given. The K roots Zk with multiplicities mi , p (x), and the derived rational function, r(x), exists:
k = 1,2, ...,K , are sought such that
d d K K m
N K -lnp(x) =-In TI(X-Zk)mk = " L -k- = r(x), (5)
p(x)= "Lb;xN-i = TI(X-zk)mk . (1) dx dx k=1 k=1 x-zk
;==0 k=l
and inversely,
We are now to find the rational function, r(x), or a pair of related
polynomials,
polynomial
u (x ) and
p(x), such that
v( x ) , derived from the original
exp r00
dxr(x}=exp tdx"L~
K

k=l x-zk
(6)

r(x}= v(x} = f~.


K
(2) =TI(X-Zk)mk =p(x).
u(x) k==1 X-Zk k=1

IEEEAntennas and Propagation Magazine, Vol. 51, No. 6, December 2009 151
It follows from the first relation that 3. Computer Routines
r(x) = v(x) = p'(x) (7) The program source-code listing, using only basic MATLAB
u(x) p(x)· built-in routines, is herein presented (Figure 1). The input p to the
program is a coefficient vector of the given polynomial p (x), and
Then
the output Z is the list of computed root-multiplicity pairs, zk' mk .
The polynomial coefficients can be either real or complex
u(x)= p(x) numbers.
g(x) ,
(8) A short program is also provided to create a test polynomial
v(x) = p'(x) coefficient vector from several powered polynomial factors
g(x) , (Figure 2).

where
4. A Typical Example
g(x) = gcd[p(x),p'(x)] (9)
Figure 3 shows the results of using the above programs to
is the greatest common divisor of p(x) and p'(x). A pair of solve the following test polynomial, p(x):
polynomials, u (x) and v( x), for the rational function r (x) are
thus determined once the polynomial greatest common divisor
g ( x) is generated. p(x)=(x4 _1)3 (x3 - x2t (x3 +x- 10t

Of crucial concern in carrying out the process so far is the (x3 +Sx2+llx+1S)(x2-4X+3t x (10),
polynomial greatest common divisor computation. The algorithm
"monic polynomial subtraction" developed by Chang [1] is applied Le.,
here. It is adapted and modified from longhand division in the p(x) = x 32 _5x 31 + 2x 30 _6x 29 + 76x 28
classical Euclidean algorithm. All required computations involve
only elementary arithmetic operations, without the use of any + ...-87555x7 + 55800x6 -13500x5 . (11)
advanced mathematics.

function Z = polyroots(p)
% *** Solve multiple-root polymonials ***
% Revised to efficient compact form.

tol = 1.e-3; wtol = 1.e-8;


rnz= length(p)-max(find(p));
pO = p(min(find(p)) :max(find(p)));
if length(pO) < 2, Z = [O,mz]; return, end;
s = abs(pO(end)/pO(l));
if s < 1, pO = pO(end:-l:l)/pO(end); end;
qO = polyder(pO);
gl = pO;
g2 = qO(I:max(find(qO)));
for k = 1:2*length(pO),
11 = length (gl) ; 12 = length(g2);
g3 = [g2,zeros(I,11-12)]-g2(l)/gl(I)*[gl,zeros(I,12-ll)];
if norm(g3,inf)/norm(g2,inf) < tol, break; end;
if 11 > 12, gl = g2; end;
g2 g3(min(find(abs(g3»wtol)) :max(find(abs(g3»wtol)));
end;
gO gl/gl (1) i
uO deconv(pO,gO) ;
vO deconv(qO,gO) ;
wO polyder(uO) ;
zO roots (uO) i
mO polyval(vO,zO) ./polyval(wO,zO);
i f s < 1, z 0 = z 0 . A_I i end;
Z = [zO,round(abs(mO))] i
if mz > 0, Z = [Z ; 0, mz l , end;
% PGUk = [length(pO)-I,length(gO)-I,length(uO)-I,k],
% if length (pO) <101, pO,qO,gO,uO,vO,wO, [zO,mOJ, end;

Figure 1. The MATLAB code to solve a polynomial with


multiple roots.

152 IEEEAntennas and Propagation Magazine, Vol. 51 No. 6, December2009


J
function p = polyget(A)
% *** Create poly coef vector from poly factors ***
%
p 1;
for i l:length(A(:,l)) ,
q 1;
for j l:A(i, 1),
q conv (q,A (i, max (find (A (i, :) ) ) : -1: 2) ) ;
end;
p conv(p,q) ;
end;

Figure 2. The MATLAB code to create a test polynomial from


several factors.

»Z polyroots(p)

z =
3.0000 2
-3.0000 1
-1.0000 + 2.0000i 3
-1.0000 - 2.0000i 3
2.0000 2
-1.0000 3
-0.0000 + 1.0000i 3
-0.0000 - 1.0000i 3
1.0000 7
0.0000 5

Figure 3. The results of using the MATLAB code to solve for


roots of the test polynomial in Equation (11).

5. Conclusion In comparison against test polynomials, both the routines


give spectacularly concordant results for test polynomials of very
A short and compact program, using only existing double high degree, such as, p (x) = ( x + 1)500. The routine now presented
precision, has been presented for the solution of a polynomial with retains its root-finding power much, much further, all the way up to
multiple roots. It reveals that the higher are the root multiplicities 1234
of the given polynomial, the more efficient this approach becomes. p(x ) = ( x+987.65 ) .
This is contrary to the usual experience that the most difficult part
of solving for the roots of a polynomial is calculating those that However, we are almost sure to find failure with any
have high multiplicities [2]. For general root-finding routines, the numerical algorithm, especially if the multiple roots are closely
MATLAB software package MULTROOT, introduced by Zeng [2], is clustered together. For example, the presented routine as well as
highly recommended. However, his routine embodies an algorithm Zeng's will fail to achieve the expected results even when the test
that makes use of advanced mathematics. polynomial is as simple as

IEEE Antennas and Propagation Magazine, Vol. 51, No. 6, December 2009 153
p(x) =(x+1.01)3 (X+1.00)5 (x+0.99)7. (12) 7. References

1. F. C. Chang, "Factoring a Polynomial with Multiple-Roots,"


International Journal of Computational and Mathematical
6. Acknowledgment Sciences, 2, 4, Fall 2008, pp. 173-176.

The author wishes to thank Dr. Jan Grzesik of Allwave 2. Z. Zeng, "Computing Multiple Roots of Inexact Polynomials,"
Corporation, Torrance, California, for his useful discussions and Mathematics ofComputation, 74, 2005, pp. 869-903.
comments on the preparation of the manuscript.

»
» % Ex. 1
»A ([30 -1 1; 25 +2 1; 20 -3 1; 15 +4 1; 10 -5 1; 5 +6 1]);
» p = polyget(A);
» Z = polyroots(p),
Z
-6.00000 5
5.00000 10
-3.99999 15
-2.00000 25
2.99999 20
1.00000 30

» % Ex. 2
» A [10 9 8 7 6 5 4 3 2 1] ;
» p polyget (A) ;
» Z polyroots (p) ,
Z
-1.2887 + 0.4476i 10
-1.2887 - 0.4476i 10
-0.7243 + 1.1369i 10
-0.7243 - 1.1369i 10
0.1363 + 1.3049i 10
0.1363 - 1.3049i 10
0.8767 + 0.8813i 10
0.8767 - 0.8813i 10

» % Ex. 3
» A [9 -1+2i 1; 8 3-4i 1; 7 -5-6i 1] ;
» p polyget (A) i
» Z polyroots (p) I
Z
5.0000 + 6.0000i 7
-3.0000 + 4.0000i 8
1.0000 - 2.0000i 9

» % Ex. 4
» A [9 -1.1234 1; 8 +2.5678 1; 7 -3.9123 1; 6 +4.4567 1;
» 5 -5.8912 1; 4 +6.3456 1; 3 -7.7891 1; 2 +8.2345 1;
» 1 -9.6789 1]) i
» p polyget (A) i
» Z polyroots (p) ,
Z
9.6789 1
-8.2345 2
7.7891 3
-6.3456 4
5.8912 5
-4.4567 6
3.9123 7
-2.5678 8
1.1234 9

Figure 4. The results of using the MATLAB code to solve for


the roots and multiplicities of example polynomials 1-4 from
the Appendix.

154 IEEE Antennasand Propagation Magazine, Vo/. 51, No. 6, December2009


» % Ex. 5 8. Appendix: Additional Examples
» p = polyget ( [24 -987 1·, 13 1 506] ) i
» Z = polyroots (p) ,
Z The roots and multiplicities from the following example test
987.00000 24 polynomials expanded are given in Figures 4 and 5:
-0.00197 13

» % Ex. 6 1. p(z) =(z_1)30 (z+2)25 (z_3)20 (z+4)15 (z_5)10 (z+6)5


» p = polyget ( [1500 1 0 0 0 0 1] ) i
» Z = polyroots (p) ,
Z
-1.0000 + O.OOOOi 1500
-0.3090 + 0.9510i 1500
p (z ) = ( z -1 + 2i) (z + 3- 4i)8 (z - 5 - 6i)7
-0.3090 - 0.9510i 1500 9
3.
0.8090 + 0.5877i 1500
0.8090 - 0.5877i 1500
7
4. p (z) = (z -1.1234)9 (z + 2.5678)8 (z - 3.9123) (z + 4.4567)6
» % Ex. 7
» p = polyget ( [1000 -1 0 0 0 0 0 0 0 1] ) i (z - 5.8912)5 (z + 6.3456)4 (z -7.7891)3 (z + 8.2345)2
» Z = polyroots (p) ,
Z (z -9.6789)
-1.0000 + O.OOOOi 1000
-0.7071 + 0.7071i 1000
-0.7071 - 0.7071i 1000 5. p (z ) = ( 506z + 1)13 ( z - 987 )24
0.0000 + 1.0000i 1000
0.0000 - 1.0000i 1000
1.0000 + O.OOOOi 1000 6. ( tOO
p(z) = z5 +1
0.7071 + 0.7071i 1000
0.7071 - 0.7071i 1000

» % Ex. 8
7. ( tOO
p(z) = z8_ 1
» p = polyget([70 -9876 12345]) i
» Z = polyroots(p),
Z 8. p(z) = (12345z -9876)70
0.8 70
» % Ex. 9
» p = polyget([1234 1 123456789]) i
9. p( z) = (123456789z _1)1234
» Z = polyroots(p),
Z
-8.10000007371e-009
10. p( z) = (z -123456789)9876
1234

» % Ex. 10
» p = polyget([9876 -123456789 1]) i
» Z = polyroots(p),
Z
123456789 9876

Figure 5. The results of using the MATLAB code to solve for


the roots and multiplicities of example polynomials 5-10 from
the Appendix.

IEEE Antennasand Propagation Magazine, Vol. 51, No. 6, December 2009 155

You might also like