Matrix diagonalization calculator
Find P, D and P⁻¹ for a real 2×2 matrix, then check A = PDP⁻¹.
Result
Calculate to see the result.
How to use
- Enter the four entries in row order. The example [4, 1; 0, 2] works immediately.
- Calculate to find a basis of eigenvectors P and its matching diagonal D. Read P by columns.
- Check the reconstructed matrix and residuals. Copy includes all matrices and checks. Editing invalidates the previous result.
Worked example
For A = [4, 1; 0, 2], the eigenvalues are 4 and 2. One choice is P = [1, −1/√5; 0, 2/√5] with D = [4, 0; 0, 2]. Multiplying PDP⁻¹ returns A.
Limits and interpretation
This tool handles nonsymmetric real 2×2 matrices as well as symmetric ones. It classifies the discriminant exactly for the accepted decimal entries, then uses floating-point arithmetic for P and P⁻¹. Results are approximate; displayed rounding can produce a larger residual if you re-enter the printed values. Relative residuals use the infinity norm. P is withheld when κ∞(P) exceeds 10⁸ or a verification error exceeds 10⁻⁸.
Frequently asked questions
Does a repeated eigenvalue always prevent diagonalization?
No. In 2×2, λI is diagonalizable and this tool uses P = I. A nonscalar matrix with a repeated eigenvalue is not diagonalizable. Try [2, 1; 0, 2].
Why can another answer have a different P?
Eigenvectors can be scaled, sign-flipped or reordered. The corresponding entries of D must match the columns of P.
Are 3×3 or complex matrices supported?
No. A negative discriminant means no diagonalization over the real numbers. A complex diagonalization may still exist, but is not calculated here.