Matrix Calc. › Eigenvalue calculator

Eigenvalue calculator with the characteristic polynomial

The eigenvalues of a square matrix, and the polynomial whose roots they are — written out for a 2×2 or 3×3, solved numerically beyond that.

What an eigenvalue is

An eigenvector is a direction a matrix does not turn. Multiply the matrix by a vector in that direction and you get a scaled copy of the same vector — no rotation, only a stretch or a flip. The scale factor is the eigenvalue:

A v = λ v

A 2×2 rotation by 30° has no real eigenvector at all: it turns every direction, so its eigenvalues are a complex conjugate pair. That is why the eigen-directions describe a transformation better than its entries do — they are the directions the matrix leaves alone.

The characteristic polynomial

Rewrite the equation as (A − λI) v = 0. A non-zero v can only satisfy that when the matrix A − λI is singular, which is to say when its determinant is zero:

det(A − λI) = 0

Expanding that determinant gives a polynomial in λ of degree n — the characteristic polynomial — and its roots are the eigenvalues. For a 2×2 it is always

λ² − (trace A)·λ + det A = 0

Two facts fall out of that and are worth remembering as checks: the eigenvalues sum to the trace, and their product is the determinant. If your answers do not satisfy both, one of them is wrong.

Worked example: a 2×2

A = ⎡ 4  1 ⎤
    ⎣ 2  3 ⎦

trace = 4 + 3 = 7
det   = 4·3 − 1·2 = 10

λ² − 7λ + 10 = 0
(λ − 5)(λ − 2) = 0

λ₁ = 5,  λ₂ = 2

Check against the invariants: 5 + 2 = 7 (the trace) and 5·2 = 10 (the determinant). Both hold, so the roots are right.

Now the eigenvector for λ = 5. Substitute it into (A − λI) v = 0:

A − 5I = ⎡ −1  1 ⎤
         ⎣  2 −2 ⎦

−x + y = 0  →  y = x
v = (1, 1)

check:
A·(1, 1) = (4 + 1, 2 + 3)
         = (5, 5) = 5·(1, 1)

For λ = 2 the same substitution gives 2x + y = 0, so v = (1, −2), and A·(1, −2) = (2, −4) = 2·(1, −2).

A 3×3, where the polynomial starts to work

A = ⎡ 2  0  0 ⎤
    ⎢ 0  3  1 ⎥
    ⎣ 0  1  3 ⎦

A − λI is block triangular, so
det(A − λI)
  = (2 − λ)·[(3 − λ)² − 1]
  = (2 − λ)·(λ² − 6λ + 8)
  = (2 − λ)(λ − 2)(λ − 4)

λ = 2 (twice), λ = 4

Trace 8 and determinant 16: 2 + 2 + 4 = 8 and 2·2·4 = 16. A repeated eigenvalue means the matrix has fewer independent eigen-directions than its size, which is exactly when a matrix cannot be diagonalised.

How the calculator gets there

For small matrices it forms the characteristic polynomial and writes it out, so you can see where the roots come from. Beyond that, expanding a degree-n determinant symbolically is not worth it, so it runs the QR algorithm with Wilkinson shifts: each sweep performs a similarity transform that leaves the eigenvalues unchanged while pushing the subdiagonal towards zero, and the diagonal converges to the eigenvalues. It reports real roots only — a complex conjugate pair comes back as a message, not as two made-up approximations.

Questions

Does it show the characteristic polynomial?

Yes, for 2×2 and 3×3 matrices, where the expansion is short enough to be useful. Larger matrices are solved numerically.

Why does it refuse a matrix with complex eigenvalues?

Because a rotation's eigenvalues are genuinely complex and there is no honest real answer to give. Reporting two approximations would look like an answer and be wrong.

What does a repeated eigenvalue mean?

That two eigenvalues coincide. The matrix may then have only one independent eigenvector for that value, which is why not every matrix can be diagonalised.

Does it need a square matrix?

Yes. Eigenvalues are defined only for square matrices — a rectangular one has singular values instead.

How do I check the answer?

Add the eigenvalues and compare with the trace; multiply them and compare with the determinant. Both must match.

Find them now.

Free, offline, and the working is on the page.