# What is the characteristic polynomial?

Finds the characteristic polynomial det(λI − A) of a square matrix in exact fractions, factored over the rationals.

- Page: https://www.acalculator.org/math/characteristic-polynomial-calculator
- JSON spec: https://www.acalculator.org/math/characteristic-polynomial-calculator.json
- Version: ce3876ffeb0c

## Default answer

Example with the default inputs (Matrix A [-5, 2; -7, 4]): The characteristic polynomial is λ² + λ − 6.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| a | Matrix A | A square matrix, 1 to 6 rows; cells may be fractions such as 1/3. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| poly | p(λ) = det(λI − A) | The characteristic polynomial, exact. |
| factored | Factored | p(λ) with each rational root as a factor (λ − r). |
| signed | det(A − λI) | The same polynomial times (−1)ⁿ. |

## Method

The Faddeev-LeVerrier recurrence in exact fractions; rational roots found numerically and confirmed by exact division.

## Assumptions

- Cells are exact: 0.1 is 1/10, 1/3 is 1/3.
- A factor with no rational root stays whole.

## Worked examples

1. a = -5 or 2 or -7 or 4 gives poly = λ² + λ − 6, factored = (λ + 3)(λ − 2). Source: Kuttler, A First Course in Linear Algebra, 7.1, Example 7.1.2. https://math.libretexts.org/Bookshelves/Linear_Algebra/A_First_Course_in_Linear_Algebra_(Kuttler)/07%3A_Spectral_Theory/7.01%3A_Eigenvalues_and_Eigenvectors_of_a_Matrix.
2. a = 5 or -10 or 2 or 14 gives poly = λ³ − 25λ² + 200λ − 500, factored = (λ − 5)(λ − 10)².

## FAQ

### What is the characteristic polynomial?

For an n × n matrix A, the characteristic polynomial is p(λ) = det(λI − A), a polynomial of degree n in λ with leading coefficient 1. Its roots are the eigenvalues of A: λ is an eigenvalue exactly when λI − A is singular, so its determinant is 0.

### det(λI − A) or det(A − λI)?

Both are used. det(A − λI) = (−1)ⁿ det(λI − A), so the two are the same polynomial for an even n and differ in sign for an odd n. Their roots, the eigenvalues, are the same. The page shows both.

### What do the coefficients tell me?

In p(λ) = λⁿ + cₙ₋₁λⁿ⁻¹ + … + c₀, the coefficient cₙ₋₁ is −trace(A) (minus the sum of the diagonal) and c₀ is (−1)ⁿ det(A). For the 2 × 2 matrix [a, b; c, d], p(λ) = λ² − (a + d)λ + (ad − bc).

### How is the polynomial factored?

Every root that is a fraction (a rational number) and that the method in How it works finds becomes a factor (λ − r), with its multiplicity as a power: (λ − 5)(λ − 10)². It finds them all except, rarely, a fraction root with a large denominator (over about 10⁷) that is not a diagonal entry, or two fraction roots with large denominators closer together than about 10⁻⁷. What is left stays as one factor, such as λ² − 5λ − 2 for [1, 2; 3, 4], whose roots (5 ± √33)/2 are irrational.

### Why exact fractions?

The page never rounds: each cell is read as an exact fraction (0.8 is 4/5, 1/3 is 1/3) and every step is exact, so a coefficient such as −3/2 is exactly −3/2. A calculator working in decimals would show −1.5 or −1.4999999.

### How is this different from the eigenvector calculator?

This page gives the polynomial itself, exactly, with its factors over the rationals. The eigenvector calculator gives each eigenvalue and a unit eigenvector as decimals, including complex ones; the matrix diagonalization calculator gives A = P D P⁻¹ in fractions.

## Sources

- Ken Kuttler, A First Course in Linear Algebra, section 7.1 Eigenvalues and Eigenvectors of a Matrix (LibreTexts, CC BY): https://math.libretexts.org/Bookshelves/Linear_Algebra/A_First_Course_in_Linear_Algebra_(Kuttler)/07%3A_Spectral_Theory/7.01%3A_Eigenvalues_and_Eigenvectors_of_a_Matrix
