How Matrix Operations Work
A matrix is a rectangular grid of numbers, and a 2×2 matrix packs four values into two rows and two columns. Matrices earn their keep because one grid can describe a whole situation at once — a pair of equations, a table of costs, or a geometric transformation that stretches, reflects, or rotates the plane — and the arithmetic stays compact. This calculator performs the four core 2×2 operations: addition and multiplication of two matrices, plus the determinant and inverse of the first one. Type the entries into the two grids, press an operation button, and the result appears below, computed instantly in your browser.
The Symbols, Entry by Entry
Write a 2×2 matrix as A = [[a, b], [c, d]]. The letters a, b, c, d are the entries, located by row then column: a sits in row 1, column 1; b in row 1, column 2; c in row 2, column 1; d in row 2, column 2. The pair a and d form the main diagonal, running top-left to bottom-right, while b and c form the other diagonal. The symbol det(A) is the determinant, ad − bc, a single number measuring how the matrix scales area. A⁻¹ is the inverse — the matrix that undoes A, returning the identity [[1, 0], [0, 1]] when multiplied by it — and it exists only when det(A) ≠ 0.
How to Use the Matrix Calculator
- Fill in Matrix A: click each of the four cells in the left grid and type your entries, top row first.
- Fill in Matrix B the same way in the right grid — B is needed for addition and multiplication, ignored for the other two operations.
- Press A + B to add the grids entry by entry, or A × B to multiply rows of A by columns of B.
- Press det(A) for the determinant of A alone, or Inverse A⁻¹ for its inverse; a singular A (determinant 0) produces an error message instead of a result.
- Read the output panel below the buttons — results are shown as a formatted grid or a single number.
Worked Example: Multiplying A × B
Take A = [[1, 2], [3, 4]] and B = [[5, 6], [7, 8]]. Each entry of the product comes from a row of A meeting a column of B:
- Top-left: 1×5 + 2×7 = 19
- Top-right: 1×6 + 2×8 = 22
- Bottom-left: 3×5 + 4×7 = 43
- Bottom-right: 3×6 + 4×8 = 50
So A × B = [[19, 22], [43, 50]]. Note that order matters: B × A gives [[23, 34], [31, 46]], a different answer — matrix multiplication is not commutative. The pattern is always the same: a row of the left matrix travels across a column of the right matrix, multiplying matching pairs and adding the products. Addition, by contrast, never mixes positions: A + B simply adds the four matching entries, giving [[6, 8], [10, 12]] for these same two grids.
Worked Example: Finding an Inverse
Find the inverse of A = [[2, −1], [0, 3]], the kind of matrix that appears when a system has one equation already solved for a single variable.
- Compute the determinant: det(A) = ad − bc = 2×3 − (−1)×0 = 6 − 0 = 6. It is nonzero, so the inverse exists.
- Swap and flip: swap the diagonal entries a and d, and change the signs of b and c: [[3, 1], [0, 2]].
- Divide every entry by the determinant: A⁻¹ = (1/6) × [[3, 1], [0, 2]] = [[0.5, 1/6], [0, 1/3]] ≈ [[0.5, 0.1667], [0, 0.3333]].
- Verify: A × A⁻¹ — top-left: 2×0.5 + (−1)×0 = 1; top-right: 2×(1/6) + (−1)×(1/3) = 1/3 − 1/3 = 0; bottom row: 0 and 3×(1/3) = 1. The product is the identity matrix, as it must be. Pressing Inverse A⁻¹ above with these entries returns the same grid.
Determinant and Inverse
The determinant of [[a, b], [c, d]] is ad − bc. For A above, det = 1×4 − 2×3 = −2. The inverse swaps a and d, flips the signs of b and c, and divides everything by the determinant: A⁻¹ = [[−2, 1], [1.5, −0.5]]. If the determinant is 0, no inverse exists — the matrix squashes the plane flat.
When to Use It
Use this tool to check linear-algebra homework before handing it in, when one slipped sign in a product can cost several marks. Use it to solve two-variable systems with the inverse method (x = A⁻¹b) — for example, finding how many of two products a shop sold when total items and total revenue are both known. Use it to prototype the 2×2 transforms behind 2D graphics and game movement, where one matrix might rotate a sprite and a second one scale it. And use the determinant alone as a quick test: det = 0 warns that a system has no unique solution before you waste time solving it.
Common Mistakes
- Multiplying entry by entry. That shortcut works for addition, never for multiplication: each product entry is a full row-times-column dot product. Entry-by-entry on A and B above would give [[5, 12], [21, 32]] — not the true [[19, 22], [43, 50]].
- Assuming A × B equals B × A. Matrix multiplication is not commutative; swapping the grids usually changes every entry, so enter the transformation you apply first on the correct side.
- Trying to invert a singular matrix. If ad − bc = 0 the inverse does not exist, however the entries are arranged. The calculator reports an error rather than inventing one — take that as the answer, not a malfunction.
Multiplying a row by a column is the dot product repeated — for two plain vectors, use the dot product calculator to get the scalar product, magnitudes, and angle in one step. For systems of equations and more linear algebra, visit the math problem solver homepage — every tool there is free and shows its worked steps.