CharacteristicPolynomial - California State University...

17
Characteristic Polynomial Massoud Malek Preliminary Results . In all that follows, we denote the n × n identity matrix by I n and the n × n zero matrix by Z n . Let A =(a ij ) be an n ×n matrix. If Au = λu, then λ and u are called the eigenvalue and eigenvector of A, respectively. The eigenvalues of A are the roots of the characteristic polynomial K A (λ) = det ( λI n - A ) . The eigenvectors are the solutions to the Homogeneous system (λI n - A) X = θ. Note that K A (λ) is a monic polynomial (i.e., the leading coefficient is one). Cayley-Hamilton Theorem. If K A (λ)= λ n + p 1 λ n-1 + ··· + p n-1 λ + p n is the characteristic polynomial of the n × n matrix A, then K A (A)= A n + p 1 A n-1 + ··· + p n-1 A + p n I n = Z n , Corollary. Let K A (λ)= λ n + p 1 λ n-1 + ··· + p n-1 λ + p n be the characteristic polynomial of the n × n invertible matrix A. Then A -1 = 1 -p n A n-1 + p 1 A n-2 + ··· + p n-2 A + p n-1 I n . Proof. According to the Cayley Hamilton’s theorem we have A A n-1 + p 1 A n-2 + ··· + p n-1 I n = -p n I n . Since A is nonsingular, p n =(-1) n det(A) 6=0; thus the result follows. Newton’s Identity. Let λ 1 2 ,...,λ n be the roots of the polynomial K(λ)= λ n + p 1 λ n-1 + p 2 λ n-2 + ··· ··· + p n-1 λ + p n . If s k = λ k 1 + λ k 2 + ··· + λ k n , then p k = - 1 k (s k + s k-1 p 1 + s k-2 p 2 + ··· + s 2 p k-2 p 1 + s 1 p k-1 ) . Proof. From K(λ)=(λ - λ 1 )(λ - λ 2 ) ... ... (λ - λ n-1 )(λ - λ n ) and the use of logarithmic differentiation, we obtain K 0 (λ) K (λ) = n-1 +(n - 1) c 1 λ n-2 + ··· +2 c n-2 λ + c n-1 λ n + c 1 λ n-1 + c 2 λ n-2 + ··· + c n-1 λ + c n = n X i=1 1 (λ - λ i ) . By using the geometric series for 1 (λ - λ i ) and choosing |λ| > max 1in |λ i |, we obtain n X i=1 1 (λ - λ i ) = n λ + s 1 λ 2 + s 2 λ 3 + ······ Hence n-1 +(n - 1) p 1 λ n-2 + ··· + p n-1 = ( λ n + p 1 λ n-1 + p 2 λ n-2 + ··· + p n ) n λ + s 1 λ 2 + s 2 λ 3 + ··· . By equating both sides of the above equality we may obtain the Newton’s identities.

Transcript of CharacteristicPolynomial - California State University...

Page 1: CharacteristicPolynomial - California State University ...malek/Class/Characteristic.pdfCharacteristicPolynomial ... be the characteristic polynomial of the matrix A, ... Find the

Characteristic PolynomialMassoud Malek

♣ Preliminary Results. In all that follows, we denote the n × n identity matrix by In and then× n zero matrix by Zn.

Let A = (aij) be an n×n matrix. If Au = λu, then λ and u are called the eigenvalue and eigenvectorof A, respectively. The eigenvalues of A are the roots of the characteristic polynomial

KA(λ) = det (λ In −A ) .

The eigenvectors are the solutions to the Homogeneous system (λ In −A)X = θ.

Note that KA(λ) is a monic polynomial (i.e., the leading coefficient is one).

Cayley-Hamilton Theorem. If KA(λ) = λn + p1 λn−1 + · · ·+ pn−1 λ+ pn is the characteristic

polynomial of the n× n matrix A, then

KA (A) = An + p1An−1 + · · ·+ pn−1A+ pnIn = Zn,

Corollary. Let KA(λ) = λn + p1λn−1 + · · · + pn−1λ + pn be the characteristic polynomial of the

n× n invertible matrix A. Then

A−1 =1

−pn[An−1 + p1A

n−2 + · · ·+ pn−2A+ pn−1In].

Proof. According to the Cayley Hamilton’s theorem we have

A[An−1 + p1A

n−2 + · · ·+ pn−1 In]

= −pn In .

Since A is nonsingular, pn = (−1)n det(A) 6= 0; thus the result follows.

Newton’s Identity. Let λ1, λ2, . . . , λn be the roots of the polynomial

K(λ) = λn + p1λn−1 + p2λ

n−2 + · · · · · ·+ pn−1λ+ pn.

If sk = λk1 + λk2 + · · ·+ λkn, then

pk = −1

k(sk + sk−1 p1 + sk−2 p2 + · · ·+ s2 pk−2p1 + s1 pk−1) .

Proof. From K(λ) = (λ − λ1)(λ − λ2) . . . . . . (λ − λn−1)(λ − λn) and the use of logarithmicdifferentiation, we obtain

K ′(λ)

K (λ)=nλn−1 + (n− 1) c1λ

n−2 + · · ·+ 2 cn−2λ+ cn−1λn + c1λn−1 + c2λn−2 + · · ·+ cn−1λ+ cn

=

n∑i=1

1

(λ− λi).

By using the geometric series for1

(λ− λi)and choosing |λ| > max

1≤i≤n|λi|, we obtain

n∑i=1

1

(λ− λi)=n

λ+s1λ2

+s2λ3

+ · · · · · ·

Hence nλn−1 + (n− 1) p1 λn−2 + · · ·+ pn−1 =

(λn + p1 λ

n−1 + p2 λn−2 + · · ·+ pn

)(nλ

+s1λ2

+s2λ3

+ · · ·).

By equating both sides of the above equality we may obtain the Newton’s identities.

Page 2: CharacteristicPolynomial - California State University ...malek/Class/Characteristic.pdfCharacteristicPolynomial ... be the characteristic polynomial of the matrix A, ... Find the

The Method of Direct Expansion Characteristic Polynomial 2

♣ The Method of Direct Expansion. The characteristic polynomial of an n× n matrix A =(aij) is defined as:

KA(λ)=det(λIn −A)=

∣∣∣∣∣∣∣∣∣λ− a11 −a12 . . . −a1n−a21 λ− a22 . . . −a2n

......

. . ....

−an1 −an2 . . . λ− ann

∣∣∣∣∣∣∣∣∣=λn−σ1λn−1+σ2λn−2−· · ·+ (−1)nσn,

where

σ1 =n∑

i=1

aii = trace(A)

is the sum of all first-order diagonal minors of A,

σ2 =∑i<j

∣∣∣∣aii aijaji ajj

∣∣∣∣is the sum of all second-order diagonal minors of A,

σ3 =∑

i<j<k

∣∣∣∣∣∣aii aij aikaji ajj ajkaki akj akk

∣∣∣∣∣∣is the sum of all third-order diagonal minors of A, and so forth. Finally,

σn = det(A)

There are

(n

k

)diagonal minors of order k in A. From this we find that the direct computation of

the coefficients of the characteristic polynomial of an n× n matrix is equivalent to computing(n

1

)+

(n

2

)+ · · ·

(n

n

)= 2n − 1

determinants of various orders, which, generally speaking, is a major task. This has given rise tospecial methods for expanding characteristic polynomial. We shall explain some of these methods.

Example. Compute the characteristic polynomial of A =

1 2 32 1 −41 0 2

.

We have:

σ1 = 1 + 1 + 2 = 4,

σ2 =

∣∣∣∣1 22 1

∣∣∣∣+

∣∣∣∣1 −40 2

∣∣∣∣+

∣∣∣∣1 31 2

∣∣∣∣ = (−3) + (2) + (−1) = −2,

σ3 = det(A) =

∣∣∣∣∣∣1 2 32 1 −41 0 2

∣∣∣∣∣∣ = −17.

ThusKA(λ) = det(λI3 −A) = λ3 − σ1λ2 + σ2λ− σ3 = λ3 − 4λ− 2λ+ 17.

Page 3: CharacteristicPolynomial - California State University ...malek/Class/Characteristic.pdfCharacteristicPolynomial ... be the characteristic polynomial of the matrix A, ... Find the

Leverrier’s Algorithm Characteristic Polynomial 3

♣ Leverrier’s Algorithm. This method allows us to find the characteristic polynomial of any

n× n matrix A using the trace of the matrix Ak, where k = 1, 2, · · ·n. Let

σ(A) = {λ1, λ2, · · · , λn}

be the set of all eigenvalues of A which is also called the spectrum of A. Note that

sk = trace(Ak) =n∑

i=1

λki , for all k = 1, 2, · · · , n.

LetKA(λ) = det(λIn −A) = λn + p1λ

n−1 + · · ·+ pn−1λ+ pn

be the characteristic polynomial of the matrix A, then for k ≤ n, the Newton’s identities hold true:

pk = −1

k[sk + p1sk−1 + · · ·+ pk−1s1] (k = 1, 2, · · · , n)

Example. Let A =

1 2 1 −11 0 2 12 1 −1 34 −5 0 4

. Then

A2 =

1 8 4 09 −1 −1 913 −12 5 815 −12 −6 7

A3 =

17 6 13 1942 −28 8 2343 −9 −16 2219 −11 −3 −17

A4 =

125 −48 16 104122 −23 −22 4690 −40 41 −12−66 120 0 −107

.So s1 = 4 , s2 = 12 , s3 = −44 , and s4 = 36. Hence

p1 = −s1 = −4,

p2 = −1

2(s2 + p1s1) = −1

2(12 + (−4)4) = 2,

p3 = −1

3(s3 + p1s2 + p2s1) = −1

3(−44 + (−4)12 + 2(4)) = 28,

p4 = −1

4(s4 + p1s3 + p2s2 + p3s1) = −1

4(36 + (−4)(−44) + 2(12) + 28(4)) = −87.

ThereforeKA(λ) = λ4 − 4λ3 + 2λ2 + 28λ− 87

and

A−1 =1

87

[A3 − 4A2 + 2A+ 28 I4

]=

1

87

17 6 13 1942 −28 8 2343 −9 −16 2219 −11 −3 −17

−4

1 8 4 09 −1 −1 913 −12 5 815 −12 −6 7

+2

1 2 1 −11 0 2 12 1 −1 34 −5 0 4

+28

1 0 0 00 1 0 00 0 1 00 0 0 1

=1

87

43 −22 −1 178 4 16 −11−5 41 −10 −4−33 27 21 −9

.

Page 4: CharacteristicPolynomial - California State University ...malek/Class/Characteristic.pdfCharacteristicPolynomial ... be the characteristic polynomial of the matrix A, ... Find the

The Method of Souriau Characteristic Polynomial 4

♣ The Method of Souriau (or Fadeev and Frame). This is an elegant modification ofthe Leverrier’s method.

Let A be an n× n matrix, then define

A1 = A, q 1 = −trace(A1), B1 = A1 + q1In;A2 = AB1, q 2 = −1

2 trace(A2), B2 = A2 + q2In;...

......

......

......

......

...An−1 = ABn−2, qn−1 = − 1

n−1 trace(An−1), Bn−1 = An−1 + qn−1In;

An = ABn−1, qn = − 1n trace(An), Bn = An + qnIn

.

Theorem. Bn = Zn, and

KA(λ) = det(λIn −A) = λn + q 1λn−1 + · · ·+ qn−1λ+ qn ,

where Adj (A) = Bn−1 and if A is nonsingular, then

A−1 = − 1

qnBn−1 .

Proof. Suppose the characteristic polynomial of A is

KA(λ) = det(λIn −A) = λn + p1λn−1 + · · ·+ pn−1λ+ pn ,

where p′ks are defined in the Leverrier’s method.

Clearly p1 = −trace(A) = −trace(A1) = q1, and now suppose that we have proved that

q1 = p1, q2 = p2, . . . , qk−1 = pk−1 .

Then by the hypothesis we have

Ak = ABk−1 = A(Ak−1 + qk−1In) = AAk−1 + qk−1A

= A[A(Ak−2 + qk−2In)] + qk−1A

= A2Ak−1 + qk−2A2 + qk−1A

=...

......

......

...

= Ak + q1Ak−1 + · · · + qk−1A .

Let si = trace(Ai) (i = 1, 2, . . . , k), then by Newton’s identities

−kqk = trace(Ak) = trace(Ak) + q1 trace(Ak−1) + · · ·+ qk−1 trace(A)

= sk + q1sk−1 + · · ·+ qk−1s1

= sk + p1sk−1 + · · ·+ pk−1s1

= −kpk .

showing that pk = qk. Hence this relation holds for all k.

By the Cayley-Hamilton theorem,

Bn = An + q1An−1 + · · ·+ qn−1A+ qnIn = Zn .

and soBn = An + qnIn = Zn; An = ABn−1 = −qnIn.

If A is nonsingular, then det(A) = (−1)nKA(0) = (−1)nqn 6= 0, and thus

A−1 = − 1

qnBn−1 .

Page 5: CharacteristicPolynomial - California State University ...malek/Class/Characteristic.pdfCharacteristicPolynomial ... be the characteristic polynomial of the matrix A, ... Find the

The Method of Souriau Characteristic Polynomial 5

Example. Find the characteristic polynomial and if possible the inverse of the matrix

A =

1 2 1 −11 0 2 12 1 −1 34 −5 0 4

.

For k = 1, 2, 3, 4, compute

Ak = ABk−1 qk =−1

ktrace(Ak), Bk = Ak + qkI4 .

A1 =

1 2 1 −11 0 2 12 1 −1 34 −5 0 4

, q1 = −4, B1 =

−3 2 1 −11 −4 2 12 1 −5 34 −5 0 0

;

A2 =

−3 0 0 45 −1 −9 55 −16 9 −4−1 8 −6 −9

, q2 = 2, B2 =

−1 0 0 45 1 −9 55 −16 11 −4−1 8 −6 −7

;

A3 =

15 −22 −1 178 −24 16 −11−5 41 −38 −4−33 27 21 −37

, q3 = 28, B3 =

43 −22 −1 178 4 16 −11−5 41 −10 −4−33 27 21 −9

;

A4 =

87 0 0 00 87 0 00 0 87 00 0 0 87

, q4 = −87, B4 =

0 0 0 00 0 0 00 0 0 00 0 0 0

.

Therefore the characteristic polynomial of A is:

KA(λ) = λ4 − 4λ3 + 2λ2 + 28λ− 87.

Note that A4 is a diagonal matrix, so we only need to multiply the first row of A by the first columnof B3 to obtain 87. Since q4 = −87, the matrix A has an inverse.

A−1 =−1

q4B3 =

1

87

43 −22 −1 178 4 16 −11−5 41 −10 −4−33 27 21 −9

.

Matlab ProgramA = input(′Enter a square matrix : ′)

m = size(A); n = m(1); q = zeros(1, n); B = A; AB = A; In = eye(n);

for k = 1 : n− 1, q(k) = −(1/k) ∗ trace(AB)B = AB + q(k) ∗ In; AB = A ∗B; end

C = B; q(n) = −(1/n) ∗ trace(AB); Q = [1 q];

disp(′The Characteristic polynomial looks like : ′)

disp( ′KA(x) = x ∧ n+ q(1)x ∧ (n− 1) + ...+ q(n− 1)x+ q(n)′ ), disp(′ ′),

disp(′The coefficients list c(k) is : ′), disp(′ ′),

disp(Q), disp(′ ′)

if q(n) == 0, disp(′The matrix is singular ′);

else, disp(′The matrix has an inverse. ′), disp(′ ′)

C = −(1/q(n)) ∗B;

disp(′The inverse of A is : ′), disp(′ ′),

disp(C)

end

Page 6: CharacteristicPolynomial - California State University ...malek/Class/Characteristic.pdfCharacteristicPolynomial ... be the characteristic polynomial of the matrix A, ... Find the

The Method of Undetermined Coefficients Characteristic Polynomial 6

♣ The Method of Undetermined Coefficients. If one has to expand large numbers of char-acteristic polynomials of matrices of the same order, then the method of undetermined coefficientsmay be used to produce characteristic polynomials of those matrices.

Let A be an n× n matrix and

KA(λ) = det (λ In −A) = λn + p1λn−1 + · · ·+ pn−1λ+ pn .

be its characteristic polynomial. In order to find the coefficients pi’s of KA(λ) we evaluate

Dj = KA(j) = det (jIn −A) j = 0, 1, 2, . . . , n− 1

and obtain the following system of linear equations:

pn = D0

1n + p1.1n−1 + · · · · · · · · · · · · · · ·+ pn = D1

2n + p1.2n−1 + · · · · · · · · · · · · · · ·+ pn = D2

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

(n− 1)n + p1.(n− 1)n−1 + · · ·+ pn = Dn−1

Which can be changed into:

Sn−1P =

1n−1 1n−2 . . . 12n−1 2n−2 . . . 2

......

. . ....

(n− 1)n−1 (n− 1)n−2 . . . n− 1

p1p2...

pn−1

=

D1 −D0 − 1n

D2 −D0 − 2n

......

......

Dn−1 −D0 − (n− 1)n

= D .

The system may be solved as follows:P = S −1n D .

Since the (n− 1)× (n− 1) matrix Sn depends only on the order of A, we may store Rn, the inverseof Sn−1 beforehand and use it to find the coefficients of characteristic polynomial of various n × nmatrices.

Examples. Compute the characteristic polynomials of the 4× 4 matrices

A =

1 3 0 42 −3 1 31 2 1 2−1 3 2 1

and B =

1 2 1 −11 0 2 12 1 −1 34 −5 0 4

.

First we find

S =

1 1 18 4 227 9 3

and R = S−1 = − 1

12

−6 6 −230 −24 6−36 18 −4

.

Then for the matrix A we obtain

D0 = det(−A) = −48, D1 = det(I4 −A) = −72,

D2 = det(2I4 −A) = −128, and D3 = det(3I4 −A) = −180 .

D =

D1 −D0 − 14

D2 −D0 − 24

D3 −D0 − 34

=

−25−96−213

.

Hence

P =

p1p2p3

= − 1

12

−6 6 −230 −24 6−36 18 −4

−25−96−213

=

0−23−2

.

Page 7: CharacteristicPolynomial - California State University ...malek/Class/Characteristic.pdfCharacteristicPolynomial ... be the characteristic polynomial of the matrix A, ... Find the

The Method of Undetermined Coefficients Characteristic Polynomial 7

ThusKA(λ) = λ4 − 23λ2 − 2λ− 48.

For the matrix B we have

D0 = det(−B) = −87, D1 = det(I4 −B) = −60,

D2 = det(2I4 −B) = −39, and D3 = det(3I4 −B) = −12.

D =

D1 −D0 − 14

D2 −D0 − 24

D3 −D0 − 34

=

2632−6

.

Hence

P =

p1p2p3

= − 1

12

−6 6 −230 −24 6−36 18 −4

2632−6

=

−4228

.

ThusKB(λ) = λ4 − 4λ3 + 2λ2 + 28λ− 87.

Matlab Program

N = input(‘Enter the size of your square matrix : ′);

n = N − 1; In = eye(N); S = zeros(n); R = zeros(n); D = zeros(1, n);

DSP1 = [ ′ For any ′, int2str(N),′−square matrix, you need S =′ ];

DSP2 = [ ′Do you want to try with another ′, int2str(N),′−square matrix? (Y es = 1/No = 0)′ ];

%DEFINING S

for i = 1 : n, for j = 1 : n, S(i, j) = i ∧ (N − j); end; end;

disp(′ ′), disp(DSP1), disp(′ ′), disp(S),

R = inv(S);

ok = 1;

while ok == 1;

A = input([′Enteran ′, int2str(N),′ x ′, int2str(N),′ matrix A : ′); disp(′ ′)

D0 = det(A);

for k = 1 : n; D(k) = det(k ∗ In−A); end;

for i = 1 : n; DD(i) = D(i)−D0− i ∧N ; end;

P = R ∗DD′;disp(′The Characteristic polynomial looks like : ′)

disp( ′KA(x) = x ∧ n+ p(1)x ∧ (n− 1) + ...+ p(n− 1)x+ p(n)′ ), disp(′ ′),

disp(′The coefficients list p(k) is : ′), disp(′ ′),

disp([1 P ′ D0]), disp(′ ′),

disp(DSP2), disp(′ ′),

ok = input(DSP2);

end

Page 8: CharacteristicPolynomial - California State University ...malek/Class/Characteristic.pdfCharacteristicPolynomial ... be the characteristic polynomial of the matrix A, ... Find the

The Method of Danilevsky Characteristic Polynomial 8

♣ The Method of Danilevsky. Consider an n× n matrix A and let

KA(λ) = det(λIn −A) = λn + p1λn−1 + · · ·+ pn−1λ+ pn

be its characteristic polynomial. Then the companion matrix of KA(λ)

F [A] =

−p1 −p2 −p3 . . . −pn−1 −pn1 0 0 . . . 0 00 1 0 . . . 0 0...

.... . .

. . ....

...0 0 . . . 1 0 00 0 0 . . . 1 0

is similar to A and is called the Frobenius form of A.

The method of Danilevsky (1937) applies the Gauss-Jordan method to obtain the Frobenius formof an n × n matrix. According to this method the transition from the matrix A to F [A] is doneby means of n− 1 similarity transformations which successively transform the rows of A, beginningwith the last, into corresponding rows of F [A].

Let us illustrate the beginning of the process. Our purpose is to carry the nth row of

A =

a11 a12 a13 . . . a1,n−1 a1na21 a22 a23 . . . a2,n−1 a2na31 a32 a33 . . . a3,n−1 a3n...

......

. . ....

...an1 an2 an3 . . . an,n−1 ann

into the row

(0 0 . . . 1 0

). Assuming that an,n−1 6= 0, we replace the (n−1)th row of the n×n

identity matrix with the nth row of A and obtained the matrix

Un−1 =

1 0 0 . . . 0 00 1 0 . . . 0 0...

.... . . . . .

......

an1 an2 an3 . . . an,n−1 ann0 0 0 . . . 0 1

.

The inverse of Un−1 is

Vn−1 =

1 0 0 . . . 0 00 1 0 . . . 0 0...

.... . . . . .

......

vn−1,1 vn−1,2 vn−1,3 . . . vn−1,n−1 vn−1,n0 0 0 . . . 0 1

.

wherevn−1,i = − ani

an,n−1for i 6= n− 1

and

vn−1,n−1 =1

an,n−1.

Multiplying the right side of A by Vn−1, we obtain

AVn−1 = B =

b11 b12 b13 . . . b1,n−1 b1nb21 b22 b23 . . . b2,n−1 b2n...

.... . . . . .

......

bn−1,1 bn−1,2 bn−1,3 . . . bn−1,n−1 bn−1,n−10 0 0 . . . 1 0

Page 9: CharacteristicPolynomial - California State University ...malek/Class/Characteristic.pdfCharacteristicPolynomial ... be the characteristic polynomial of the matrix A, ... Find the

The Method of Danilevsky Characteristic Polynomial 9

However the matrix B = AMn−1 is not similar to A. To have a similarity transformation, it isnecessary to multiply the left side of B by Un−1 = V −1n−1. Let C = Un−1AVn−1, then C is similar toA and is of the form

C =

c11 c12 c13 . . . c1,n−1 c1nb21 b22 b23 . . . b2,n−1 b2n...

.... . . . . .

......

cn−1,1 cn−1,2 cn−1,3 . . . cn−1,n−1 cn−1,n−10 0 0 . . . 1 0

Now, if cn−1,n−1 6= 0, then similar operations are performed on matrix C by taking its (n− 2)th rowas the principal one. We then obtain the matrix

D = Un−2CVn−2 = Un−2Un−1AVn−1Vn−2

with two reduced rows. We continue the same way until we finally obtain the Frobenius form

F [A] = U1U2 · · ·Un−2Un−1AVn−1Vn−2 · · ·V2V1 .

if, of course, all the n− 1 intermediate transformations are possible.

Exceptional case in the Danilevsky method. Suppose that in the transformation of the matrixA into its Frobenius form F [A] we arrived, after a few steps, at a matrix of the form

R =

r11 r12 . . . r1k . . . r1,n−1 r1nr21 r22 . . . r2k . . . r2,n−1 r2n...

......

......

......

rk1 rk2 . . . rkk . . . rk,n−1 rkn0 0 . . . 1 . . . 0 00 0 . . . 0 . . . 0 0...

......

......

......

0 0 . . . 0 . . . 1 0

and it was found that rk,k−1 = 0 or |rk,k−1| is very small. It is then possible to continue thetransformation by the Danilevsky method.

Two cases are possible here.

Case 1. Suppose for some j = 1, 2, . . . , k−2, rkj 6= 0. Then by permuting the jth row and (k−1)throw and the jth column and (k− 1)th column of R we obtain a matrix R′ = (r′ij) similar to R withr′k,k−1 6= 0.

Case 2. Suppose now that rkj = 0 for all j = 1, 2, . . . , k − 2. Then R is in the form

R =

[R1 R2

0 R3

]=

r11 r12 . . . r1,k−1 r1,k r1,k+1 . . . r1nr21 r22 . . . r2,k−1 r2,k r2,k+1 . . . r2n...

.... . .

......

. . ....

...rk−1,1 rk−1,2 . . . rk−1,k−1 rk−1,k rk−1,k+1 . . . rk−1,n

......

. . ....

.... . .

......

0 0 . . . 0 rkk rk,k+1 . . . rkn0 0 . . . 0 1 . . . 0 0...

.... . .

......

. . ....

...0 0 . . . 0 0 . . . 1 0

.

In this case the characteristic polynomial of R breaks up into two determinants:

det(λIn −R) = det(λIk−1 −R1) det(λIn−k+1 −R3).

Page 10: CharacteristicPolynomial - California State University ...malek/Class/Characteristic.pdfCharacteristicPolynomial ... be the characteristic polynomial of the matrix A, ... Find the

The Method of Danilevsky Characteristic Polynomial 10

Here, the matrix R3 is already reduced to the Frobenius form. It remains to apply the Danilevsky’smethod to the matrix R1.

Note. Since Uk Ak−1 only changes the kth row of Ak−1, it is more efficient to multiply first Ak−1by its (k + 1)th row and then multiply on the right side the resulting matrix by Vk.

The next result shows that once we transform A into its Frobenius form ; we may obtain theeigenvectors with the help of the matrices V ′i s.

Theorem. Let A be an n × n matrix and let F [A] be its Frobenius form. If λ is an eigenvalue ofA, then

v =

λn−1

λn−2

...λ1

and w = Vn−1Vn−2 · · ·V2V1v

are the eigenvectors of F [A] and A respectively.

Proof. Since

det(λIn −A) = det(λIn − F [A] ) = λn + p1λn−1 + · · ·+ pn−1λ+ pn ,

we have

(λIn − F [A])v =

λ− p1 −p2 −p3 . . . −pn−1 −pn

1 λ 0 . . . 0 0λ 1 0 . . . 0 0...

......

. . ....

...0 0 0 . . . 1 λ

λn−1

λn−2

...λ1

=

000...0

.

Since F [A] = V −11 V −12 · · ·V −1n−2V−1n−1AVn−1Vn−2 · · ·V2V1 and F [A]v = λv, we conclude that

λw = Vn−2 · · ·V2 V1(λv) = (Vn−2 · · ·V2 V1) F [A]v = A (Vn−1Vn−2 · · ·V2 V1v) = Aw

Note. For expanding characteristic polynomials of matrices of order higher than fifth, the methodof Danilevsky requires less multiplications and additions than other methods.

Example. Reduce the matrix

A =

1 1 3 42 0 2 11 0 1 20 0 −1 −1

to its Frobenius form.

The matrix B = A3 = U3AV3 is as follows:

B =

1 0 0 00 1 0 00 0 −1 −10 0 0 1

1 1 3 42 0 2 11 0 1 20 0 −1 −1

1 0 0 00 1 0 00 0 −1 −10 0 0 1

=

1 1 −3 12 0 −2 −1−1 0 0 −10 0 1 0

.

Since b32 = 0, we need the permutation matrix J =

0 1 0 01 0 0 00 0 1 00 0 0 1

; thus

C = J B J =

0 1 0 01 0 0 00 0 1 00 0 0 1

1 1 −3 12 0 −2 −11 0 −1 10 0 1 0

0 1 0 01 0 0 00 0 1 00 0 0 1

=

0 2 −2 −11 1 −3 10 −1 0 −10 0 1 0

.

Page 11: CharacteristicPolynomial - California State University ...malek/Class/Characteristic.pdfCharacteristicPolynomial ... be the characteristic polynomial of the matrix A, ... Find the

The Method of Danilevsky Characteristic Polynomial 11

Next we obtain the matrix D = A2 = U2C V2

D =

1 0 0 00 −1 0 −10 0 1 00 0 0 1

0 2 −2 −11 1 −3 10 −1 0 −10 0 1 0

1 0 0 00 −1 0 −10 0 1 00 0 0 1

=

0 −2 −2 −3−1 1 2 00 1 0 00 0 1 0

.

Finally the Frobenius form F [A] = A1 = U1DV1,

F [A] =

−1 1 2 00 1 0 00 0 1 00 0 0 1

0 −2 −2 −3−1 1 2 00 1 0 00 0 1 0

−1 1 2 00 1 0 00 0 1 00 0 0 1

=

1 4 2 31 0 0 00 1 0 00 0 1 0

.

Thus the Characteristic polynomial of A is KA(λ) = x4 − x3 − 4x2 − 2x− 3

Using MATLAB for the Danilevsky Method

Consider the matrix A:

>> A = [ 1 2 4 3 ; 2 4 5 1 ; 3 2 1 4 ; 5 1 2 3 ] , M = A ; I = eye(4);

A =

1 2 4 32 4 5 13 2 1 45 1 2 3

Use the fourth row of A to define U and its inverse V:

>> U = I ; U (3, :) = A (4, :) , V = I ; V (3, :) = −A (4, :) /A (4, 3) ; V (3, 3) = 1/A (4, 3)

U =

1 0 0 00 1 0 05 1 2 30 0 0 1

V =

1.0000 0.0000 0.0000 0.00000.0000 1.0000 0.0000 0.0000−2.5000 −0.5000 0.5000 −1.50000.0000 0.0000 0.0000 1.0000

Define the matrix B similar to A which has the same characteristic polynomial.

>> B = U ∗ A ∗ V

B =

−9.0000 0.0000 2.0000 −3.0000−10.5000 1.5000 2.5000 −6.5000−54.5000 4.5000 16.5000 −16.5000

0.0000 0.0000 1.0000 0.0000

Change B into A and find a new U and its inverse V, by using the third row of the new A:

>> A = B ; U = I ; U (2, :) = A (3, :) , V = I ; V (2, :) = −A (3, :) /A (3, 2) ;V (2, 2) = 1/A (3, 2)

U =

1.0000 0.0000 0.0000 0.0000−54.5000 4.5000 16.5000 −16.5000

0.0000 0.0000 1.0000 0.00000.0000 0.0000 0.0000 1.0000

V =

1.0000 0.0000 0.0000 0.000012.1111 0.2222 −3.6667 3.66670.0000 0.0000 1.0000 0.00000.0000 0.0000 0.0000 1.0000

Define the matrix B similar to A which has the same characteristic polynomial.

Page 12: CharacteristicPolynomial - California State University ...malek/Class/Characteristic.pdfCharacteristicPolynomial ... be the characteristic polynomial of the matrix A, ... Find the

The Method of Danilevsky Characteristic Polynomial 12

>> B = U ∗ A ∗ V

B =

−9 0 2 −3525 18 −139 1590 1 0 00 0 1 0

Change B into A and find a new U and its inverse V, using the second row of the new A:

>> A = B ; U = I ; U (1, :) = A (2, :) , V (1, :) = −A (2, :) /A (2, 1) ;V (1, 1) = 1/A(2, 1)

U =

−10.5000 1.5000 2.5000 −6.5000

0.0000 1.0000 0.0000 0.00000.0000 0.0000 1.0000 0.00000.0000 0.0000 0.0000 1.0000

V =

0.0019 −0.0343 0.2648 −0.30290.0000 1.0000 0.0000 0.00000.0000 0.0000 1.0000 0.00000.0000 0.0000 0.0000 1.0000

>> B = U ∗ A ∗ V

B =

9 23 −42 −1441 0 0 00 1 0 00 0 1 0

B is the companion matrix of our original matrix A. Here is the characteristic polynomial of A:

1.0000 − 9.0000 − 23.0000 42.0000 144.0000

Exceptional Case.

>> A = [ 1 2 4 3 ; 2 4 5 1 ; 3 2 1 4 ; 5 1 0 3 ]

A =

1 2 4 32 4 5 13 2 1 45 1 0 3

Since A (4, 3) = 0 , we need a permutation matrix P which moves A (4, 3) = 0 into another position:

>> P = I ; Q = P P (4, :) = P (3, :) P (3, :) = Q (4, :)

P =

1 0 0 00 1 0 00 0 0 10 0 1 0

Define the matrix B similar to A which has the same characteristic polynomial, but B (4, 3) 6= 0.

Note that every time there is a zero in A (k, k+ 1) entry, use a permutation matrix, to obtain a newmatrix similar the matrix A, but with a non-zero value at that position.

>> B = P ∗ A ∗ P ′

B =

1 2 3 42 4 1 55 1 3 03 2 4 1

We set A to B and continue the same way as the previous example.

Page 13: CharacteristicPolynomial - California State University ...malek/Class/Characteristic.pdfCharacteristicPolynomial ... be the characteristic polynomial of the matrix A, ... Find the

The Method of Danilevsky Characteristic Polynomial 13

>> U = I ; U (3, :) = A (4, :) , V = I ; V (3, :) = −A (4, :) /A (4, 3) ; V (3, 3) = 1/A (4, 3)

U =

1 0 0 00 1 0 03 2 4 10 0 0 1

V =

1.0000 0.0000 0.0000 0.00000.0000 1.0000 0.0000 0.0000−0.7500 −0.5000 0.2500 −0.25001.0000 0.0000 0.0000 1.0000

Define the matrix B similar to A which has the same characteristic polynomial.

>> B = U ∗ A ∗ V

B =

−1.2500 0.5000 0.7500 3.25001.2500 3.5000 0.2500 4.75009.7500 6.5000 6.7500 16.25000.0000 0.0000 1.0000 0.0000

Change B into A and find a new U and its inverse V, using the second row of the new A:

>> A = B ; U = I ; U (2, :) = A (3, :) , V = I ; V (2, :) = −A (3, :) /A (3, 2) ; V (2, 2) = 1/A (3, 2)

U =

1.0000 0.0000 0.0000 0.0000−45.5000 11.0000 −3.5000 −6.5000

0.0000 0.0000 1.0000 0.00000.0000 0.0000 0.0000 1.0000

V =

1.0000 0.0000 0.0000 0.00004.1364 0.0909 0.3182 0.59090.0000 0.0000 1.0000 0.00000.0000 0.0000 0.0000 1.0000

Define the matrix B similar to A which has the same characteristic polynomial.

>> B = U ∗ A ∗ V

B =

−1.6818 0.0070 0.2552 2.045557.0227 −3.2797 −53.4598 −133.56820.0000 1.0000 0 0

0 0 1.0000 0

Note that A (2, 1) 6= 0, so we don’t need any permutation matrix.

Change B into A and find a new U and its inverse V, using the second row of the new A:

>> A = B ; U = I ; U (1, :) = A (2, :) , V = I ; V (1, :) = −A (2, :) /A (2, 1) ; V (1, 1) = 1/A (2, 1)

U =

57.0227 −3.2797 −53.4598 −133.56820.0000 1.0000 0.0000 0.00000.0000 0.0000 1.0000 0.00000.0000 0.0000 0.0000 1.0000

V =

0.0175 0.0575 0.9375 2.34240.0000 1.0000 0.0000 0.00000.0000 0.0000 1.0000 0.00000.0000 0.0000 0.0000 1.0000

Define the matrix B similar to A which has the same characteristic polynomial.

>> B = U ∗ A ∗ V

B =

−4.9615 −58.5769 −208.9231 −108.00001.0000 0.0000 0.0000 0.00000.0000 1.0000 0.0000 0.00000.0000 0.0000 1.0000 0.0000

B is the companion matrix of our original matrix A. Here is the characteristic polynomial of A:

1.0000 4.9615 58.5769 208.9231 108.0000

Page 14: CharacteristicPolynomial - California State University ...malek/Class/Characteristic.pdfCharacteristicPolynomial ... be the characteristic polynomial of the matrix A, ... Find the

The Method of Danilevsky Characteristic Polynomial 14

Matlab Program

A = input(′Enter the square matrix A : ′);

m = size(A); N = m(1); b = [1]; B = zeros(N); i = 1;

while i < N,

J = eye(N);h = A(N − i+ 1, N − i)while h == 0;

c = A(N − i+ 1, 1 : N − i); z = norm(c, inf);

if z = 0;

k = 1; r = 0;

while r == 0 & k < N − i;r = r + c(N − i− k); k = k + 1;

J(N − i,N − i) = 0; J(N − i,N − i− k + 1) = 1;

J(N − i− k + 1, N − i− k + 1) = 0; J(N − i− k + 1, N − i) = 1,

A = J ∗A ∗ J ; k = k + 1;

endelse

b = conv(b, [1−A(N − i+ 1, N − i+ 1 : N)]);

B = A(1 : N − i, 1 : N − i);A = B,N = N − i;end

h = A(N − i+ 1, N − i);end

U = eye(N); V = eye(N);

U(N − i, :) = A(N − i+ 1, :);

V (N − i, :) = −A(N − i+ 1, :)/A(N − i+ 1, N − i); V (N − i,N − i) = 1/A(N − i+ 1, N − i);A = U ∗A ∗ V ;

i = i+ 1;

end;

b = conv(b, [1−A(N − i+ 1, N − i+ 1 : N)]); disp(′ ′),

disp(′The Characteristic polynomial looks like : ′), disp(′ ′),

disp([′KA(x) = x ∧ n+ c(1)x ∧ (n− 1),+...+ c(n− 1)x+ c(n)′]), disp(′ ′),

disp(′The coefficients list c(k) is : ′), disp(′ ′),

disp(b), disp(′ ′)

Page 15: CharacteristicPolynomial - California State University ...malek/Class/Characteristic.pdfCharacteristicPolynomial ... be the characteristic polynomial of the matrix A, ... Find the

The Method of Krylov Characteristic Polynomial 15

♣ The Method of Krylov. Let A be an n× n matrix. For any n-dimensional nonzero columnvector v we associate its successive transforms

vk = Akv (k = 0, 1, 2, . . .);

this sequence of vectors is called the Krylov sequence associated to the matrix A and the vector v.

At most n vectors of the sequence v0, v1, v2, . . . will be linearly independent.

Suppose for some r = r(v) ≤ n, the vectors v0 , v1 , v2 , . . . , vr are linearly independent and thevector vr+1 is a linear combination of the preceding ones. Hence there exists a monic polynomial

φ(λ) = c0 + c1λ+ c2λ2 + · · ·+ cr−1λ

r−1 + λr

such that

φ(A) v = (c0 In + c1A+ · · ·+ cr−1Ar−1 +Ar) v = c0 v0 + c1 v1 + · · ·+ cr−1 vr + cr vr+1 = θ .

The polynomial φ(λ) is said to annihilate v and to be minimal for v. If ω (λ) is another monicpolynomial which annihilates v,

ω(A) v = θ ,

then φ (λ) divides ω (λ).

To show that; supposeω (λ) = γ (λ)φ (λ) + ρ (λ),

where ρ (λ) is the remainder after dividing ω by φ, hence of degree strictly less than ρ, it followsthat

ρ(A) v = θ .

But φ (λ) is minimal for v, hence ρ (λ) = 0.

Now of all vectors v there is at least one vector for which the degree v is maximal, since for anyvector v, r(v) ≤ n. We call such vector a maximal vector.

Remark. A monic polynomial µA (λ) of an n× n matrix A is said to be its minimal polynomial, ifµA (λ) is of minimum degree satisfying

µ (A) = Zn.

If the minimal polynomial of a matrix is equal to its characteristic polynomial, then we may useKrylov method to find the characteristic polynomial. For example, if the matrix has n distincteigenvalues, then its minimal polynomial is equal to its characteristic polynomial. Hence the Krylovmethod would be successful.

Algorithm. To produce the characteristic polynomial of the matrix A by Krylov method, wefollow the following steps:

Step 1. Choose an arbitrary n-dimensional nonzero column vector v such as e1, then use the Krylovsequence to define the matrix

V =[v , A v , A2 v , . . . , An−2 v , An−1 v

]= [ v0 , v1 , v − 2 , . . . vn−2 , vn−1] .

Step 2. If the matrix V has rank n, then the system V c = −vn has a unique solution

ct = (c0 , c1 , c2 , · · · , cn−1).

The monic polynomial

φ(λ) = c0 + c1 λ+ c2 λ2 + · · ·+ cn−1 λ

n−1 + λn

which annihilates the vector v is the characteristic polynomial of A.

Step 3. If the system V c = −vn does not have a unique solution, then change the initial vector

Page 16: CharacteristicPolynomial - California State University ...malek/Class/Characteristic.pdfCharacteristicPolynomial ... be the characteristic polynomial of the matrix A, ... Find the

The Method of Krylov Characteristic Polynomial 16

and try for example with e2.

Step 4. If again, the system V c = −vn does not have a unique solution, then either chooseanother initial vector v or suspect that the minimal polynomial and characteristic polynomial of Aare different, in this case abandon this method and use another method.

Examples. Compute the characteristic polynomials of the following matrices:

A =

1 2 1 −11 0 2 12 1 −1 34 −5 0 4

, B =

1 2 −3 11 0 −2 11 −3 −1 31 0 1 −2

, and C =

1 2 3 41 2 3 41 0 0 01 0 0 0

.

Choosing the initial vector v =

1000

for the matrices A and B, we obtain

VA =[v , A v , A2 v , A3 v

]=

1 1 1 170 1 9 420 2 13 430 4 15 19

and VB =[v , B v , B2 v , B3 v

]=

1 1 1 10 1 0 10 1 0 10 1 0 1

.

The matrix VA is nonsingular, hence cA = −V −1A A4v =

−87282−4

. From the vector cA we obtain the

characteristic polynomial of A which is

KA (λ) =(1 , λ , λ2 , λ4

−87282−4

+ λ4 = −87 + 28λ+ 2λ2 − 4λ3 + λ4.

The matrix VB is singular, so we need another initial vector such as v =

0100

. The new matrix

VB =

0 2 11 111 0 8 00 −3 5 −210 0 −1 18

is invertible, so cB = −V −1B B4 v =

9−2−10

2

. From the vector cB we

obtain the characteristic polynomial of B which is

KB(λ) =(1 , λ , λ2 , λ4

9−2−10

2

+ λ4 = 9− 2λ− 10λ2 + 2λ3 + λ4.

The minimal and characteristic polynomials of the matrix C are

mC (λ) = λ3 − 3λ2 − 7λ and KC (λ) = λ4 − 3λ3 − 7λ2,

respectively. Therefore by choosing any initial vector v, the matrix VC =[v , C v , C2 v , C3 v

]will always be singular. This means that the Krylov sequence will never produce the characteristicpolynomial KC (λ).

Page 17: CharacteristicPolynomial - California State University ...malek/Class/Characteristic.pdfCharacteristicPolynomial ... be the characteristic polynomial of the matrix A, ... Find the

The Method of Krylov Characteristic Polynomial 17

Matlab Program

A = input(′Enter a square matrix A : ′);

m = size(A); n = m(1); V = zeros(n, n);

DL1 = [′Enter an initial ′, int2str(n) , ′ − dimensional row vector v0 = ′];

v0 = input(DL1);

z = 0; k = 1;

while z == 0 & k < 5

w = v0; V (:, 1) = w;

for i = 2 : n, w = A ∗ w; V (:, i) = w; end,

if det(V ) ∼= 0; k = 8; c = −inv(V ) ∗A ∗ w;

else

while k < 5

v0 = input(′The matrix V is singular, please enter another initial row vector v0 : ′);

k = k + 1;

end;

end;

z = det(V );

end;

if k == 5;

disp(′Sorry, the Krylov method is not suited for this matrix. ′), disp(′ ′),

else;

disp(′The Characteristic polynomial looks like : ′), disp(′ ′),

disp([′KA(x) = c(0) + C(1)x+ c(2)x ∧ 2 + · · ·+ c(n− 1)x ∧ (n− 1) + x ∧ n′]), disp(′ ′),disp(′The coefficients list c(k) is : ′), disp(′ ′),

disp([c′, 1])

end;