A topic in the Open Knowledge Graph — a free, open map of 15,290 topics and the order to learn them in.

LU Decomposition

College Depth 111 in the knowledge graph ☐ I know this ☆ Set as goal
709prerequisites beneath it
See this on the map →
Gaussian Elimination and Row ReductionGaussian Elimination with Partial Pivoting+2 more→
LU decomposition LU factorization lower triangular upper triangular factorization

Core Idea

LU decomposition factors a square matrix A into a product A = LU where L is lower triangular (with 1s on the diagonal) and U is upper triangular. The U factor is the row echelon form of A, and L records the multipliers used in Gaussian elimination. Once computed, LU decomposition allows efficient solution of Ax = b for multiple right-hand sides b: first solve Ly = b (forward substitution), then Ux = y (back substitution), each taking O(n²) time rather than O(n³) for full elimination. LU decomposition is the practical workhorse for numerical linear algebra.

How It's Best Learned

Perform Gaussian elimination on a matrix while recording multipliers in a separate L matrix. Verify that LU = A. Then solve two or three linear systems with different b vectors using the same LU factorization to appreciate the computational savings.

Common Misconceptions

Explainer

You already know Gaussian elimination: you apply a sequence of row operations to transform a matrix A into upper triangular form U. LU decomposition is the insight that this process doesn't just produce U — it also produces L automatically as a byproduct. Every time you perform an elimination step (subtract a multiple of one row from another), you are recording a multiplier. Collect those multipliers into a lower triangular matrix and you have L. The factorization A = LU is simply a way to package the entire elimination process into two matrices.

To see why L has the shape it does, think about what elimination does: to eliminate the entry in row i, column j, you subtract (a_ij / a_jj) times row j from row i. That ratio is the multiplier, and it fills position (i, j) of L — below the diagonal. The diagonal of L is all 1s because each row eliminates itself trivially. The result is that L is lower triangular with 1s on the diagonal, and U is the upper triangular echelon form of A.

The real payoff comes when you need to solve Ax = b for many different right-hand sides b. With Gaussian elimination alone, you must redo O(n³) work for each new b. With LU, you factor once and then solve two cheaper problems: forward substitution (Ly = b, solving for y row by row from top to bottom) and back substitution (Ux = y, solving for x row by row from bottom to top). Each of these triangular solves costs only O(n²), so once the factorization is in hand, each new right-hand side is solved in O(n²) time. This is why LU is the standard algorithm inside `numpy.linalg.solve`, MATLAB's `\` operator, and virtually every numerical solver.

One important caveat: LU decomposition as described requires that elimination proceeds without any zero pivots appearing. When a zero pivot would appear, you must swap rows before continuing — this introduces a permutation matrix P so that the factorization becomes PA = LU rather than A = LU. In practice, even non-zero pivots are swapped when they are very small relative to other entries (partial pivoting), which improves numerical stability. The L and U factors always exist for any invertible matrix after the appropriate row permutations.

Practice Questions 5 questions

Prerequisite Chain

Understanding Zero → The Number Zero → Counting to Five → Counting to 10 → Counting to 20 → Counting a Set of Objects Up to 20 → Cardinality: The Last Number Counted → Matching Numerals to Quantities → Subitizing Small Quantities → Addition Within 10 → Number Bonds to 10 → Addition Within 20 → Doubles and Near Doubles → Doubles Facts Within 10 → Near Doubles Facts Within 20 → Mental Math Strategies for Addition → Mental Math: Adding and Subtracting Tens → Addition Within 100 → Repeated Addition as Multiplication → Multiplication as Equal Groups → Multiplication: Arrays → Basic Multiplication Facts (0s, 1s, 2s, 5s, 10s) → Multiplication Facts Within 100 → Division as Equal Sharing → Division as Grouping (Measurement Division) → Division: Grouping (Repeated Subtraction) Model → Division: Fair Sharing Model → Division as Equal Sharing → Division as Grouping → Basic Division Facts → Division Facts Within 100 → Multiplication and Division Fact Families → Relationship Between Multiplication and Division → Division Facts as Inverse of Multiplication → Remainders and Quotients in Division → Division Word Problems → Multi-Step Word Problems → Solving Multi-Step Word Problems → Multiplication Word Problems → Division Word Problems → Introduction to Long Division → Factors and Multiples → Prime and Composite Numbers → Equivalent Fractions → Relating Fractions and Decimals → Decimal Place Value → Integers and the Number Line → Comparing and Ordering Integers → Absolute Value → Adding Integers → Subtracting Integers → Multiplying Integers → Dividing Integers → Unit Rates → Proportions → Percent Concept → Converting Between Fractions, Decimals, and Percents → Operations with Rational Numbers → Two-Step Equations → Solving Multi-Step Equations → Equations with Variables on Both Sides → Angle Pairs: Complementary, Supplementary, and Vertical → Parallel Lines and Transversals → Corresponding Angles → Alternate Interior Angles → Triangle Angle Sum Theorem → Exterior Angle Theorem → Triangle Inequality Theorem → Similar Triangles: AA Similarity → Similar Triangles: SSS and SAS Similarity → Proportions in Similar Triangles → Right Triangle Trigonometry Introduction → Sine, Cosine, and Tangent Ratios → Trigonometric Ratios Review → Radian Measure → Converting Between Degrees and Radians → The Unit Circle → Graphing Sine and Cosine → Graphing Tangent and Reciprocal Trigonometric Functions → Derivatives of Trigonometric Functions → Antiderivatives → Indefinite Integrals → Basic Integration Rules → Riemann Sums → Definite Integral Definition → Double Integrals: Definition and Setup → Iterated Integrals and Fubini's Theorem → Double Integrals over Rectangular Regions → Double Integrals over General Regions → Applications of Double Integrals: Area, Mass, and Moments → Center of Mass → Conservation of Linear Momentum → Elastic Collisions → Inelastic Collisions → Coefficient of Restitution → Collision Analysis and Real-World Applications → Two-Body Collisions in the Center-of-Mass Frame → Reduced Mass and Two-Body Problems → Kinematics in Two Dimensions → Projectile Motion → Circular Motion: Kinematics → Simple Harmonic Motion → Introduction to Differential Equations → Euler's Method for Numerical Solutions → Euler's Method for ODEs (Error Analysis) → Runge-Kutta Methods → Multistep Methods: Adams-Bashforth and Adams-Moulton → Stiff Differential Equations and Stability Regions → Stability Regions and A-Stability → Numerical Stability and Conditioning → Gaussian Elimination with Pivoting → LU Decomposition

Longest path: 112 steps · 709 total prerequisite topics

Prerequisites (4)

Leads To (0)

No topics depend on this one yet.