Characteristic polynomial of a matrix
MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
linalg::charpoly(A, x) computes the characteristic
polynomial of the matrix A.
The characteristic polynomial of a n×n matrix
is defined by
where In denotes
the n×n identity
The component ring of
A must be a commutative
ring, i.e., a domain of category
We define a matrix over the rational numbers:
A := Dom::Matrix(Dom::Rational)([[1, 2], [3, 4]])
Then the characteristic polynomial pA(x) is given by:
It is of the domain type:
We define a matrix over ℤ7:
B := Dom::Matrix(Dom::IntegerMod(7))([[1, 2], [3, 0]])
The characteristic polynomial pB(x) of
p := linalg::charpoly(B, x)
We compute the zeros of pB(x),
i.e., the eigenvalues of the matrix
Polynomial of the domain
R is the component ring of
linalg::charpoly implements Hessenberg's
algorithm to compute the characteristic polynomial of a square matrix A.
See: Henri Cohen: A Course in Computational Algebraic
Number Theory, GTM 138, Springer Verlag.
This algorithm works for any field and requires only O(n3) field operations, in contrast to O(n4) when computing the determinant of the characteristic matrix of A.
For any other component ring, the characteristic polynomial is computed using the Berkowitz algorithm.
Reference: Jounaidi Abdeljaoued, The Berkowitz Algorithm, Maple and Computing the Characteristic Polynomial in an Arbitrary Commutative Ring, MapleTech Vol 4 No 3, pp 21-32, Birkhäuser, 1997.