On this page
Suppose you have already inverted a large matrix A, and then one entry, row or column changes. Inverting the new matrix from scratch throws that work away. Two identities published around 1950 let you correct the old inverse instead.
What does the Sherman–Morrison formula say?
A rank-one change adds an outer product uvᵀ, where u and v are column vectors. Changing a single entry is the simplest case: u and v are unit vectors.
If A is invertible, then A + uvᵀ is invertible exactly when 1 + vᵀA⁻¹u ≠ 0, and then (A + uvᵀ)⁻¹ = A⁻¹ − A⁻¹uvᵀA⁻¹ / (1 + vᵀA⁻¹u), as stated on the Sherman–Morrison formula page.
The formula is named after Jack Sherman and Winifred J. Morrison's 1950 paper in The Annals of Mathematical Statistics, Adjustment of an inverse matrix corresponding to a change in one element of a given matrix, though it had appeared in earlier work. William Hager's 1989 SIAM Review survey, Updating the inverse of a matrix, traces that history and its uses in statistics, networks, structural analysis and optimisation.
How do you use Sherman–Morrison on a 3×3 matrix?
Take the upper triangular matrix A with rows (1, 1, 0), (0, 1, 1), (0, 0, 1). Its inverse A⁻¹ has rows (1, −1, 1), (0, 1, −1), (0, 0, 1).
Now put a 1 in row 3, column 1. The new matrix B has rows (1, 1, 0), (0, 1, 1), (1, 0, 1), so B = A + uvᵀ with u = e₃ = (0, 0, 1)ᵀ and v = e₁ = (1, 0, 0)ᵀ.
A⁻¹u picks out column 3 of A⁻¹: (1, −1, 1)ᵀ.
vᵀA⁻¹ picks out row 1 of A⁻¹: (1, −1, 1).
The denominator is 1 + vᵀA⁻¹u = 1 + (entry 1,3 of A⁻¹) = 2. It is not zero, so B is invertible.
Their outer product has rows (1, −1, 1), (−1, 1, −1), (1, −1, 1). Divide it by 2.
Subtract from A⁻¹: B⁻¹ has rows (½, −½, ½), (½, ½, −½), (−½, ½, ½).
Check: row 3 of B times column 1 of B⁻¹ gives ½ − ½ = 0, as it should.
Why does it cost O(n²) instead of O(n³)?
Inverting an n×n matrix by Gauss–Jordan elimination costs O(n³) operations, as listed in the table of computational complexity. Even solving one system by Gaussian elimination takes approximately 2n³/3 operations.
The Sherman–Morrison update needs only matrix–vector products and one outer product: 3n² scalar multiplications in general, and only n² when u and v are both unit columns, according to the Sherman–Morrison formula page. For n = 1,000 that is 3 million multiplications, against a cubic cost on the order of n³ = 1 billion, so the saving grows with the size of the matrix.
What is the Woodbury matrix identity?
For a rank-k change, write it as UCV, with U of size n×k, C of size k×k and V of size k×n. The Woodbury matrix identity is (A + UCV)⁻¹ = A⁻¹ − A⁻¹U(C⁻¹ + VA⁻¹U)⁻¹VA⁻¹. When U and V are vectors it reduces to Sherman–Morrison.
The inner inverse, of C⁻¹ + VA⁻¹U, is only k×k, so when C is much smaller than A this beats inverting A + UCV directly. Max Woodbury's 1950 Princeton memorandum, Inverting modified matrices, is listed in the references of Hager's survey.
If outer products or rank still feel shaky, the Fermi Concept Library covers every concept in mathematics.
Where are these identities used: Kalman filters and least squares?
The Kalman filter, introduced by R. E. Kalman in 1960 in A new approach to linear filtering and prediction problems, updates an estimate of a system's state each time a measurement arrives. The Woodbury identity page notes it is applied there and in recursive least squares: you invert a matrix the size of the observation vector, not the state, as small as 1×1 when one new observation is processed at a time.
Recursive least squares works the same way. Each new data point x adds xxᵀ to XᵀX in the normal equations, so Sherman–Morrison refreshes (XᵀX)⁻¹ without refitting. For the batch problem, see our post on the Moore–Penrose pseudoinverse for solving Ax = b.
When should you be careful?
Check the denominator first: near zero, the new matrix is close to singular and the update can lose accuracy.
Little is known about the formula's numerical stability, says the Sherman–Morrison formula page, so learn the condition number of a matrix before trusting long chains of updates.
For a single solve of Ax = b, an LU decomposition worked on a 3×3 is usually the better tool.
Practise linear algebra in the Fermi Problem Library, whose step-by-step solver explains the reasoning.



