Block elimination 2026-10-14
Write a linear system as and , with an invertible matrix. Solving the first equation for and substituting in the second givesThus the Schur complement is the coefficient matrix remaining after the variables have been eliminated. When it is an invertible matrix, solve the reduced linear system for and recover . In computation, expressions such as mean solving with each column of , using the same LU decomposition or Cholesky decomposition when applicable.
For the example under block matrix inverse and right-hand side , take and . Since , the reduced equation is . Back substitution givesThe original equations return , and , respectively. The reduction retained the influence of on through the correction .
A short proof outline also explains whether is an invertible matrix: the exact matrix factorizationhas invertible matrices on the outside. Therefore is an invertible matrix precisely when the central block diagonal matrix is one. Reversing the factors gives the block matrix inverse, while taking determinants gives the Schur complement determinant identity.
Block matrix inverse Created 2026-09-24 Updated 2026-10-18
A block matrix inverse expresses the matrix inverse in terms of smaller matrices. Partition a square matrix over a field asIf is an invertible matrix, define its Schur complement . Then is an invertible matrix exactly when is an invertible matrix, andThe order of the matrix products matters. In particular, the lower-right block is , rather than generally : the coupling through and changes the response.[ref]
Convex Optimization by Stephen Boyd and Lieven Vandenberghe. Appendix A.5.5, printed p. 650: inverse of a symmetric block matrix; §C.4.1, printed p. 673: elimination for general blocks
For an original example, takeThe Schur complement is . Substitution gives the concise answerMultiplying in either order gives the identity matrix; the lower-right entry is , whereas . The difference records the feedback through the two eliminated variables.
Often the desired output is a solution of a linear system, rather than every entry of a matrix inverse. Block elimination solves with and then with , recovering the eliminated variables by back substitution. Reusing an LU decomposition of avoids explicitly forming . A favourable block diagonal matrix or tridiagonal matrix block can make this useful; merely partitioning an unstructured dense matrix does not guarantee a faster solve.[ref]
Convex Optimization by Stephen Boyd and Lieven Vandenberghe. §C.4.1, printed pp. 672–675: Algorithm C.4, factor-solve interpretation and dense complexity comparison
Consider the original small Poisson equation exampleIts exact solution is the quadratic polynomial . Use a uniform mesh with and three interior unknowns . The finite difference method replaces the negative second derivative byMultiplying by and moving the prescribed Dirichlet boundary conditions to the right givesThe endpoint values contribute and to the first and last equations; they are not additional unknowns. The Thomas algorithm givesand back substitution yieldsAll three values equal exactly: the centered finite difference for the second derivative is exact on a quadratic polynomial. This special nodal exactness does not assert exactness for arbitrary forcing or for the piecewise-linear curve joining the nodes.
Exact quadratic Dirichlet Poisson solution and the three interior values recovered by tridiagonal elimination
. Details. For any interior points with , the scaled tridiagonal matrix has and . Its pivot elements are : start at and use . All are positive. Interior rows have equality in diagonal dominance, so strict diagonal dominance is not the reason this example works. Instead it is a symmetric positive-definite matrix, since for a real vector with ,Zero would force every neighbouring value equal and hence all values zero. This connects the boundary constraints directly to the safe pivots for tridiagonal elimination.
Forward substitution 2026-10-14
Forward substitution solves a linear system with a lower triangular matrix and nonzero diagonal, from the first row downward:The first sum is empty, so . Each subsequent row uses only components already found. For a unit triangular matrix , omit the division because . The complementary procedure, back substitution, solves an upper triangular matrix system from the last row upward.[ref]
Gaussian elimination Created 2026-09-24 Updated 2026-10-25
Gaussian elimination applies elementary row operations to reduce a linear system to triangular form. Dense elimination uses arithmetic operations.
Gaussian elimination solves a linear system by removing one unknown from later equations at each step. Write the coefficients and right-hand side together as an augmented matrix . Apply the same elementary row operations to both parts until the coefficients form a row echelon form; for a square invertible matrix, this gives an upper triangular matrix system. Then back substitution recovers the unknowns from the last equation upward. The useful simplification is that each successive equation involves fewer unknowns, while the set of solutions stays the same.
Why do elementary row operations preserve solutions? Interchanging equations changes only their order. Multiplying an equation by a nonzero scalar can be undone by division. Replacing equation by itself plus times equation , with , can be undone by adding times the unchanged equation . Equivalently, an elementary matrix is an invertible matrix, so if and only if . Applying an operation to without also applying it to loses this equivalence.
At step , choose a nonzero pivot element after any row interchange. For every , form the elimination multiplier and perform the elementary row operation . Its coefficient in column becomes in exact arithmetic. Later operations combine rows that already have zeros in earlier columns, so those zeros survive. If an active column has no nonzero candidate, general row echelon form reduction skips it; a square invertible matrix always has a candidate at each step with suitable row interchanges. Partial pivoting also considers roundoff error when selecting the candidate.[ref]
2.6 Row pivoting. Fundamentals of Numerical Computation by Tobin A. Driscoll and others; §2.6.1, Definition 2.6.1: select the largest absolute candidate; §2.6.3: permute the right-hand side too
For a dense matrix with one right-hand side, the classical algorithm uses arithmetic operations over the real numbers, counting each addition, subtraction, multiplication and division as one. At step , the coefficient update has entries, each costing one multiplication and one subtraction; the elimination multipliers, right-hand-side updates and back substitution contribute lower-order terms. Searching for partial pivoting adds comparisons, and storing the dense coefficients uses space. These assumptions exclude the different storage and work patterns of sparse Gaussian elimination; the exact loop counts appear in LU factorization and solve costs. Here denotes Big O notation.
Recording the same steps as an LU decomposition makes Reusing LU factors for multiple right-hand sides possible. This is useful whenever the coefficients stay fixed while the forcing vector changes: the expensive elimination is done once. The choice of pivot element matters even when the linear system is well conditioned, as Tiny-pivot roundoff in Gaussian elimination demonstrates.
Gaussian elimination with a row swap Created 2026-10-18 Updated 2026-10-20
Consider this original linear system and its augmented matrix:The first diagonal entry is zero, so it cannot serve as a pivot element. Interchange and to obtain a pivot element of one:This chooses a convenient nonzero entry for exact arithmetic; partial pivoting would instead interchange and , selecting the largest absolute value, two. For our chosen ordering, the first-column elimination multipliers are and . The elementary row operation givesThe next pivot element is two and the next elimination multiplier is . Applying gives the upper triangular matrix systemEvery operation also changed the right-hand side. Back substitution now givesChecking the original equations, rather than only the reduced ones, verifies the answer by matrix multiplication:Thus a zero first diagonal entry was a row-order obstruction, not a singular matrix. Indeed, the diagonal product of the final upper triangular matrix is ; the single row interchange makes , since the two row additions preserve the determinant.
A row interchange supplies the first pivot element; successive elementary row operations create zeros, then back substitution gives
. Details. For full column rank , a full QR factorization gives with invertible upper triangular . The equation is consistent exactly when the final entries of vanish. If consistent, back substitution gives its unique solution. This separates consistency from uniqueness in overdetermined systems.
LU decomposition Created 2026-09-29 Updated 2026-10-14
An LU decomposition writes a square matrix as , with a lower triangular matrix and an upper triangular matrix. We use a unit triangular matrix , meaning . The factors record Gaussian elimination: contains the reduced equations, while stores the elimination multipliers needed to reconstruct the original equations. This makes Reusing LU factors for multiple right-hand sides inexpensive.[ref]
For an invertible matrix, unpivoted LU decomposition requires nonzero pivot elements at every elimination step; invertibility alone does not guarantee this. In general use Pivoted LU decomposition, with the explicit convention and a permutation matrix . Once the factors exist, solving a linear system needs forward substitution followed by back substitution, rather than forming a matrix inverse.
LU factorization and solve costs 2026-10-14
For classical dense Gaussian elimination over the real numbers, count each scalar addition, subtraction, multiplication or division as one arithmetic operation. At step , there are elimination multipliers to divide out and remaining entries, each requiring one multiplication and one subtraction. Thus this implementation's unpivoted factorization count isHere uses Big O notation. Partial pivoting adds comparisons and row movement, leaving the leading arithmetic count unchanged. The leading count agrees with the standard dense LU decomposition analysis.[ref]
With unit , forward substitution uses arithmetic operations. Back substitution uses another plus diagonal divisions. Together these cost per right-hand side; applying a stored row permutation moves entries and requires no scalar arithmetic. In Big O notation, Reusing LU factors for multiple right-hand sides therefore costswhereas refactorizing for each of the right-hand sides costs . For and , the leading counts are about versus arithmetic operations, nearly a tenfold saving. These are operation counts, not measured runtimes: memory access and optimized matrix multiplication also affect speed.[ref]
Fundamentals of Numerical Computation by Tobin A. Driscoll and others. §2.5.2, Important note after Definition 2.5.2: flop counts are a rough runtime model; the numerical comparison here is an original calculation
Matrix decomposition 2026-10-14
A matrix decomposition expresses a matrix as a matrix product of factors with simpler structure. An LU decomposition uses triangular factors, a QR decomposition uses an orthogonal matrix and a triangular factor, and a singular value decomposition separates input directions, stretching factors and output directions. The factorization is an identity; the chosen structure determines what it helps compute.
For an original two-by-two example,The outer factors are a lower triangular matrix and an upper triangular matrix, each with unit diagonal as in a unit triangular matrix; the middle factor is a diagonal matrix. Their matrix product is , and the final diagonal entry is the Schur complement of the first entry . This is the scalar version of the factorization under block elimination.
To solve , solve with the three factors in their displayed order from left to right: first the lower triangular factor, then the diagonal factor, then the upper triangular factor. The intermediate vectors are and , giving the concise answer . A new right-hand side uses the same factors. This is why Reusing LU factors for multiple right-hand sides is useful: factorization records work that otherwise would be repeated, while forward substitution and back substitution apply it cheaply.[ref]
Convex Optimization by Stephen Boyd and Lieven Vandenberghe. §C.4.1, printed pp. 673–674: block factor-solve interpretation
Different decompositions reveal different features. A Cholesky decomposition uses positive definiteness of a symmetric matrix, while a singular value decomposition also applies to rectangular matrices and exposes matrix rank. The existence and numerical behaviour of the factors depend on their own hypotheses; for example, an unpivoted LU decomposition can fail when a chosen pivot element is zero even though the matrix is an invertible matrix.
Matrix preconditioner Created 2026-10-06 Updated 2026-10-18
A matrix preconditioner is an auxiliary invertible matrix whose matrix inverse is cheap to apply and whose use improves the eigenvalues of a linear system. In symmetric positive-definite matrix problems, a symmetric positive-definite matrix preserves that structure under the symmetric transformation .
Applying means solving for a supplied vector . This notation does not require forming a general matrix inverse. A diagonal matrix gives componentwise divisions; a factored matrix gives auxiliary solves such as forward substitution and back substitution.[ref]
Notes for Ma221 Lecture 21, Nov 10 2009. Math 221, Matrix Computations, Fall 2009; Basic iterative methods, web lines 297–308, recurrence (*) and cheap auxiliary-solve requirement
Choosing makes the solve trivial but changes nothing; choosing gives the exact correction but asks us to solve the original linear system.[ref]
Past exam of the mathematics course of the University of Cambridge 2014 ib Paper 1 18C Solution Created 2026-09-24 Updated 2026-10-06
For a nonzero real vector , the Householder transformation isWriting gives , , so and . Thus is orthogonal. It reverses the component along and fixes its orthogonal complement.
For Householder QR decomposition, successively choose a reflector on each trailing row block to send its current column to a multiple of the first coordinate vector. Each step annihilates the subdiagonal entries without disturbing earlier columns. The reflector product gives an upper-trapezoidal and its transpose gives an orthogonal with .
Here the first column has norm four. Taking gives andThe second column already has no unwanted entries. On the last two rows, reflect using :This maps to . Therefore a full QR factorization isBoth displayed factors arise from the explicit reflectors; in particular and .
The first three diagonal entries of are nonzero, so the column rank is three and a consistent system has a unique solution. Consistency requires the last component of to vanish. For the given right side this component isHenceFor this value the transformed right side is . Back substitution also gives . This illustrates the Householder reduction of an overdetermined consistent system.
Use Gaussian elimination on the augmented matrix. First take and , then :By back substitution, the last row gives , the second gives and hence , and the first gives . ThusThe right-hand side has been transformed in every row operation, preserving the solution set.
Since , the QR factorization givesFirst compute by a matrix-vector product, costing scalar multiplications and additions for dense . Then solve the upper triangular matrix system by back substitution:Every denominator is nonzero because is invertible. The back substitution costs multiplications and subtractions together, plus divisions, for arithmetic operations. Including , the total is arithmetic operations under this scalar counting convention, hence , with denoting Big O notation. The already supplied QR factorization is reused; no matrix inverse needs to be computed.
Gaussian elimination uses elementary row operations to remove entries below successive pivot elements, reducing a linear system to one with an upper triangular matrix. Back substitution then solves that system. It also computes a reusable matrix factorization, so additional right-hand sides can be handled by forward substitution and back substitution without repeating the elimination.
For elimination without row exchanges, let . At step , provided the pivot element is nonzero, form the elimination multipliersand perform , applying the same operation to the right-hand side. More explicitly the resulting entries satisfy for , .
Let , where are the standard basis vectors. ThenThe matrix is a unit lower triangular matrix storing the elimination multipliers, while is an upper triangular matrix:Solving becomes followed by . If a required pivot element vanishes, an unpermuted LU decomposition can fail even for an invertible matrix. Row exchanges, typically selected by partial pivoting, instead produce with a permutation matrix ; then solve , .
For a real square matrix, a QR factorization writes with an orthogonal matrix, , and an upper triangular matrix. If is invertible, so is , andCompute and use back substitution; no matrix inverse needs to be formed.
Apply the Gram-Schmidt process to the columns . The first column has Euclidean norm two, giving and . For the second column,For the third column,This residual already has Euclidean norm one. Set and . ThusThe columns of are orthonormal, and matrix multiplication verifies .
Using precisely this QR factorization, transform the right-hand side:Back substitution in givesTherefore
For a tridiagonal matrix with subdiagonal , diagonal and superdiagonal , banded Gaussian elimination introduces no fill beyond the original band. The Thomas algorithm usesUpdate the right side by , . Then back substitution givesEach row requires only a fixed number of arithmetic operations, so both work and storage are . The assumed absence of a need for pivoting includes nonzero elimination pivots .
Direct solution usually uses a pivoted LU decomposition : solve by forward substitution, then by back substitution. For a symmetric positive-definite matrix, the Cholesky decomposition iswith lower triangular and positive diagonal. It exploits symmetry, requiring about arithmetic operations rather than the leading for general elimination.
If has full column rank and its reduced QR decomposition is , , thenChoose the signs of so that has positive diagonal. Then is precisely the upper Cholesky factor of the normal-equation matrix , or is its lower factor. This identifies the factors; in computation, obtaining directly by QR decomposition avoids explicitly forming the normal equations, which square the condition number.
At elimination column , let be the size of the remaining trailing block. Computing its multipliers costs divisions; updating all entries costs floating-point operations, one multiplication and one subtraction per entry. Thus the dominant count isUpdating the right side and back substitution add only floating-point operations. Pivot searches involve comparisons and row exchanges, without changing the leading arithmetic count. Hence Gaussian elimination with pivoting has the requested asymptotic cost.
The first-column largest pivot element is four, so eliminate with multipliers below it. The augmented matrix becomesPartial pivoting in the second column swaps rows two and three because two is largest in modulus. The next elimination multipliers are and . This givesThe third pivot element is already largest and the final multiplier below it is zero. Back substitution gives , , , . ThereforeThe row swap must also reorder the previously stored first-column multipliers in . The factors areMultiplying these factors verifies . This is the required elimination with partial pivoting, not an alternative solution method.


