Matrix Calculator
Add, subtract, and multiply 2×2 matrices, and get their determinants.
det(A) = -2 · det(B) = -2
To multiply two 2×2 matrices, each entry is the dot product of a row of the first and a column of the second. For A = [[1, 2], [3, 4]] and B = [[5, 6], [7, 8]], A × B = [[19, 22], [43, 50]], since 1×5 + 2×7 = 19. The determinant is ad − bc.
How 2×2 matrix operations work
Addition and subtraction are easy — they work element by element, position against matching position. Multiplication is different: each entry of the product is the dot product of a row from the first matrix and a column from the second. That mixing is why order matters.
the 2×2 determinant; zero means the matrix is singular (no inverse)
Worked example
Multiply A = [[1, 2], [3, 4]] by B = [[5, 6], [7, 8]]:
- 1 Top row of A against each column of B. 1×5 + 2×7 = 19 and 1×6 + 2×8 = 22 — the top row of the product is [19, 22].
- 2 Bottom row of A against each column of B. 3×5 + 4×7 = 43 and 3×6 + 4×8 = 50 — the bottom row is [43, 50].
- 3 Assemble and check the determinant of A. A×B = [[19, 22], [43, 50]]; det A = 1×4 − 2×3 = −2, so A is invertible.
2×2 operations at a glance
For A = [[a, b], [c, d]] and B = [[e, f], [g, h]].
| Operation | Result | Notes |
|---|---|---|
| A + B | [[a+e, b+f], [c+g, d+h]] | Element by element |
| A − B | [[a−e, b−f], [c−g, d−h]] | Element by element |
| A × B | [[ae+bg, af+bh], [ce+dg, cf+dh]] | Rows × columns; not commutative |
| det A | ad − bc | Zero ⇒ no inverse |
Why order and the determinant matter
A×B ≠ B×A in general. Matrix multiplication is not commutative — swapping the order usually changes the result, so always keep the factors in order.
A determinant of zero means singular. The matrix collapses area to zero and has no inverse; the corresponding linear system has no unique solution.
The determinant is a scaling factor. Its absolute value is how much the matrix stretches or shrinks area, and a negative sign means it also flips orientation.