EricDarve / numerical_linear_algebra

Julia code for the book Numerical Linear Algebra
114 stars 41 forks source link

Characteristic polynomial #243

Open EricDarve opened 2 years ago

EricDarve commented 2 years ago

Note to self:

page 39 definition of the Characteristic polynomial, you have

   p_A(x) = det(A - xI)

rather than

   p_A(x) = det(xI - A)

The difference of course being that your version has a minus sign on the 

leading term, x^n, in the case that the matrix has an odd number of rows.

Generally this is not an issue, since one is usually concerned with the 

equation p_A(x) = 0, but on page 49 you use your definition and 

incorrectly state:

   p_A(x) = det(A - xI)   and then

   p_A(x) = \prod_{i=1}^p (x - \lambda_i)^{a_i}

These two are not the same unless the dimension of A is even.