Diagonalize Matrix Calculator

Diagonalize a 2×2 or 3×3 matrix online. Find eigenvalues, eigenvectors, matrices P and D where A = PDP⁻¹, determinant, trace, and characteristic polynomial with step-by-step results.

Determinant
3.00
det(A)
Trace
4.00
Sum of diagonal elements
Characteristic Polynomial
λ² - 4.00λ + 3.00
det(A - λI) = 0
Diagonalizable?
Yes
A = PDP⁻¹ exists
Eigenvalue λ1
3.00
Root #1 of the characteristic polynomial
Eigenvalue λ2
1.00
Root #2 of the characteristic polynomial

Eigenvalue Magnitude Comparison

λ1
3.00
λ2
1.00

Step-by-Step Summary

StepDescriptionResult
1Compute trace (sum of diag)4.00
2Compute determinant3.00
3Form characteristic polynomialλ² - 4.00λ + 3.00 = 0
4Solve for eigenvalues3.00, 1.00
5Check diagonalizabilityYes — A = PDP⁻¹
6D = diag(eigenvalues)diag(3.00, 1.00)

Matrices P and D

MatrixValues
P (eigenvectors as columns)[[-1.00,-1.00], [-1.00,1.00]]
D (diagonal eigenvalues)diag(3.00, 1.00)
Planning notes, formulas, and examples

About the Diagonalize Matrix Calculator

Matrix diagonalization is a foundational technique in linear algebra that decomposes a square matrix A into the product PDP⁻¹, where D is a diagonal matrix of eigenvalues and P is a matrix whose columns are the corresponding eigenvectors. This decomposition dramatically simplifies computing matrix powers, exponentials, and solving systems of differential equations. Our Diagonalize Matrix Calculator supports both 2×2 and 3×3 matrices, walking you through each step: forming the characteristic polynomial det(A − λI) = 0, solving for eigenvalues, computing eigenvectors, and assembling the P and D matrices. Understanding whether a matrix is diagonalizable also reveals important structural properties — for example, a matrix with n distinct eigenvalues is always diagonalizable, while repeated eigenvalues may or may not allow full diagonalization depending on the dimension of their eigenspaces. Engineers use diagonalization for vibration analysis in mechanical systems, physicists rely on it for quantum state representations, and data scientists apply it in Principal Component Analysis (PCA) for dimensionality reduction. Whether you are a student solving homework problems or a professional verifying computation, it returns the diagonalization outputs with clear visual comparisons of eigenvalue magnitudes and a complete step-by-step summary table.

When This Page Helps

Diagonalization becomes valuable the moment you need more than a determinant or a one-off eigenvalue check. In linear algebra coursework, it helps verify whether a repeated eigenvalue still produces enough independent eigenvectors. In applied math, it is a fast way to decide whether a matrix power, recurrence, or linear dynamical system can be simplified by working in an eigenbasis instead of multiplying the original matrix again and again.

This calculator is especially useful because it keeps the decision path together: trace, determinant, characteristic polynomial, eigenvalues, and the final diagonalizable verdict all stay attached to the same matrix. For 2×2 examples it also exposes the eigenvector columns used to build P, making it easier to compare your handwritten work to the exact matrix decomposition the interface is using.

How to Use the Inputs

  1. Select the matrix size — 2×2 or 3×3.
  2. Enter the matrix entries row by row (a₁₁, a₁₂, … ) or click a preset.
  3. Review the eigenvalues, determinant, trace, and characteristic polynomial in the output cards.
  4. Check the "Diagonalizable?" card to see if A = PDP⁻¹ is possible.
  5. Examine the eigenvalue magnitude bar chart for a visual comparison.
  6. Scroll down to the step-by-step table for a complete walkthrough of the computation.
Formula used
Characteristic polynomial: det(A − λI) = 0. For 2×2: λ² − tr(A)λ + det(A) = 0. Eigenvalues are roots; eigenvectors solve (A − λI)x = 0. A = PDP⁻¹ when P is invertible.

Example Calculation

Result: det(A) = 3, trace(A) = 4, eigenvalues = 3 and 1, diagonalizable = Yes

For A = [[2, 1], [1, 2]], the calculator forms λ² − 4λ + 3 = 0, so the eigenvalues are 3 and 1. A valid eigenvector matrix is P = [[-1, -1], [-1, 1]] using the displayed column vectors, and D = diag(3, 1). Because P is invertible, A can be written as PDP⁻¹.

Tips & Best Practices

  • A matrix with all distinct eigenvalues is always diagonalizable.
  • Symmetric real matrices are always diagonalizable with orthogonal eigenvectors.
  • If the discriminant of the characteristic polynomial is negative the eigenvalues are complex — this calculator handles real eigenvalues only.
  • Use presets to quickly explore classic examples and verify your hand calculations.
  • The trace equals the sum of eigenvalues, and the determinant equals their product — useful sanity checks.

What It Means To Diagonalize A Matrix

To diagonalize a matrix, you are looking for a change of basis that turns a full square matrix into a diagonal one. The diagonal entries are the eigenvalues, and the change-of-basis matrix is built from independent eigenvectors. When this works, matrix powers and many repeated transformations become much easier to compute because a diagonal matrix can be raised to powers entry by entry.

How To Read The Calculator Outputs

The output order reflects the real workflow used in class and in applied work. First check the trace and determinant as quick invariants. Next inspect the characteristic polynomial and eigenvalues. After that, the key question is whether the matrix has enough independent eigenvectors to build an invertible P matrix. The diagonalizable status card summarizes that decision, while the step table shows the same logic in a more explicit sequence.

When Diagonalization Helps In Practice

Diagonalization appears in vibration problems, repeated linear transformations, Markov-style models, systems of differential equations, and PCA-style reasoning about directions of stretch. It is also a good diagnostic tool: if a matrix has distinct eigenvalues, diagonalization is usually straightforward; if an eigenvalue repeats, the decomposition may fail unless the eigenspace is large enough. That is why this calculator is useful not just for answers, but for quickly testing examples and counterexamples.

Sources & Methodology

Last updated:

Frequently Asked Questions

  • Diagonalization rewrites a matrix A as PDP⁻¹, where D is a diagonal matrix of eigenvalues and P contains the eigenvectors as columns. This makes computing Aⁿ trivial: Aⁿ = PDⁿP⁻¹.