Solving with the Inverse
Picture an engineer who has just built a mathematical model of a bridge: a matrix
A that turns a list of applied loads \vec{b}
into the resulting stresses — no wait, the other way round: A\vec{x}=\vec{b}
says the unknown stresses \vec{x} must produce the loads
\vec{b}. Tomorrow the wind blows from a different direction, so
\vec{b} changes. Do they really have to re-run
elimination
from scratch, every single time the load changes?
Not if A is
invertible.
Once you know A^{-1}, solving for any
\vec{b} collapses to a single multiplication. Compute the inverse once,
and every future right-hand side is almost free.
- Works whenever A is square and
invertible (equivalently, \det(A) \neq 0).
- Start from A\vec{x} = \vec{b} and multiply both sides on the left
by A^{-1}: since A^{-1}A = I, the left
side collapses to plain \vec{x}.
- The solution is \vec{x} = A^{-1}\vec{b} — and because
A^{-1} exists and is unique, this is the one and only
solution.
It's the matrix version of "divide both sides by A." Apply the undo-matrix
to \vec{b}, and the answer drops straight out.
Worked example: turning the crank
Let's actually do it, with every step shown. Solve
\begin{bmatrix} 2 & 1 \\ 1 & -1 \end{bmatrix}\vec{x} = \begin{bmatrix} 5 \\ 1 \end{bmatrix}.
Step 1 — find the determinant. For
A=\begin{bmatrix} 2 & 1 \\ 1 & -1 \end{bmatrix},
\det(A) = (2)(-1) - (1)(1) = -2 - 1 = -3.
It's non-zero, so A is invertible and the method is safe to use.
Step 2 — build A^{-1} with the
2×2 shortcut
— swap the diagonal, negate the off-diagonal, divide by the determinant:
A^{-1} = \frac{1}{-3}\begin{bmatrix} -1 & -1 \\ -1 & 2 \end{bmatrix} = \begin{bmatrix} \tfrac{1}{3} & \tfrac{1}{3} \\ \tfrac{1}{3} & -\tfrac{2}{3} \end{bmatrix}.
Step 3 — multiply A^{-1} by
\vec{b} = (5, 1):
\vec{x} = \begin{bmatrix} \tfrac13(5) + \tfrac13(1) \\ \tfrac13(5) - \tfrac23(1) \end{bmatrix} = \begin{bmatrix} 2 \\ 1 \end{bmatrix}.
Check it. Plug x=(2,1) back into the original rows:
2(2) + 1(1) = 5 ✓ and 1(2) - 1(1) = 1 ✓. No
elimination, no back-substitution — just one matrix times one vector.
One inverse, many right-hand sides
Here is the whole point of bothering to build A^{-1} at all. The board
below already knows A^{-1} for the same
A=\begin{bmatrix} 2 & 1 \\ 1 & -1 \end{bmatrix} we just used. Slide the
entries of \vec{b} and the solution
\vec{x} = A^{-1}\vec{b} updates instantly — no re-solving from scratch.
It starts at \vec{b}=(5,1), reproducing the worked example above
(\vec{x}=(2,1)). Now drag b_1 down to
1 and b_2 down to -4
— a brand-new right-hand side for the same bridge. Watch
\vec{x} snap straight to (-1, 3), with zero
extra elimination work. (Check it yourself:
2(-1) + 1(3) = 1 and 1(-1) - 1(3) = -4 — both
match the new \vec{b}.) That's the whole payoff: pay the cost of building
A^{-1} once, then solve for every new load in one multiply.
Try it yourself. Set \vec{b} = (2, 4) on the sliders
before reading on. You should land on \vec{x} = (2, -2) — check it:
2(2) + 1(-2) = 2 and 1(2) - 1(-2) = 4, both
matching. Three different right-hand sides, one A^{-1}, zero repeated
elimination.
When the trick breaks: \det(A) = 0
The whole method leans on A^{-1} existing. Try it on
A = \begin{bmatrix} 2 & 4 \\ 1 & 2 \end{bmatrix}.
The 2×2 formula needs \det(A) = (2)(2) - (4)(1) = 4 - 4 = 0 in the
denominator — and dividing by zero is not allowed. There is no
A^{-1} for this matrix at all, so
\vec{x}=A^{-1}\vec{b} is simply not available as a formula, no matter
what \vec{b} is.
Notice why: the second row is exactly half the first row, so the two equations aren't independent —
they carry less information than two equations should. Whether the system then has no
solution or infinitely many depends on the particular
\vec{b}. With \vec{b}=(1,1), row two demands
x_1+2x_2=1, but row one then forces
2x_1+4x_2 = 2(1) = 2, not the required 1 —
contradiction, so there's no solution. With
\vec{b}=(2,1) instead, row one simplifies to the very same equation as
row two, x_1+2x_2=1, so any point on that line solves
the system — infinitely many solutions. Same singular
A, two completely different fates, decided entirely by
\vec{b}. Working out which fate you're in is exactly the job of
rank and
solvability. Gaussian elimination, unlike the inverse formula, ploughs straight through
this case and tells you which fate you're in — it never demands an inverse that doesn't exist.
- The inverse method only fires when A is square and
invertible. A non-square system, or one with \det(A) = 0, has
no A^{-1} to multiply by — fall back on
elimination,
which always runs and reveals the true number of solutions.
- Computing A^{-1} is more work than solving one system
directly. If you only ever need to solve A\vec{x}=\vec{b}
once, plain elimination on that single \vec{b} is faster and
more numerically accurate than building the full inverse first. The inverse only earns its keep
when the same A gets solved again and again for many different
\vec{b}'s.
This trade-off is not just a textbook curiosity — it's exactly how real engineering simulations
work. A structural model of a bridge, wing, or building produces a stiffness matrix
A that relates applied loads \vec{b} to the
resulting displacements \vec{x}. To certify the design, engineers don't
test one gust of wind — they run hundreds of load scenarios: different wind speeds, traffic
patterns, earthquake jolts, each one a different \vec{b} but the very
same A. Computing A^{-1} just once and reusing
it for every scenario turns a brutally slow simulation into a fast one.
This "pay once, reuse forever" idea shows up everywhere in computing, not just matrices: a search
engine builds one index and answers millions of queries against it; a compiler parses your code once
and can re-run the compiled program endlessly; a hash table spends effort up front so every later
lookup is instant. Precomputing A^{-1} is the linear-algebra flavour of a
habit good programmers reach for constantly.
Elegant on paper, careful in practice
\vec{x} = A^{-1}\vec{b} is the cleanest statement of the
solution, and it proves at a glance that an invertible system has exactly one answer — that clean
certainty is worth a lot on paper. The same closed form reappears later as the
normal
equation that fits a regression line, so this idea pays off again well outside pure
linear algebra.
There's a subtler reason large-scale software still prefers elimination for a single solve: every
arithmetic step on a computer carries a tiny rounding error, and forming
A^{-1} outright takes noticeably more arithmetic steps than solving one
system directly — more steps, more chances for those tiny errors to pile up. For a bridge modelled
with thousands of unknowns, that difference in accuracy really matters. None of this changes the
idea — \vec{x}=A^{-1}\vec{b} is still exactly the right answer
in perfect arithmetic — it's purely a practical reason to prefer elimination when
A^{-1} itself will never be reused.
See it explained