# Characteristic polynomial

This online calculator calculates coefficients of characteristic polynomial of a square matrix using Faddeev–LeVerrier algorithm

In linear algebra, the characteristic polynomial of a *n×n* square matrix *A* is a polynomial which is invariant under matrix similarity and has the eigenvalues as roots. The polynomial *pA(λ)* is monic (its leading coefficient is 1) and its degree is *n*. The calculator below computes coefficients of a characteristic polynomial of a square matrix using Faddeev–LeVerrier algorithm. Some theory and formulas can be found below the calculator.

### Characteristic polynomial

Given a square matrix A, we want to find a polynomial whose zeros are the eigenvalues of A. For a diagonal matrix A, the characteristic polynomial is easy to define: if the diagonal entries are a1, a2, a3, etc. then the characteristic polynomial will be:

This works because the diagonal entries are also the eigenvalues of this matrix.

For a general matrix A, one can proceed as follows. A scalar λ is an eigenvalue of A if and only if there is an eigenvector v ≠ 0 such that

or

(where I is the identity matrix).

Since v is non-zero, this means that the matrix λ I − A is singular (non-invertible), which in turn means that its determinant is 0. Thus the roots of the function det(λ I − A) are the eigenvalues of A, and it is clear that this determinant is a polynomial in λ.^{1}

In matrix form polynomial in λ looks like this:

In scalar form

where, c_{n} = 1 and c_{0} = (−1)^{n} det A.

The coefficients can be found using recursive Faddeev–LeVerrier algorithm (first published in 1840 by Urbain Le Verrier, in present form redeveloped by Dmitry Konstantinovich Faddeev and others).

### Faddeev–LeVerrier algorithm

The coefficients of the characteristic polynomial are determined recursively from the top down, by dint of the auxiliary matrices M^{2},

Thus,

etc.,

The calculator uses this algorithm to compute the coefficients. It can also output auxiliary matrix M for each step.

## Comments