Generalized Companion Matrices for Polynomials not ... - CiteSeerX

1 downloads 0 Views 112KB Size Report
not expressed in Monomial Bases. Robert M. ... than that for the monomial basis companion matrix. .... after all, are linear in the si through divided differences).
Generalized Companion Matrices for Polynomials not expressed in Monomial Bases Robert M. Corless and Gurjeet Litt Ontario Research Centre for Computer Algebra

This short note gives formulae (derived by linear transformations) for the entries in companion matrices for polynomials not expressed in the monomial basis {1, x, x2 , . . . , xn }. Most proofs are omitted because verification a posteriori is simple. One reason these formulae may be interesting is that the condition number for the eigenvalue problem for the generalized companion matrix is, in some cases, smaller than that for the monomial basis companion matrix.

form for polynomials expressed in the Lagrange basis, which does not have a three-term recurrence relation. This allows direct expression of an eigenvalue problem for matrix pencils to give roots of polynomials (or eigenvalues of matrix polynomials) directly given the values of the matrix polynomials at n + 1 distinct points. This direct formulation may be quite useful for applications where interpolation gives efficiency gains to the algorithm, and it may also be possible to choose interpolation points to give improved conditioning to the resulting eigenproblem.

1.1

2

1

Introduction

History

Several people have rediscovered the fact that companion matrix pencils can be deduced for matrix polynomials expressed in orthogonal polynomial bases, and variously called these matrices “comrade” matrices or “colleague” matrices. This overly cute naming just obscures a literature search, where you would like to be able to find references by looking simply for companion matrix, or ‘generalized companion matrix’. The most general result seems to be that of Barnett, who noticed that given a basis of polynomials φk (x) expressible by a three-term recurrence relation, as is always the case for orthogonal polynomials for example, then one can write down a generalized companion matrix pencil for the polynomial p(x) =

n X

Monomial basis companion matrix pencil

If p(x) = p0 + p1 x + p2 x2 + . . . + pn xn , then put

   

CM = 

and

0 0 .. . 0 −p0

1 0

 1 ..

0 −p1

 

BM =  

..

. 0

. ··· ···

1 −pn−1

   



1 1 ..

 . 

. pn

ck φk (x) ,

Then a straightforward computation, say by expansion by minors along the first column, shows that

k=0

that is, a pair of n by n sparse matrices, say C and B, such that p(x) = det(C − xB) .

p(x) = det(xBM − CM ) .

(1)

That is, the eigenvalues of the matrix pencil (CM , BM ) are the roots of p(x). This useful observation is the foundation of a stable though somewhat inefficient method for computing roots of polynomials: given a polynomial, construct its companion matrix pencil, and find the eigenvalues by a standard routine [3, 1]. This is how the “roots” command in Matlab works. Explaining the observed stability of this method is not trivial, and not completely resolved even yet.

Of course this can be done by expressing each φk (x) in terms of the monomial basis xk , but that means that the matrices C and B have entries made up of linear combinations of the ck , and we would like to be able to keep those linear combinations as simple as possible. These results may be used not just for orthogonal polynomials, but polynomials of any kind of three-term recurrence. The monomial basis fits into this category, with trivial three-term recurrence xk+1 = Q x · xk + 0 · xk−1 , and k−1 an arbitrary Newton basis νk = (x − rj ), because j=1 νk+1 = (x − rk )νk + 0 · νk−1 is again a trivial three-term recurrence relation. This fact seems not to have been noticed. A discovery, apparently new to this paper, is that we may also write down a (quite different) companion matrix

3

Newton basis Companion Matrix Pencil

Suppose however that we are given p(x) expressed as p(x) = a0

1

+ +

a1 (x − r1 ) + a2 (x − r1 )(x − r2 ) + . . . an (x − r1 )(x − r2 ) . . . (x − rn ) ,

which uses the Newton basis {1, x − r1 , (x − r1 )(x − r2 ), . . . , (x−r1 )(x−r2 ) . . . (x−rn )} that occurs, for example, on interpolation at the points x = r1 , x = r2 , . . ., x = rn+1 . The coefficients ai are divided differences [2]. To find a companion matrix for p(x) expressed in this basis, we could of course simply convert to a monomial basis and then use the previous form. This is unsatisfactory because the conversion process may introduce further unwanted rounding errors, if we use floating point arithmetic. But because of the ai are linearly related to the pi , it ought to be possible to express the matrix pencil directly in terms of the ai . Theorem : Put

CM

 r 1  0  =  ... 

1 r2 .. . ··· −a1

0 −a0

and

1 −an−1 + rn an

u

1

 = 

..

   

A 2 B   0 C  det    4 D α β γ δ E  1 0 0  0 2 0 6 = (−1) γ det  0 0 0 0 0 4 " 1 = (−1)6 (−1)5 γC det



Remark 1 : The ri do not have to be distinct, and therefore this form works even when the ai have been determined by solving a confluent system.

 r −r j 1    = det    

If we suppose that p(ri ) = si , 1 ≤ i ≤ n + 1 , and moreover now also suppose that ri 6= rj if i 6= j, then we can transform the companion matrix pencil (CN , BN ) of the previous section into one where the si appear instead of the ai (which, after all, are linear in the si through divided differences).

s1

..

s2



A B  C  D

# 2

−t1 .. . −tj .. . −tn−1 −tn + rj u

. 0 ..

. . . −sj

. rj − rn−1 −sn−1

...

       

= (−1)n−1+j−1 (−sj )×

(x − rj ) and j=1

rn−1 · · · sn−1

..

−s1

Qk

.



det(rj BI − CI )

A GCM using values of p(x) at x = ri , 1 ≤ i ≤ n+1.

t1 t2 .. . tn−1 tn

1

. 4 That gives an idea of what happens in the general case, which we now consider:

Proof: Expansion by minors along the first column, and induction.

 r 1 r2   CI =  

(3)

Case(i) : Expansion by minors of a 5 x 5 example is clarifying:

pn

Theorem : Let Qk (x) =

sj . Q0n+1 (rj )

Proof We distinguish cases: (i) 1 ≤ j ≤ n − 1, (ii) j = n and j = n + 1.

Then p(x) = det(xBM − CM ).

4

X

Then if we put p(x) = det(xBI − CI ), we have p(rj ) = sj , 1 ≤ j ≤ n + 1.

 . 

.

=

j=1



1

(2) n+1

 1 .. .. . . 0 rn−1 · · · −an−2

 BM

and

 r −r j 1 rj − r2    det    

    

and

..

−t1 −t2 .. . −tj .. . −tn−1

. 0 ..

. rj − rn−1

       

= (−1)n−1+j−1 (−sj )(−1)n−2+j−1 (−tj )×





1 1

 BI =  

..

 r −r j 1    det    

  where 

. u

tj tn

−1

= − Q0n−1 (rj ) =

..

.

      

rj − rj−1 rj − rj+1 ..

1≤j ≤n−1

. rj − rn

n+1 X (rn+1 + rn − rj )sj j=1



= sj tj of tj .

Q0n+1 (rj )

2

Qj−1 i=1

(rj −ri )

Qn−1 i=j+1

(rj −ri ) = +sj by the definition

Case(ii) : j = n or j = n + 1. Expansion by minors along the last row gives

and

 r I 1 r2 I   CI =  

det(rj BI − CI )

 r −r j 1 rj − r2   = det   −s1

..

.

rj − rn−1 . . . −sn−1

−s2

= (rj u − tn )Q0n−1 (rj ) −

n−1 X i=1

−t1 −t2 .. . −tn−1 rn u − tn



S1

   

rn u − tn =

sn − Q0n−1 (rn )

i=1

. rn−1 I Sn−1

···

S2



tn−1 I Tn

   

and

 



I I

BI =  

Q0 (rj ) si ti n−1 . rj − ri

..

  

. U

where

We wish to calculate u and tn so that the results are sn and sn+1 if j = n or n + 1 respectively. These conditions give n−1 X

..

t1 I t2 I .. .

Tn

si (rn − ri )Q0n−1 (ri )

=

n+1 X (rn+1 + rn − rj )Sj

Q0n+1 (rj )

j=1

U

and

=

n+1 X j=1

Sj Q0n+1 (rj )

n−1

X sn+1 si − , rn+1 u − tn = 0 Qn−1 (rn+1 ) (rn+1 − ri )Q0n−1 (ri )

are sums of m × m matrices. In all cases, p(x) = det(xBM − CM ) = det(xBN − CN ) = det(xBI − CI ) as before.

and solving these two linear equations and simplification of the results gives us the formulae for u and tn in equation (3).

6

i=1

5

Companion Matrices using three-term recurrence relations

Suppose φi (x) satisfy, for 0 ≤ i ≤ n, the following recurrence relations.

Extension to Matrix Polynomials

All of the companion matrix pencils discussed in the previous section extend straightforwardly to matrix polynomials p(x)

= = =

φ0 (x) = 1, α0 φ1 (x) + β0 φ0 (x) = xφ0 (x), αn φn+1 (x) + βn φn (x) + γn φn−1 (x) = xφn (x).

P0 + xP1 + x2 P2 + · · · + xn Pn A0 + (x − r1 )A1 + (x − r1 )(x − r2 )A2 + · · · + (x − r1 )(x − r2 ) · · · (x − rn )An Si when x = ri .

For example, rewriting the familiar recurrence relation Tn+1 (x) = 2xTn (x) − Tn−1 (x) for the Chebyshev polynomials gives 12 Tn+1 (x) + 0Tn (x) + 12 Tn−1 (x) = xTn (x). The choice (αn , βn , γn ) = (1, 0, 0) gives φn (x) = xn , the monomial basis, whilst (αn , βn , γn ) = (1, rn , 0) gives φn (x) = (x − r1 )(x − r2 ) . . . (x −P rn ), the Newton basis. n Theorem : If p(x) = φ (x)Bi , where each Bi is an i=0 i m×m matrix, then p(x) = α0 α1 . . . αn−2 det(xBorth −Corth ) where,

Pi , Ai and Si are all m × m matrices. The companion forms are



r1 I

   CN =   



I r2 I

−A0

−A1

..

.

..

.

...

I rn−1 I −An−2

I (−An−1 + rn An )

     

β0 I  γ1 I

 Corth

and

 I I   BN =  

−B0

 ..

I

−B1

 α1 I β2 I .. . ...

α2 I .. . γn−2 I −Bn−3

An

D = −Bn−2 +

3

..

. βn−2 I D

where

   

.

  =  

α0 I β1 I γ2 I

γn−1 Bn , αn−1

αn−2 I E

     

E = −Bn−1 +

βn−1 Bn , αn−1

condition number of eigenvectors in the interpolation basis is

and I is an m × m identity matrix, and Borth is 1 Bn ). diag(I, I, . . . , I, αn−1

C=

Proof : Let v0 be an m × 1 eigenvector of the matrix polynomial p(x) corresponding to the eigenvalue λ. Then consider the vector v = [φ0 (λ)v0 , φ1 (λ)v0 , . . . , φn−1 (λ)v0 ]. A straightforward computation shows that [Corth − λBorth ]v = 0. Evaluation of det(xBorth − Corth ) near x = ∞ gives the 1 leading coefficent as αn−1 Bn . The result follows.

 T

u v=

v=

7

.. . tn−1 (λ−rn−1 )

     

1 si . (λ − ri )2 Q0n−1 (ri )

Using the infinity norm for example,

−t1 v0 −t2 v0 −tn−1 v0 , ,..., ,1 r1 − λ r2 − λ rn−1 − λ

kuk∞

Left Eigenvectors

kuT kkvk . |uT v|

n−1 X i=1



c=

     



1

=1−

To evaluate the condition number of a given simple eigenvalue λ, we need the left eigenvector u corresponding to λ also. Then the condition number c of the eigenvalue of the matrix pencil (C, B) corresponding to the left and right eigenvectors u and v is

kvk∞

=

|si | ,1 |λ − ri |



|si | ,1 . |(λ − ri )Q0n−1 (ri )|

max 1≤i≤n−1

=

max 1≤i≤n−1







We do not at this time know how to choose the ri (and hence the si ) so that the eigencondition numbers are good. That these condition numbers vary with ri is obvious (c = 1 if each ri is a distinct eigenvalue, for example). The purpose of this note is to lay these formulae in front of the reader, in the hope that they will be of some use. One example use is in the solution of the problem of the intersection of a polynomially parametric curve xk = xk (t), 1 ≤ k ≤ m, with a surface defined by det F = 0 where F is a matrix of polynomials in xk . See question 4.16 of Demmel and the references there for applications. Using the formulation of this note, we may sample the curve at a finite number of points, set up the matrix pencil, and search for real eigenvalues.

(4)

We can derive this equation by considering perturbations ˜ ˜b) = (C + sλE, B + sF ) and differentiating of (C, B) to (C, ˜ uT B ˜ = λ˜ ˜ with respect to s, at s = 0. u ˜T C The left eigenvectors for the monomial basis pencil are known in simple form [?], and hence we know that they can be found here as well. 8

sn−1 s1 [ λ−r , s2 , . . . , λ−r , 1] 1 λ−r2 n−1

t1 (λ−r1 ) t2 (λ−r2 )

.

Remark We have just found a formula for the right eigenvectors in the three-term recurrence case, generalizing the known formula for the monomial basis. A short computation shows that for (CI , BI ) the right eigenvector is, if all ri = λ,



kukkvk . |uT v|

Left eigenvectors in the interpolation basis References

We look for vectors u such that uT CI = λuT BI .



r2



or uT  

..

s1

[1] Gene Golub and Charles Van Loan. Matrix Computations. Johns Hopkins, 2nd edition, 1989.



r1

s2

. ...

sn−1

t1 t2  ..   . tn

[2] Nicholas J. Higham. Accuracy and Stability of Numerical Algorithms. Society for Industrial and Applied Mathematics, Philadelphia, PA, USA, 1996. [3] Lloyd N. Trefethen and D. Bau. Numerical Linear Algebra. SIAM, 1997.

  = λuT   .



I I ..

  

. u

Suppose u = [u1 , u2 , . . . , un−1 , 1]T . Then ri ui + si = λui or ui = −si /(−ri + λ) = si /(λ − ri ) when 1 ≤ i ≤ n − 1. If some ri happened to be an eigenvalue, we would have si = 0 and hence u = ei for that eigenvalue. Therefore the

4