Concepts · 4 min read

Matrices for Beginners: Multiplication, Determinant, Inverse

Matrices for Beginners: Multiplication, Determinant, Inverse — illustration
In short: A matrix is a rectangular grid of numbers. Multiplying [[1,2],[3,4]] by [[5,6],[7,8]] gives [[19, 22], [43, 50]], and its determinant is -2.

Multiplying matrices

Each entry of the product is a row of the first matrix times a column of the second (multiply pairs, then add).

EntryWorkingValue
(1,1)1×5 + 2×719
(1,2)1×6 + 2×822
(2,1)3×5 + 4×743
(2,2)3×6 + 4×850

Order matters: A × B is usually not B × A.

Determinant of a 2×2

For [[a,b],[c,d]] the determinant is ad − bc. Here 1×4 − 2×3 = -2. A non-zero determinant means the matrix can be inverted.

The inverse

A⁻¹ = (1/det) × [[d, −b], [−c, a]] = [[−2, 1], [1.5, −0.5]]. Multiplying A by A⁻¹ gives the identity matrix.

Where matrices are used

They describe transformations in computer graphics, solve systems of equations and model networks. For single equations see the linear equation solver.

Adding, subtracting and scaling matrices

Addition and subtraction work entry by entry, and only for matrices of the same size. Scalar multiplication multiplies every entry by the same number.

OperationResult
[[1,2],[3,4]] + [[5,6],[7,8]][[6, 8], [10, 12]]
[[5,6],[7,8]] − [[1,2],[3,4]][[4, 4], [4, 4]]
3 × [[1,2],[3,4]][[3, 6], [9, 12]]

Unlike multiplication, addition is commutative: A + B always equals B + A.

The identity matrix

The 2×2 identity matrix I = [[1, 0], [0, 1]] plays the role of the number 1. Multiplying any 2×2 matrix by I, on either side, leaves it unchanged. The inverse A⁻¹ is the matrix with A × A⁻¹ = I, which is why a zero determinant (no inverse) matters: no matrix can multiply back to the identity.

Solving a system with a matrix inverse

A pair of equations can be written as a matrix product. Take 2x + 3y = 12 and 4x − 3y = 6. Write it as A × [x, y] = [12, 6] with A = [[2, 3], [4, −3]].

StepWorking
Determinant of A2 × (−3) − 3 × 4 = -18
Inverse of A(1/-18) × [[−3, −3], [−4, 2]]
Multiply A⁻¹ by [12, 6]x = (−3 × 12 + −3 × 6) / -18 = 3
y = (−4 × 12 + 2 × 6) / -18 = 2

The solution is x = 3, y = 2. You can confirm it with elimination as in solving systems of equations, or by entering the matrix into the matrix calculator, which uses exact fractions.

A 3×3 determinant

For a 3×3 matrix, expand along the first row: a(ei − fh) − b(di − fg) + c(dh − eg). For [[2, 1, 3], [0, 4, 1], [5, 2, 1]] that is 2(4×1 − 1×2) − 1(0×1 − 1×5) + 3(0×2 − 4×5) = 4 + 5 − 60 = -51.

Because the determinant is not zero, this matrix has an inverse. A zero determinant would mean the rows are dependent, for instance one row being a multiple of another, and there would be no unique solution to the corresponding system.

Common mistakes with matrices

  • Multiplying entry by entry. Matrix multiplication uses row-by-column sums, not entrywise products.
  • Ignoring size rules. An m×n matrix can multiply an n×p matrix; the inner sizes must match.
  • Assuming A × B = B × A. It usually does not.
  • Forgetting the 1/det factor when writing the inverse.

Frequently asked questions

Can every matrix be inverted?

Only square matrices with a non-zero determinant.

Why is matrix multiplication not commutative?

Because rows of A pair with columns of B; swapping the order pairs different numbers.

What size matrices can be multiplied?

The number of columns of the first must equal the number of rows of the second. The result has the rows of the first and the columns of the second.

What does a zero determinant mean?

The matrix has no inverse. For a system of equations it means there is no unique solution: either none or infinitely many.

Written and reviewed by Mateuss M.

Mateuss M. writes and reviews mathematical content for CalcSolver, focusing on online calculators, formulas, equations, and practical math tools. He reviews calculator functionality, calculation methods, formulas, examples, and explanations to help ensure that each tool is clear, useful, and easy to understand.

Keep reading