Skip to content
FiftyCalc Free calculators for all 50 states

Diagonalize Matrix Calculator

Test cases replayed : 5 of 5 match · Methodology · No outside source listed

Enter a 2×2 matrix to get its eigenvalues (the diagonal of D) and eigenvectors (the columns of P), so that A = PDP⁻¹.

Result

Sample figures

Eigenvalue λ₁ (D row 1)—

Trace a + d —

  • Determinant ad − bc—
  • Eigenvalue λ₂ (D row 2)—
  • Eigenvector v₁ (P column 1): x—
  • Eigenvector v₁ (P column 1): y—
  • Eigenvector v₂ (P column 2): x—
  • Eigenvector v₂ (P column 2): y—
  • Diagonalizable over the real numbers?—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

Diagonalize Matrix Calculator

Row 1, column 1: enter a number. Prefilled example: 4.

Row 1, column 2: enter a number. Prefilled example: 1.

Row 2, column 1: enter a number. Prefilled example: 2.

Row 2, column 2: enter a number. Prefilled example: 3.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. Row 1, column 1: enter a number.
  2. Row 1, column 2: enter a number.
  3. Row 2, column 1: enter a number.
  4. Row 2, column 2: enter a number.
  5. Read the result: Eigenvalue λ₁ (D row 1); the panel also shows Trace a + d, Determinant ad − bc, Eigenvalue λ₂ (D row 2), Eigenvector v₁ (P column 1): x, Eigenvector v₁ (P column 1): y, Eigenvector v₂ (P column 2): x, Eigenvector v₂ (P column 2): y and Diagonalizable over the real numbers?.

How this calculator works

The eigenvalues solve the characteristic equation λ² − (a + d)λ + (ad − bc) = 0: λ = (tr ± √(tr² − 4 det)) ÷ 2.

For each λ, an eigenvector solves (A − λI)v = 0; when b ≠ 0, v = (b, λ − a) works. Putting the eigenvectors as the columns of P and the eigenvalues on the diagonal of D gives A = PDP⁻¹.

A 2×2 matrix is diagonalizable over the reals when its two eigenvalues are real and distinct, or when it is already diagonal. A repeated eigenvalue on a non-diagonal matrix (such as [[1, 1], [0, 1]]) gives only one eigenvector direction, so P is not invertible.

The formula

  1. Tr=a+d
  2. Det=a×d−b×c
  3. L1=Tr+Tr2−4×Det2
Symbols used in the formula
SymbolMeaning
aRow 1, column 1
bRow 1, column 2
cRow 2, column 1
dRow 2, column 2
TrTrace a + d
DetDeterminant ad − bc
L1Eigenvalue λ₁ (D row 1)

Worked example

Row 1, column 14
Row 1, column 21
Row 2, column 12
Row 2, column 23
Trace a + d7
Determinant ad − bc10
Eigenvalue λ₂ (D row 2)2
Eigenvector v₁ (P column 1): x1
Eigenvector v₁ (P column 1): y1
Eigenvector v₂ (P column 2): x1
Eigenvector v₂ (P column 2): y-2
Diagonalizable over the real numbers?Yes: two distinct real eigenvalues
  1. Tr=4+3=7
  2. Det=4×3−1×2=10
  3. L1=7+72−4×102=5

Eigenvalue λ₁ (D row 1) 5

Each step uses the unrounded value of the step before it; figures on this page are rounded for display.

Frequently asked questions

What does it mean to diagonalize a matrix?

To write it as A = PDP⁻¹ with D diagonal. Powers then become easy: Aⁿ = PDⁿP⁻¹.

Is every matrix diagonalizable?

No. [[1, 1], [0, 1]] has the repeated eigenvalue 1 but only one eigenvector direction, so it cannot be diagonalized.

Are eigenvectors unique?

Only up to a nonzero multiple: any multiple of an eigenvector is also an eigenvector for the same eigenvalue.

Related calculators