Once PA=LU is in hand, three of the most common matrix-level computations — solving a system, taking the determinant, and forming the inverse — collapse to cheap operations on the factors. The table below collects each task with the procedure it reduces to, the cost given the factorization, and the cost of doing the same task from scratch for comparison. The split below is between paying once and paying per use. The factorization is the expensive step and happens a single time; everything after it is a triangular solve or a product along a diagonal. Reading the cost column downward shows why the decomposition is stored rather than recomputed — the first row is cubic, the rest are quadratic or less.
Decompositions · LU
What LU computes, and at what cost
The factorization costs 32n3 once. Everything below reuses it, and the cost column is the reason the decomposition exists at all — each task afterwards is cheaper than redoing the elimination.
4tasks
The factorization itself1
132n3 flops Gaussian elimination with the multipliers kept rather than discarded — L holds what was subtracted, U holds what remained, P records the row swaps. The elimination was being done anyway; LU is the observation that its byproducts are worth storing. Reusing it — cost per use3
2forward solve Ly=Pb, then back solve Ux=y 2n2 per right-hand side Two triangular solves, each n2. The saving arrives on the second right-hand side: a fresh elimination would cost 32n3 again, while reusing the factors costs n2 — which is why LU is what a solver stores when the matrix is fixed and b varies. 3s = number of row swaps in P detA=(−1)s∏uii Multiply the diagonal of U and correct the sign for the swaps — O(n) once the factorization exists. Cofactor expansion is O(n!) for the same number, which is the gap between a definition and a method. 4solve Axi=ei for each i n solves at 2n2 each. Worth doing only when the inverse is genuinely wanted as an object — if the goal is solving systems, the triangular solves above are three times cheaper and numerically better behaved. The break-even point arrives immediately. Solving one system by elimination costs 32n3 whether or not the factors are kept, so keeping them is free; the second right-hand side then costs 2n2 instead of another 32n3. For a 1000×1000 matrix that is two million operations against roughly seven hundred million — a factor of several hundred, on the same matrix, for a different b. The last row is the one to read as a warning. Computing A−1 through LU is perfectly possible and rarely the right thing to do: it costs three times a single solve, and using the inverse afterwards is both slower and less accurate than the two triangular solves it replaced. The inverse is worth forming when it is the answer, not when it is a step toward one.