← Back to course

Matrix Inverses & Solving Linear Systems

You’ll be able to

A system as a single matrix equation

The system 2x + 3y = 8, x − y = −1 can be written AX = B with A = [[2, 3], [1, −1]], X = [x, y]ᵀ and B = [8, −1]ᵀ. If A has an inverse, multiplying on the left by A⁻¹ gives X = A⁻¹B — a formula that solves the whole system at once. This packaging matters more as systems grow, and it is how linear systems are actually solved computationally.

Determinant and inverse of a 2 × 2 matrix
for A = [[a, b], [c, d]]: det A = ad − bc · A⁻¹ = (1/det A)·[[d, −b], [−c, a]]
Swap the diagonal entries, negate the off-diagonal ones, divide by the determinant. The inverse exists exactly when det A ≠ 0.
Worked example

Solve 2x + 3y = 8 and x − y = −1 using an inverse matrix.

  1. 1.A = [[2, 3], [1, −1]] and B = [8, −1]ᵀ.
  2. 2.det A = (2)(−1) − (3)(1) = −2 − 3 = −5. Nonzero, so the inverse exists.
  3. 3.A⁻¹ = (1/−5)·[[−1, −3], [−1, 2]] = [[0.2, 0.6], [0.2, −0.4]].
  4. 4.X = A⁻¹B: x = 0.2(8) + 0.6(−1) = 1.6 − 0.6 = 1.
  5. 5.y = 0.2(8) + (−0.4)(−1) = 1.6 + 0.4 = 2.
  6. 6.Check both equations: 2(1) + 3(2) = 8 ✓ and 1 − 2 = −1 ✓.
Answer: x = 1 and y = 2. Verifying in both original equations is essential — a single sign error in the inverse produces a wrong answer that looks entirely plausible.

What a zero determinant means

det A = 0 means A has no inverse — it is singular — and the system has no unique solution. Geometrically the two equations describe lines that are either identical (infinitely many solutions) or parallel and distinct (no solutions). The determinant alone cannot distinguish those two cases; you have to look at the constants. A zero determinant is therefore a warning that the method has broken down, not an answer.

Determinant and solution count
det A ≠ 0 → exactly one solution · det A = 0 → either no solution or infinitely many
The determinant also measures area scaling: |det A| is the factor by which A scales areas, and det A = 0 means it collapses the plane onto a line.
Checkpoint

What is the determinant of [[4, 6], [2, 3]], and what does it tell you?

Watch out

Matrix multiplication is not commutative: AB and BA are generally different, and may not even both be defined. So the step "multiply both sides by A⁻¹" must specify the side. AX = B requires left multiplication, giving A⁻¹AX = A⁻¹B.

The identity matrix and what "inverse" means

The identity I = [[1, 0], [0, 1]] leaves every vector alone: IX = X. An inverse is defined by AA⁻¹ = A⁻¹A = I, so applying A and then A⁻¹ returns you to where you started. That is why the method works: A⁻¹(AX) = (A⁻¹A)X = IX = X. Geometrically, if A rotates and stretches the plane, A⁻¹ un-rotates and un-stretches it — and a matrix that collapses the plane onto a line cannot be undone, which is exactly why singular matrices have no inverse.

Worked example

A theater sells 340 tickets for $2,925. Adult tickets are $12 and student tickets are $5. Set up and solve a matrix system.

  1. 1.Let a be adult tickets and s student tickets. Then a + s = 340 and 12a + 5s = 2925.
  2. 2.A = [[1, 1], [12, 5]] and B = [340, 2925]ᵀ.
  3. 3.det A = (1)(5) − (1)(12) = 5 − 12 = −7. Nonzero, so a unique solution exists.
  4. 4.A⁻¹ = (1/−7)·[[5, −1], [−12, 1]].
  5. 5.a = (1/−7)[5(340) − 1(2925)] = (1/−7)(1700 − 2925) = (1/−7)(−1225) = 175.
  6. 6.s = (1/−7)[−12(340) + 1(2925)] = (1/−7)(−4080 + 2925) = (1/−7)(−1155) = 165.
Answer: 175 adult tickets and 165 student tickets. Check both constraints: 175 + 165 = 340 ✓ and 12(175) + 5(165) = 2100 + 825 = 2925 ✓. A count problem should produce whole numbers — if it does not, the given totals are inconsistent, and that is worth reporting rather than rounding away.
Checkpoint

A system AX = B has det A = 0 and the two equations are 3x + 6y = 9 and x + 2y = 3. How many solutions?

Answer the 2 checkpoints as you read.

Sign in to save your progress