Matrix Calculator
Determinant, transpose, addition, multiplication, and inverse (2×2 to 4×4).
Number
Counts
About this topic
Determinant (det A) A scalar that measures the 'scale factor' of a matrix.
The determinant tells you how a matrix scales area (2D) or volume (3D). A zero determinant means the matrix collapses space and is not invertible.
Key formulas & rules
- •2×2: det = ad − bc
- •3×3: Sarrus rule or cofactor expansion
- •det(A) = 0 → matrix is singular (no inverse)
- •det(A) ≠ 0 → matrix is invertible
- •det(AB) = det(A)·det(B)
- •det(Aᵀ) = det(A)
Examples
| Input | Output | Note |
|---|---|---|
| [[1,2],[3,4]] | −2 | 1×4 − 2×3 |
| [[2,0],[0,2]] | 4 | Scales area by 4 |
| [[1,2],[2,4]] | 0 | Rows dependent |
| I₃ (identity) | 1 | det(I) = 1 |
Real-world uses
Transpose (Aᵀ) Swap rows with columns — flip across the diagonal.
The transpose mirrors a matrix across its main diagonal. Element at (i, j) moves to (j, i).
Key formulas & rules
- •(Aᵀ)ᵀ = A
- •(A + B)ᵀ = Aᵀ + Bᵀ
- •(AB)ᵀ = BᵀAᵀ (order flips!)
- •det(Aᵀ) = det(A)
- •Symmetric matrix: A = Aᵀ
- •Diagonal matrix: Aᵀ = A
Examples
| Input | Output | Note |
|---|---|---|
| [[1,2],[3,4]]ᵀ | [[1,3],[2,4]] | Diagonal stays |
| [[1,2,3]]ᵀ | [[1],[2],[3]] | Row → column |
| Iᵀ | I | Identity unchanged |
| A = Aᵀ | Symmetric | Mirror equal |
Real-world uses
Addition & Subtraction Add or subtract matching entries of same-size matrices.
Matrix addition is element-wise. Both matrices must have the same dimensions.
Key formulas & rules
- •(A + B)ᵢⱼ = Aᵢⱼ + Bᵢⱼ
- •Commutative: A + B = B + A
- •Associative: (A+B)+C = A+(B+C)
- •Requires A and B to have same size
- •Zero matrix O is the additive identity
- •A − A = O
Examples
| Input | Output | Note |
|---|---|---|
| [[1,2],[3,4]] + [[5,6],[7,8]] | [[6,8],[10,12]] | Element-wise |
| [[1,2],[3,4]] − [[1,2],[3,4]] | [[0,0],[0,0]] | Zero matrix |
| A + O | A | Identity element |
| Size mismatch | Error | Different dims |
Real-world uses
Matrix Multiplication (AB) Row-by-column dot products — order matters!
Matrix multiplication is not element-wise. Entry (i, j) of AB is the dot product of row i of A and column j of B.
Key formulas & rules
- •(AB)ᵢⱼ = Σₖ Aᵢₖ · Bₖⱼ
- •Not commutative: AB ≠ BA generally
- •Associative: (AB)C = A(BC)
- •Distributive: A(B+C) = AB + AC
- •Requires cols(A) = rows(B)
- •Identity: AI = IA = A
Examples
| Input | Output | Note |
|---|---|---|
| [[1,2],[3,4]]·[[5,6],[7,8]] | [[19,22],[43,50]] | Row × column |
| AI₂ | A | Identity works |
| AB vs BA | Different | Not commutative |
| 2×3 · 3×2 | 2×2 | Inner dims match |
Real-world uses
Inverse (A⁻¹) The matrix that 'undoes' A when multiplied.
The inverse satisfies A·A⁻¹ = A⁻¹·A = I. Only square matrices with det ≠ 0 have inverses.
Key formulas & rules
- •A·A⁻¹ = A⁻¹·A = I
- •Exists only if det(A) ≠ 0
- •2×2 formula: A⁻¹ = (1/det)·[[d,−b],[−c,a]]
- •3×3+: Gauss-Jordan or adjugate method
- •(AB)⁻¹ = B⁻¹·A⁻¹ (order flips!)
- •(Aᵀ)⁻¹ = (A⁻¹)ᵀ
Examples
| Input | Output | Note |
|---|---|---|
| [[1,2],[3,4]]⁻¹ | [[−2,1],[1.5,−0.5]] | 1/det × adjugate |
| I⁻¹ | I | Self-inverse |
| [[1,1],[1,1]]⁻¹ | No inverse | det = 0 |
| AB inverse | B⁻¹A⁻¹ | Order flips |
Real-world uses
Trace (tr A) Sum of the diagonal entries — key for eigenvalues.
The trace is a simple scalar that reveals a lot about the matrix. It equals the sum of eigenvalues.
Key formulas & rules
- •tr(A) = Σ Aᵢᵢ (sum of diagonal)
- •tr(A + B) = tr(A) + tr(B)
- •tr(cA) = c·tr(A)
- •tr(AB) = tr(BA) (cyclic property)
- •tr(A) = sum of eigenvalues
- •tr(Iₙ) = n
Examples
| Input | Output | Note |
|---|---|---|
| [[1,2],[3,4]] | 5 | 1 + 4 |
| I₃ | 3 | n for Iₙ |
| [[1,0],[0,−1]] | 0 | eigenvalues ±1 |
| tr(AB) | tr(BA) | Cyclic |
Real-world uses
Identity Matrix (I) The matrix analogue of '1' — leaves other matrices unchanged.
The identity matrix has 1s on the diagonal and 0s elsewhere. Multiplying by I is like multiplying a number by 1.
Key formulas & rules
- •Iᵢⱼ = 1 if i = j, else 0
- •A·I = I·A = A
- •det(I) = 1
- •tr(Iₙ) = n
- •Iᵀ = I
- •I⁻¹ = I (self-inverse)
Examples
| Input | Output | Note |
|---|---|---|
| I₂ | [[1,0],[0,1]] | 2×2 identity |
| I₃ | 3×3 with 1s | 3×3 identity |
| A·I | A | No effect |
| I⁻¹ | I | Self-inverse |
Real-world uses
Modes & formulas
Determinant
The determinant measures how the matrix scales area (in 2D) or volume (in 3D). A negative determinant indicates a reflection.
Transpose
The transpose satisfies (Aᵀ)ᵀ = A, (A + B)ᵀ = Aᵀ + Bᵀ, and (AB)ᵀ = BᵀAᵀ (note the reversal of order).
Addition & Subtraction
Matrix addition is commutative and associative. It's equivalent to adding the corresponding linear transformations.
Multiplication
Matrix multiplication represents the composition of linear transformations. (AB)x means apply B, then apply A.
Inverse
The inverse solves systems of the form Ax = b by x = A⁻¹b. The tool rejects singular matrices (det = 0) with a clear error.
Trace
The trace gives quick information about a matrix's spectrum without computing eigenvalues.
Identity
Multiplying any matrix by the identity matrix leaves it unchanged: AI = IA = A.