Diagonalize Matrix Calculator

Diagonalize Matrix Calculator

Diagonalize a 2×2 real matrix using eigenvalues and eigenvectors. Find the matrices P, D, and P⁻¹ when diagonalization is possible.

Real 2×2 matrices only | Eigenvalue/eigenvector method

Enter Matrix A
Diagonalization results will appear here...

Common 2×2 Matrix Examples

MatrixNotes
[[4, 1], [0, 2]]Distinct real eigenvalues, so diagonalizable
[[5, 2], [0, 1]]Upper triangular matrix with easy eigenvalues
[[3, 0], [0, 3]]Already diagonal
[[2, 1], [0, 2]]Repeated eigenvalue, not diagonalizable

What Does It Mean to Diagonalize a Matrix?

Diagonalizing a matrix means rewriting it in the form A = P D P⁻¹, where D is a diagonal matrix and P is made from eigenvectors of the original matrix.

This is useful because diagonal matrices are much easier to work with. Powers of matrices, differential equations, dynamical systems, and many linear algebra problems become simpler after diagonalization.

A matrix can be diagonalized when it has enough linearly independent eigenvectors. For real 2×2 matrices, distinct real eigenvalues guarantee diagonalizability.

How to Diagonalize a Matrix

Step 1: Find the Eigenvalues

Solve the characteristic equation det(A − λI) = 0. For a 2×2 matrix, this gives a quadratic equation in λ.

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

Step 2: Find an Eigenvector for Each Eigenvalue

For each eigenvalue λ, solve (A − λI)v = 0. Each nonzero solution gives an eigenvector.

Step 3: Form the Matrix P

Put the eigenvectors as columns in the matrix P.

Step 4: Form the Diagonal Matrix D

Place the corresponding eigenvalues on the diagonal of D in the same order as their eigenvectors appear in P.

Step 5: Verify A = P D P⁻¹

If P is invertible, then the matrix is diagonalized successfully.

How to Use the Diagonalize Matrix Calculator

  1. Enter the four entries of your 2×2 real matrix.
  2. Click Diagonalize Matrix to compute eigenvalues and eigenvectors.
  3. Read the matrices P, D, and P⁻¹ when the matrix is diagonalizable.
  4. If the calculator says the matrix is not diagonalizable, it will explain why.

Worked Example of Matrix Diagonalization

Example Matrix

Given:
A = [[4, 1], [0, 2]]
Eigenvalues:
λ₁ = 4, λ₂ = 2
Eigenvectors:
v₁ = [1, 0], v₂ = [-0.447214, 0.894427]
Result:
A = P D P⁻¹

Because the matrix has two distinct real eigenvalues, it is diagonalizable.

Frequently Asked Questions

What does diagonalizable mean?

A matrix is diagonalizable when it can be written as A = P D P⁻¹, where D is diagonal and P is invertible.

Does every matrix have eigenvalues?

Every square matrix has eigenvalues over the complex numbers, but not every real matrix has real eigenvalues.

Can a matrix fail to be diagonalizable?

Yes. A matrix may have repeated eigenvalues without having enough independent eigenvectors.

Why is diagonalization useful?

It makes matrix powers, linear systems, differential equations, and many theoretical calculations easier.

Does this calculator handle complex diagonalization?

No. This version is for real 2×2 matrices and reports when the eigenvalues are complex.

What happens if the matrix is already diagonal?

Then the calculator still works, and the diagonal matrix is simply D with a straightforward choice of P.

Related Tools