2
$\begingroup$

For a matrix $A\in\mathbb{K}^{n\times n}$ where $\mathbb{K}\in\{\mathbb{R},\mathbb{C}\}$ the characteristic polynomial is defined as

$\chi_A(\lambda) := \text{det}(A-\lambda I_n) = \sum_{k=0}^n c_k \lambda^k$

with the recursive definition of the coefficients

$c_n = (-1)^n,\;\;\;\;c_{n-1}=(-1)^{n-1}\text{tr}A,\;\;\;\;c_0 = \text{det}A$

and the trace of the matrix $A$

$\text{tr}A := \sum_{k=1}^n a_{kk}$

But when i try to compute the polynomial my "hand-computed" solution is not the same as the one Mathematica provides.

$A:=\begin{bmatrix}a&0&0\\0&b&0\\0&0&c\end{bmatrix}$

leads for me to the polynomial

$\chi_A^{Hand}(\lambda) = -\lambda^3+\lambda^2 (a+b+c)-\lambda (a+b+c) +abc$

but calling

CharacteristicPolynomial[{{a, 0, 0}, {0, b, 0}, {0, 0, c}}, \[Lambda]] 

in Mathematica leads to the result

$\chi_A^{Mathematica}(\lambda)=a b c-a b \lambda -a c \lambda -b c \lambda +a \lambda ^2+b \lambda ^2+c \lambda ^2-\lambda ^3$

Can anyone explain me, what i am doing wrong?

  • 2
    The answer is that you do not develop correctly the polynomial $(a-\lambda)(b-\lambda)(c-\lambda)$. The correct expression is the one given by Mathematica.2011-07-16

2 Answers 2

1

Mathematica agrees with your answer. The degree is $n=3$. Your formulas say $c_3=(-1)^3=-1$, and $c_2 = (-1)^2 tr(A) = a+b+c$ and $c_0 = det(A) = a b c$, but the $c_1$ is not determined by your statement, so there is no contradiction. You wrongly concluded that $c_1 = -c_2$.

  • 0
    "it is not practical for inexact matrices because of numerical instabilities" - the usual example (due to Jim Wilkinson) is the diagonal matrix with diagonal elements $1,2,\dots,20$; the eigenvalues are easy to compute, but woe betide thee who expands it to its eigenpolynomial...2011-07-16
1

Your "recursive" definition isn't really recursive. It only describes three of the coefficients. You get the same value for those as Mathematica does. The coefficient of $\lambda^1 = \lambda^{n-2}$ isn't described by your formulas, and I don't understand how you computed it.

  • 0
    @Christian: my pleasure - gern geschehen. Yuval: sorry about the pings.2011-07-16