HuntsvilleEngineers mark
HE Reference Shelf — huntsvilleengineers.com
The Reference Shelf · Linear Algebra & Numerical Methods

Matrix inverse

The inverse of a matrix is the matrix that undoes it — apply `A`, then `A⁻¹`, and you're back where you started — and it exists only when `A` hasn't destroyed any information along the way.

Also known as: matrix inversion · invertible matrix · nonsingular matrix

The formula

The definition:

A·A⁻¹ = A⁻¹·A = I

Whatever A does to a vector, A⁻¹ reverses it exactly; the round trip is the identity — the matrix that does nothing. A square matrix with an inverse is called nonsingular or invertible; one without is singular [1][2].

What it's for:

A·x = b   →   x = A⁻¹·b

If b is the output and A is the map, the inverse recovers the input. This line is how every closed-form answer in engineering gets written down. It is not how the answer should be computed — more on that below.

The 2×2 case, worth memorizing:

A = [[a, b],
     [c, d]]        A⁻¹ = 1/(a·d − b·c) · [[ d, −b],
                                           [−c,  a]]

Swap the diagonal, negate the off-diagonal, divide by the determinant. With A = [[4,7],[2,6]] the determinant is 4·6 − 7·2 = 10 and A⁻¹ = [[0.6, −0.7],[−0.2, 0.4]] — multiply them and you get I back. When a·d − b·c = 0 the formula divides by zero, which is the algebra telling you no inverse exists. The general version is A⁻¹ = adj(A)/det(A) — beautiful on paper, ruinously expensive in code [1][2].

The bookkeeping rules:

(A·B)⁻¹ = B⁻¹·A⁻¹        (Aᵀ)⁻¹ = (A⁻¹)ᵀ        R⁻¹ = Rᵀ  (rotation matrices)

Undoing a chain means undoing the last step first — socks and shoes. And for any pure rotation the inverse is just the transpose, which is why attitude code never actually inverts anything [1][2].

Where you meet it

  • The pointing budget review. Every direction-cosine-matrix chain on the slide has inverses in it: sensor frame back to body frame is the inverse of body-to-sensor. Because rotations are orthogonal, R⁻¹ = Rᵀ and the "inversion" is free — no arithmetic, no roundoff. The engineer who calls inv() on a DCM instead of transposing it announces something to the room.
  • The bench, de-crosstalking a multi-axis sensor. A 6-axis load cell ships with a 6×6 calibration matrix C mapping true loads to bridge outputs. Recovering loads from readings is F = C⁻¹·r, applied at every sample. This is one of the few legitimate explicit inversions in test work: C is small, well-conditioned, and inverted once at setup, not in the loop.
  • The influence-coefficient test on the stand. Push a unit load at point j, measure deflection at point i, and you've measured one entry of the flexibility matrix — which is exactly K⁻¹, the inverse of the stiffness matrix in the FEA model. A stiffness-vs-flexibility correlation check is literally comparing a matrix to a measured inverse.
  • The estimator in the flight code. The Kalman gain is K = P·Hᵀ·(H·P·Hᵀ + R)⁻¹ — a small matrix inversion inside every update cycle. The inverted matrix is only m×m (m = number of measurements), which is why this one is affordable at 100 Hz while inverting the full state covariance would not be.

How it works

Existence first. A matrix is invertible exactly when it destroys nothing: no direction gets mapped to zero, the columns are independent, the rank is full, no eigenvalue is zero, det(A) ≠ 0 — all equivalent statements of the same fact [1][2]. A singular matrix flattens some direction entirely, and once two different inputs produce the same output, no formula can tell them apart again. That's what "the inverse doesn't exist" means physically: the information isn't hidden, it's gone.

Computing it, when you must: augment with the identity and row-reduce, [A | I] → [I | A⁻¹] — Gauss–Jordan elimination. If the left block can't be driven to I, the matrix was singular and the procedure says so on the way [1][3]. In a library this is done by LU factorization plus n triangular solves, costing about 2n³ operations — roughly three times the 2n³/3 of factoring and solving once [2][3].

That factor of three is the small half of the argument for the rule every numerical analyst repeats: solve, don't invert. The bigger half is accuracy — computing x = A⁻¹·b in floating point is measurably less accurate than solving A·x = b by factorization, and it gets worse as conditioning degrades [2]. And for the sparse matrices that dominate real work there's a third reason: a banded million-DOF stiffness matrix stores in megabytes, but its inverse is fully dense — terabytes [4]. Writing x = (AᵀA)⁻¹·Aᵀ·b on the whiteboard is correct notation. Typing it into code is the mistake. The inverse is a concept for derivations and a command for almost nothing.

The gotcha that actually burns people is near-singularity. Take:

A = [[1, 1],
     [1, 1.000001]]     b = [2, 2.000001]   →   x = [1, 1]

Nudge the second entry of b by one part per million — to 2.000002 — and the answer jumps to x = [0, 2]. Nothing failed; the matrix is invertible and the arithmetic is exact. The condition number κ ≈ 4×10⁶ is the amplification factor, and the working rule is that you lose about log₁₀(κ) digits of accuracy. Note the determinant is useless as a warning here — it's a mild 10⁻⁶, and rescaling the matrix moves it anywhere you like without changing the problem. Check κ, not det.

Two more tools for the belt. If you already hold A⁻¹ and the matrix changes by rank one — one strut swapped, one sensor recalibrated — the Sherman–Morrison formula updates the inverse in O(n²) instead of refactoring in O(n³), and the Woodbury identity handles bigger patches [10][11]. And when the matrix isn't square or isn't full rank, the Moore–Penrose pseudoinverse A⁺ is the disciplined substitute: it returns the least-squares answer for overdetermined systems and the minimum-norm answer for underdetermined ones, which is why it sits under every regression routine you've ever called [12].

History

The inverse spent its first century hiding inside determinants. Colin Maclaurin's posthumous algebra text (1748) solved small systems by determinant ratios, and Gabriel Cramer published the general n-unknown rule in 1750 in a book nominally about algebraic curves [5][6]. Cramer's rule is the inverse, entry by entry — nobody had yet thought of it as an object.

Arthur Cayley did the thinking. A London conveyancing lawyer who published a few hundred mathematics papers from chambers over fourteen years at Lincoln's Inn, Cayley wrote A Memoir on the Theory of Matrices in 1858, defining matrix algebra as its own arithmetic — and with it the unit matrix, powers, and an explicit construction of the inverse from the determinant [5][7][8]. He left the bar around 1860 for Cambridge's Sadleirian chair [8]. The inverse now existed as a thing you could write, not just a procedure you could run.

The practical recipe came from a surveyor. Wilhelm Jordan — the German geodesist, no relation to Camille Jordan of canonical-form fame — published the complete-elimination variant in the 1888 edition of his geodesy handbook, refined for least-squares survey adjustments; B.-I. Clasen printed essentially the same method the same year [3][9]. That is the Gauss–Jordan reduction of every linear algebra course since.

The twentieth century made the inverse cheaper and broader. Jack Sherman and Winifred Morrison (1949–50) showed how to patch a known inverse after a rank-one change instead of starting over, and Max Woodbury's 1950 Princeton report generalized the update — with earlier appearances, as usual, including Guttman in 1946 [10][11]. Meanwhile E. H. Moore (1920), Arne Bjerhammar (1951), and a doctoral student named Roger Penrose (1955) independently built the generalized inverse for matrices with no proper inverse at all [12][13]. Between them, the twin lessons of the modern subject: update rather than recompute, and when the inverse doesn't exist, define the next best thing.

Related tools

Sources

  1. https://en.wikipedia.org/wiki/Invertible_matrix
  2. https://nhigham.com/2022/03/28/what-is-the-matrix-inverse/
  3. https://en.wikipedia.org/wiki/Gaussian_elimination
  4. https://www.johndcook.com/blog/2010/01/19/dont-invert-that-matrix/
  5. https://mathshistory.st-andrews.ac.uk/HistTopics/Matrices_and_determinants/
  6. https://en.wikipedia.org/wiki/Cramer%27s_rule
  7. https://royalsocietypublishing.org/doi/10.1098/rstl.1858.0002
  8. https://en.wikipedia.org/wiki/Arthur_Cayley
  9. https://en.wikipedia.org/wiki/Wilhelm_Jordan_(geodesist)
  10. https://en.wikipedia.org/wiki/Sherman%E2%80%93Morrison_formula
  11. https://en.wikipedia.org/wiki/Woodbury_matrix_identity
  12. https://en.wikipedia.org/wiki/Moore%E2%80%93Penrose_inverse
  13. https://en.wikipedia.org/wiki/Roger_Penrose

Written by HE in our own words from the cited sources — engineering judgment included, your stamp still required. All entries →

★ The Reference Shelf

Reading is free. The shelf is for cardholders.

Your library card is an email address: pin it to your shelf, print the card, take the FE/PE quick-reference pack, read the Huntsville history. The shelf remembers what you reach for.

Already on the list? Enter with your subscribed email →