Characteristic polynomial
In linear algebra, the characteristic polynomial of a square matrix is a polynomial which is invariant under matrix similarity and has the eigenvalues as roots. It has the determinant and the trace of the matrix among its coefficients. The characteristic polynomial of an endomorphism of a finite-dimensional vector space is the characteristic polynomial of the matrix of that endomorphism over any base (that is, the characteristic polynomial does not depend on the choice of a basis). The characteristic equation, also known as the determinantal equation, is the equation obtained by equating the characteristic polynomial to zero. In  spectral graph theory, the characteristic polynomial of a graph is the characteristic polynomial of its adjacency matrix. Motivation. Given a square matrix formula_1 we want to find a polynomial whose zeros are the eigenvalues of formula_2 For a diagonal matrix formula_1 the characteristic polynomial can be defined by: if the diagonal entries are formula_4 etc. then the characteristic polynomial will be: formula_5 This works because the diagonal entries are also the eigenvalues of this matrix. For a general matrix formula_1 one can proceed as follows. A scalar formula_7 is an eigenvalue of formula_8 if and only if there is a  nonzero vector formula_9 called an eigenvector, such that formula_10 or, equivalently, formula_11 where formula_12 is the identity matrix. Since formula_13 must be nonzero, this means that the matrix formula_14 has a nonzero kernel. Thus this matrix is not invertible, and its determinant must therefore be zero. Thus the eigenvalues of formula_8 are the roots of formula_16 which is a polynomial in formula_17 Formal definition. Consider an formula_18 matrix formula_2 The characteristic polynomial of formula_1 denoted by formula_21 is the polynomial defined by formula_22 where formula_12 denotes the formula_18 identity matrix. Some authors define the characteristic polynomial to be formula_25 That  polynomial differs from the one defined here by a sign formula_26 so it makes no difference for properties like having as roots the eigenvalues of formula_8; however the definition above always gives a monic polynomial, whereas the alternative definition is monic only when formula_28 is even. Examples. To compute the characteristic polynomial of the matrix formula_29 the determinant of the following is computed: formula_30 and found to be formula_31 the characteristic polynomial of formula_2 Another example uses hyperbolic functions of a hyperbolic angle φ. For the matrix take formula_33 Its characteristic polynomial is formula_34 Properties. The characteristic polynomial formula_35 of  a formula_18 matrix is monic (its leading coefficient is formula_37) and its degree is formula_38 The most important fact about the characteristic polynomial was already mentioned in the motivational paragraph: the eigenvalues of formula_8 are precisely the roots of formula_35 (this also holds for the minimal polynomial of formula_1 but its degree may be less than formula_28). All coefficients of the characteristic polynomial are polynomial expressions in the entries of the matrix. In particular its constant coefficient formula_43 is formula_44 the coefficient of formula_45 is one, and the coefficient of formula_46 is , where is the trace of formula_2 (The signs  given here correspond to the formal definition given in the previous section; for the alternative definition these would instead be formula_48 and respectively.) For a formula_49 matrix formula_1 the characteristic polynomial is thus given by formula_51 Using the language of exterior algebra, the characteristic polynomial of an formula_18 matrix formula_8 may be expressed as formula_54 where formula_55 is the trace of the formula_56th exterior power of formula_1 which has dimension formula_58 This trace may be computed as the sum of all Principal minors of formula_8 of size formula_60 The recursive Faddeev–LeVerrier algorithm computes these coefficients more efficiently. When the  characteristic of the field of the coefficients is formula_61 each such trace may alternatively be computed as a single determinant, that of the formula_62 matrix, formula_63 The Cayley–Hamilton theorem states that replacing formula_64 by formula_8 in the characteristic polynomial (interpreting the resulting powers as matrix powers, and the constant term formula_66 as formula_66 times the identity matrix) yields the zero matrix. Informally speaking, every matrix satisfies its own characteristic equation. This statement is equivalent to saying that the minimal polynomial of formula_8 divides the characteristic polynomial of formula_2 Two similar matrices have the same characteristic polynomial. The converse however  is not true in general: two matrices with the same characteristic polynomial need not be similar. The matrix formula_8 and its transpose have the same characteristic polynomial. formula_8 is similar to a triangular matrix if and only if its characteristic polynomial can be completely factored into linear factors over formula_72 (the same is true with the minimal polynomial instead of the characteristic polynomial). In this case formula_8 is similar to a matrix in Jordan normal form. Characteristic polynomial of a product of two matrices. If formula_8 and formula_75 are two square formula_18 matrices then characteristic polynomials of formula_77 and formula_78  coincide: formula_79 When formula_8 is non-singular this result follows from the fact that formula_77 and formula_78 are similar: formula_83 For the case where both formula_8 and formula_75 are singular, the desired identity is an equality between polynomials in formula_64 and the coefficients of the matrices. Thus, to prove this equality, it suffices to prove that it is verified on a non-empty open subset (for the usual topology, or, more generally, for the Zariski topology) of the space of all the coefficients. As the non-singular matrices form such an open subset of the space of all matrices, this  proves the result. More generally, if formula_8 is a matrix of order formula_88 and formula_75 is a matrix of order formula_90 then formula_77 is formula_92 and formula_78 is formula_18 matrix, and one has formula_95 To prove this, one may suppose formula_96 by exchanging, if needed, formula_8 and formula_98 Then, by bordering formula_8 on the bottom by formula_100 rows of zeros, and formula_75 on the right, by, formula_100 columns of zeros, one gets two formula_18 matrices formula_104 and formula_105 such that formula_106 and formula_107 is equal to formula_77 bordered by formula_100 rows and columns of zeros. The result follows from the  case of square matrices, by comparing the characteristic polynomials of formula_107 and formula_111 Characteristic polynomial of "A". If formula_7 is an eigenvalue of a square matrix formula_8 with eigenvector formula_9 then clearly formula_115 is an eigenvalue of formula_116 formula_117 The multiplicities can be shown to agree as well, and this generalizes to any polynomial in place of formula_118: That is, the algebraic multiplicity of formula_7 in formula_120 equals the sum of algebraic multiplicities of formula_121 in formula_8 over formula_121 such that formula_124 In particular, formula_125 and formula_126 Here a polynomial formula_127 for example, is evaluated on a matrix formula_8 simply  as formula_129 The theorem applies to matrices and polynomials over any field or commutative ring. However, the assumption that formula_35 has a factorization into linear factors is not always true, unless the matrix is over an algebraically closed field such as the complex numbers. Secular function and secular equation. Secular function. The term secular function has been used for what is now called "characteristic polynomial" (in some literature the term secular function is still used). The term comes from the fact that the characteristic polynomial was used to calculate secular perturbations (on a time scale of a century, that is , slow compared to annual motion) of planetary orbits, according to Lagrange's theory of oscillations. Secular equation. "Secular equation" may have several meanings. For general associative algebras. The above definition of the characteristic polynomial of a matrix formula_131 with entries in a field formula_132 generalizes without any changes to the case when formula_132 is just a commutative ring. defines the characteristic polynomial for elements of an arbitrary finite-dimensional (associative, but not necessarily commutative) algebra over a field formula_132 and proves the standard properties of the characteristic polynomial in this generality.