Matrix Diagonalization Calculator
Enter the four entries of a 2×2 matrix to diagonalize it.
Result
How it is calculated
For the matrix [[a, b], [c, d]] the tool computes the trace tr = a + d and determinant det = ad − bc. The eigenvalues are the roots of λ² − tr·λ + det = 0, that is λ = (tr ± √(tr² − 4·det)) ÷ 2. The larger root is shown first. If the discriminant is negative the eigenvalues are complex and the tool returns no result. A repeated eigenvalue is accepted only for a scalar matrix (b = c = 0 and a = d); any other matrix with a repeated eigenvalue cannot be diagonalized and shows nothing. Each eigenvector is taken as [b, λ − a] (or [λ − d, c] when b is zero), left unnormalised and printed to 4 decimals; a diagonal matrix gives [1, 0] and [0, 1]. The columns of P are the eigenvectors and D has the eigenvalues on its diagonal, so A = P·D·P⁻¹. You assemble P and D yourself. Scaled copies of an eigenvector are equally valid.
Worked example
Take [[4, 1], [2, 3]]. Trace = 7, determinant = 4 × 3 − 1 × 2 = 10. The discriminant is 49 − 40 = 9, with square root 3. So λ1 = (7 + 3) ÷ 2 = 5.0000 and λ2 = (7 − 3) ÷ 2 = 2.0000. Eigenvector for 5: [b, λ − a] = [1.0000, 1.0000]. Eigenvector for 2: [1.0000, -2.0000]. Check: A × [1, 1] = [5, 5] = 5 × [1, 1]. So D = diag(5, 2) and P has columns [1, 1] and [1, −2]. The determinant shown is 10.0000.
Common mistakes
- Feeding in a rotation-like matrix such as
[[0, −1], [1, 0]]. Its eigenvalues are complex, so the tool returns nothing; it works only with real eigenvalues. - Entering the entries in column order instead of row order. The fields are a, b (top row) and c, d (bottom row); swapping b and c transposes the matrix and changes the eigenvectors.
- Expecting an answer for a shear such as
[[1, 1], [0, 1]]. It has a repeated eigenvalue but only one independent eigenvector, so it is not diagonalizable and the tool shows no result. Only the identity-like scalar matrix[[3, 0], [0, 3]]passes with a repeated value. - Expecting one fixed eigenvector. Any non-zero multiple is correct, so [1, 1] and [2, 2] describe the same direction, and the tool does not normalise to unit length.
- Ignoring the order of the eigenvalues. The larger one is always listed first, so on
[[2, 0], [0, 5]]the first eigenvector is [0, 1] and the second is [1, 0]; build P and D in the same order.
About this calculator
Diagonalizing a 2×2 matrix A means writing it as A = PDP⁻¹, where D is a diagonal matrix of A's eigenvalues and P's columns are the corresponding eigenvectors. This calculator finds the eigenvalues by solving the characteristic equation det(A − λI) = 0 (a quadratic for a 2×2 matrix), finds each eigenvalue's eigenvector by solving (A − λI)v = 0, and shows the two eigenvalues (the diagonal of D), their eigenvectors (the columns of P) and the determinant. When the matrix isn't diagonalizable over the reals — its eigenvalues are complex, or a repeated eigenvalue doesn't have enough independent eigenvectors — no result is shown.
Linear algebra students and engineers diagonalize matrices because it makes repeated operations trivial — computing Aⁿ reduces to PDⁿP⁻¹, where raising a diagonal matrix to a power just means raising each diagonal entry — which is exactly how closed-form solutions to linear recurrence relations (like the Fibonacci sequence) and systems of linear differential equations are derived, and it's a core step in principal component analysis and vibration/eigenmode analysis in mechanical engineering.
Was this helpful?
You can pick up to 3 reactions.
Popular calculators
Loan Calculator
Monthly payment, total interest and full amortization schedule.
Percentage Calculator
Percent change, percent of, and ratio calculations.
Discount Calculator
Calculate final price, savings, and discount amount.
BMI Calculator
Body mass index from height and weight (metric or imperial).
Age Calculator
Compute your exact age in years, months and days from a birth date.
Compound Interest Calculator
Calculate the final amount and interest earned with compounding.
All Calculators
- Loan Calculator
- Profit Calculator
- Discount Calculator
- BMI Calculator
- Percentage Calculator
- Ideal Weight Calculator
- Age Calculator
- Pregnancy Due Date Calculator
- Compound Interest Calculator
- BMR Calculator (Basal Metabolic Rate)
- Tip Calculator
- Fuel Cost Calculator
- Date Difference Calculator
- Sleep Cycle Calculator
- Daily Water Intake Calculator
- Simple Interest Calculator
- Heart Rate Zones Calculator
- Running Pace Calculator
- Pet Age Calculator
- Calories Burned Calculator
- Macro Calculator
- TDEE Calculator (Total Daily Energy Expenditure)
- Waist-to-Hip Ratio Calculator
- Honor Roll Calculator
- One Rep Max (1RM) Calculator
- Ovulation Calculator
- Electricity Cost Calculator
- Unit Price Calculator
- Savings Goal Calculator
- Break-Even Point Calculator
- Paint Calculator
- Course Grade Average Calculator
- Business Days Calculator
- Time Duration Calculator
- Fuel Economy Calculator
- Temperature Converter
- Tile Calculator
- Aspect Ratio Calculator
- Roman Numeral Converter
- Goal Weight Timeline Calculator
- Salary Converter (Hourly to Annual)
- Credit Card Validator (Luhn)
- Body Surface Area (BSA) Calculator
- Feels-Like Temperature Calculator
- Ohm’s Law Calculator
- PPI (Pixel Density) Calculator
- Molar Mass Calculator
- Zodiac Sign Calculator (Western + Chinese)
- IBAN Validator
- Shoe Size Converter
- Country Info & Dialing Code Lookup
- Time Zone Difference (World Clock)
- CAGR (Compound Annual Growth Rate) Calculator
- Rule of 72 Calculator
- Blood Alcohol Content (BAC) Calculator
- Lean Body Mass (LBM) Calculator
- Pythagorean Theorem Calculator
- Speed Converter
- Download Time Calculator
- Date Calculator (Add/Subtract)
No calculators found
Comments (1)
Check the eigenvalues with two identities: they add up to the trace and multiply to the determinant. For the default matrix, 3 + 1 equals the trace 4, and 3 × 1 equals the determinant 3. The tool covers real 2×2 matrices only. Which matrix size would you like supported next, and do you need complex eigenvalues too?