How matrix operations work
Addition and subtraction are the gentle ones: matrices of the same size combine entry by entry, exactly as you’d hope. Multiplication is where matrices earn their reputation, because it is not entry-by-entry. Each entry of A × B is a row of A dotted with a column of B: slide along row i of A and down column j of B, multiply the pairs, add them up, and that sum is entry (i, j) of the product. The row-times-column rule looks arbitrary until you learn what matrices are for — they represent transformations (rotations, scalings, shears), and this exact rule is what makes multiplying two matrices the same as applying one transformation after the other. It also explains the famous surprise that A × B ≠ B × A in general: rotating then stretching is not the same as stretching then rotating.
The formula
In the product formula, aik is the entry in row i, column k of A and bkj is the entry in row k, column j of B — the sum over k is the row-dot-column operation described above. The 2×2 inverse formula has a pleasant rhythm: swap the diagonal entries, negate the off-diagonal ones, divide everything by the determinant. For 3×3 matrices this calculator uses the cofactor method (each entry of the inverse is a signed 2×2 sub-determinant, transposed and divided by det A). Both inverse formulas divide by the determinant, which is exactly why det A = 0 means no inverse exists.
Worked example
Multiply A = [[1, 2],[3, 4]] by B = [[5, 6],[7, 8]]. Four row-dot-column computations: top-left is (row 1)·(col 1) = 1×5 + 2×7 = 19; top-right is 1×6 + 2×8 = 22; bottom-left is 3×5 + 4×7 = 43; bottom-right is 3×6 + 4×8 = 50. So A × B = [[19, 22],[43, 50]]. (Try B × A and you’ll get [[23, 34],[31, 46]] — order matters.)
Invert A = [[4, 7],[2, 6]]. The determinant is 4×6 − 7×2 = 10. Swap the diagonal, negate the off-diagonal, divide by 10: A⁻¹ = [[0.6, −0.7],[−0.2, 0.4]]. Check by multiplying: A × A⁻¹ = [[1, 0],[0, 1]], the identity.
What the determinant is really telling you
The determinant isn’t just an invertibility gatekeeper — it’s a measurement. A 2×2 matrix transforms the plane, and its determinant is the factor by which it scales area: det A = 3 means every shape comes out with triple the area, and for a 3×3 matrix the same story holds with volume. A negative determinant means the transformation also flips orientation, like a reflection in a mirror. And det A = 0 means the matrix squashes the plane onto a line (or space onto a plane) — area becomes zero, information is destroyed, and no inverse can ever rebuild it. That’s the geometric reason singular matrices have no inverse, and it’s why the warning matters in practice: matrices run 3D graphics (every rotation and camera move is a matrix product), solve systems of equations, power least squares regression, and sit inside every neural network — and in all of those, a determinant near zero is the smell of a problem about to fall over numerically.