- Learn
- Mathematics
- University Math
- Linear Algebra 1
- Matrix Algebra
Matrix Algebra: Operations and Inverses
IntermediateLesson 3 of 9 in Linear Algebra 1 Course
What you will learn
- Use matrix notation; add, scale, multiply and transpose matrices; and know which rules of ordinary algebra carry over to matrices and which do not.
- Read matrix notation and add and scale matricesName the size and entries of a matrix, recognize the special matrices used throughout linear algebra, and add, subtract and scale matrices.
- Multiply matricesCompute a product column by column and with the row–column rule, check whether a product is defined, and read a product as one transformation followed by another.
- Use the properties of matrix products and powersApply the rules that hold for matrix products, recognize the rules of ordinary algebra that fail, and compute powers of square matrices.
- Transpose matrices and recognize symmetric matricesForm the transpose, use its rules (including the reversed order for products), and work with symmetric matrices and with row-times-column products of vectors.
- Read matrix notation and add and scale matrices
- Decide when a square matrix has an inverse, compute it by formula or by row reduction, use the algebra of inverses to solve equations, and explain inversion with elementary matrices.
- Understand the inverse and invert 2×2 matricesDefine the inverse of a square matrix, invert 2×2 matrices with the formula, recognize singular matrices, and solve a system with the inverse.
- Use the algebra of inverses to solve matrix equationsApply the rules for inverses of products, transposes and powers, and isolate an unknown matrix by multiplying on the correct side.
- Find inverses with elementary matrices and row reductionRepresent row operations as elementary matrices, explain why row reduction finds the inverse, and use the algorithm on [A I] to invert a matrix or show that it is singular.
- Understand the inverse and invert 2×2 matrices
- Connect invertibility with pivots, solutions of linear systems, linear independence, spanning and linear transformations through the Invertible Matrix Theorem, and use the theorem to decide and to argue.
- State and apply the Invertible Matrix TheoremState the equivalent conditions for a square matrix to be invertible, explain why they hang together, and use whichever condition is easiest to check.
- Recognize invertible linear transformations and one-sided inversesDecide when a linear transformation of ℝⁿ can be undone, find its inverse from the standard matrix, and use the theorem to argue about one-sided inverses and products.
- State and apply the Invertible Matrix Theorem
- Partition matrices into blocks, add, transpose and multiply them block by block, and invert block-diagonal and block-triangular matrices.
- Partition matrices and multiply them block by blockSplit a matrix into blocks, compute sums, transposes and products block by block when the partitions match, and write a product as a sum of column-times-row terms.
- Invert block-diagonal and block-triangular matricesFind inverses of block-diagonal and block upper triangular matrices by solving block equations, and use block elimination and the Schur complement.
- Partition matrices and multiply them block by block
- Write a matrix as a product of a lower and an upper triangular matrix, use the factors to solve systems efficiently, and handle row exchanges with permutation matrices.
- Solve linear systems with an LU factorizationExplain what an LU factorization is, solve Ax = b with two triangular systems, and explain why factoring once pays off for many right-hand sides.
- Compute an LU factorization by eliminationReduce a matrix to echelon form with row replacements, record the multipliers in L, check the result, and write the LDU form.
- Handle row exchanges with permutation matricesUse permutation matrices to reorder rows, factor PA = LU when elimination needs row exchanges, and solve systems with the permuted factorization.
- Solve linear systems with an LU factorization
Matrix Algebra study guide
1Matrix arithmetic and order
Matrix operations depend on both entries and shape. Reading a row or column correctly lets you combine data, compose transformations and recognize when a calculation is defined. Addition behaves much like vector arithmetic; multiplication introduces order, and transposing changes how rows and columns interact. Worked products and powers show where familiar number rules apply and where a matrix calculation needs a different step.
1.1 Matrix shapes and entrywise arithmetic
A matrix organizes numbers by position. Its shape matters as much as its entries: rows and columns usually represent different kinds of information.
Read positions and sizes
An matrix has rows and columns. In , the first index names the row and the second names the column. For
there are two rows and three columns, so the size is . The entry is at the right of the first row; begins the second row. Reversing the indices changes the position: but .
Each column has two entries and is a vector in . Writing treats the same array as three column vectors. Here , with the entries understood as a column. Two matrices are equal only when their shapes and all corresponding entries agree.
Recognize common shapes
A square matrix has the same number of rows and columns. Its main diagonal runs from top left to bottom right through . A diagonal matrix is square and has zeros everywhere off that diagonal. Its diagonal entries may themselves be zero.
The identity matrix has ones on the main diagonal and zeros elsewhere. A zero matrix has only zero entries and may be rectangular. An upper triangular matrix has zeros below its main diagonal; a lower triangular matrix has zeros above it. Entries on the diagonal of a triangular matrix are not required to be one.
Combine corresponding entries
Addition requires equal sizes. Add the entries in matching positions; multiply every entry by a scalar to scale a matrix. Subtraction means adding the negative of the second matrix. With the matrix above and
we get
For , first scale every entry of , then subtract:
For instance, its second-row, second-column entry is . The parentheses keep the sign of the entry being subtracted visible. A matrix cannot be added to a matrix, even though both contain six entries.
Use familiar addition rules
Addition is commutative and associative: and . Also , , , and . These statements follow entry by entry from number arithmetic.
Column combinations use exactly these operations. If has columns , then . This connects the notation to matrix multiplication: the entries of tell us how much of each column to use.
Key Takeaways
- In , read the row index before the column index.
- Add or subtract matrices only when their sizes agree.
- A scalar multiplies every entry, including negative entries.
- Identity, diagonal and triangular matrices are defined by the positions of their entries.
1.2 Matrix products and composition
Matrix multiplication combines whole rows and columns. It is designed so that one matrix can act on every column of another, or represent one linear transformation followed by another.
Check the inner sizes
If is and is , their product is . The inner sizes must match; the outer sizes give the answer's shape. Thus gives a matrix, while reversing those shapes gives . A matrix times another matrix is undefined.
If , then . Each output column uses one column of as weights for a combination of the columns of .
Compute one entry at a time
The row–column rule is
Move across row of and down column of . Multiply the matching pairs, then add. For
the top-left entry is . The entry in row 2, column 3 is . Applying the same rule gives
The reverse product is , a matrix. Its different size follows from reversing the original dimensions.
The first column is also . The entry calculation and the column calculation are two views of the same definition. Multiplying entries in the same positions would give a different operation.
Match the meanings as well as the sizes
Suppose a bakery uses the ingredient matrix
Rows mean flour and sugar in kilograms; columns mean bread and cake batches. Let
record batches, with bread and cake as rows and Monday and Tuesday as columns. The shared inner labels are bread then cake, so gives ingredient totals by day:
Monday's flour is kg. Each product combines kilograms per batch with a number of batches. If the batch categories were listed in different orders, the numerical multiplication would combine the wrong quantities.
Read composition from right to left
In , acts first. Take , a 90° counterclockwise rotation, and , a reflection in the horizontal axis. Then
Rotating then reflecting gives a reflection in ; reversing the actions gives a reflection in . Order changes the map. Identity multiplication preserves a matrix: for an matrix, . The identity on each side has the size needed for that product.
Key Takeaways
- For , the output size is .
- Each entry of is a row–column dot product.
- Each column of is times the corresponding column of .
- In , the right-hand matrix acts first.
- In data products, shared inner categories must agree in meaning and order.
1.3 Order, cancellation and powers
Matrices obey several familiar algebra rules, but multiplication has an order that cannot generally be changed. Keeping that order is the central habit in simplifying matrix expressions.
Regroup and distribute without reordering
Whenever the sizes allow the operations,
The first rule is associativity: it changes which product is computed first. It does not move a factor. The two distribution rules keep the factor on the side where it started. A scalar can move between factors: .
For example, set and . Direct multiplication gives
These products differ. Matrices commute when , but that is a property of particular matrices, not a general rule.
Zero products and cancellation
For numbers, a zero product forces a zero factor. Matrices can behave differently. With
every row–column dot product in is zero, although neither matrix is zero. The columns of are nonzero vectors that sends to zero.
This also explains failed cancellation. A nonzero matrix may send two different inputs to the same output. From , we get ; without more information, may be nonzero. If has an inverse, multiplication on the left by does give .
Multiply to find powers
For a square matrix, means copies of multiplied in order, and . The laws and hold for nonnegative integer exponents. The repeated factor has to be square so that is defined.
For , multiplication gives and . The upper-right entry grows by one with each multiplication by , so . Squaring each entry is not matrix squaring: .
Expand every product in its original order
Distributing twice gives
The middle terms combine to exactly when and commute. Also ; moving the middle factors to make needs a commutation rule.
Diagonal matrices of the same size do commute with each other. Their products and powers act separately on diagonal entries: . For a general matrix, left multiplication by a diagonal matrix scales rows, while right multiplication scales columns. The side determines which index receives the scale factor.
Key Takeaways
- Associativity changes grouping, not the order of factors.
- Distribute on the left or right while keeping every factor on its original side.
- A zero product can have nonzero matrix factors.
- Cancel an invertible factor by using its inverse on the correct side.
- means , not entrywise squaring.
- exactly when and commute.
1.4 Transposes and symmetry
The transpose turns rows into columns. It links the two ways of reading a matrix and helps explain symmetry, dot products and outer products.
Switch the two indices
If is , its transpose is and satisfies . For example,
The first row becomes the first column. Transposing a second time restores the original matrix: . Addition and scalar multiplication pass through a transpose entry by entry: and .
Reverse the order of a product
The product rule is
If is and is , then has size , just like . The unreversed order may not even be defined. Matching sizes checks that the formula is possible; the row–column rule establishes that its entries agree.
For and , first compute . Its transpose is , exactly . The same reversal works for longer products: .
Test symmetry across the diagonal
A symmetric matrix satisfies . It is square, and entries in reflected positions agree: . Thus is symmetric. Being square alone is insufficient: a square matrix can have different upper-right and lower-left entries.
For any real matrix, and are symmetric. Indeed,
Their sizes can differ. For , is , whereas is . Each has mirrored off-diagonal entries, but they are different matrices.
Distinguish two vector products
Treat and in as columns. Then has size and is their dot product. The outer product has size , with entry .
For and ,
Write the dimensions before multiplying if the transpose placement is hard to track. It decides whether the output is a number or a matrix. It also connects independence statements: the rows of are independent exactly when the columns of are independent.
Key Takeaways
- Transposing exchanges row and column indices.
- The transpose of a product reverses the order of its factors.
- A symmetric matrix is square and equals its transpose.
- and are symmetric, possibly of different sizes.
- is a number; is an outer-product matrix.
2Inverses and matrix equations
An inverse reverses a square matrix’s action and gives a direct way to describe the solution of a linear system. A small formula handles 2×2 matrices, while row reduction works in any size. Algebra with inverses also solves equations whose unknown is itself a matrix. Tracking the side of each multiplication connects these methods and explains why the row operations used to build an inverse must act on both augmented blocks.
2.1 What an inverse undoes
An inverse undoes multiplication by a square matrix. It turns an equation with a matrix coefficient into an explicit solution, provided that the matrix is invertible.
Define an inverse by its products
An matrix is invertible if some satisfies and . We write . An invertible matrix is also called nonsingular; a square matrix with no inverse is singular. A rectangular matrix cannot have an inverse that works on both sides.
The inverse is unique. If and both undo , then
Associativity lets the adjacent inverse pair simplify without changing factor order. The notation names this unique matrix; it does not mean take the reciprocal of every entry.
Invert a 2×2 matrix
For , calculate . This number is the determinant of a matrix. If it is nonzero,
Swap the diagonal entries, change the signs of the off-diagonal entries, then scale the whole matrix by . For , the denominator is , so
Checking the product gives . For , the denominator is , giving . The scale factor applies to every entry.
If , there is no inverse. For , the second column is twice the first. The nonzero vector maps to zero. That loss of information prevents an inverse from recovering every input.
Solve a system with the inverse
For invertible , multiply on the left by to get . This works for every and gives exactly one solution. Substitution verifies existence: . Any solution must equal after the same multiplication, proving uniqueness.
For the first matrix above, solve and :
The original equations give and . Checking in the original system catches both inversion and multiplication errors.
Keep the side explicit
There is no general matrix division operation. Write or to show which multiplication you mean. Entrywise reciprocals do not undo the mixing of coordinates performed by a matrix. For large numerical systems, elimination or LU solves the system with less work than explicitly constructing the entire inverse; the inverse formula remains useful for small calculations and algebraic reasoning.
Key Takeaways
- An inverse undoes its square matrix on both sides and is unique.
- A matrix is invertible exactly when .
- In the inverse formula, swap the diagonal, negate the off-diagonal and scale every entry.
- For invertible , has the unique solution .
- Check a proposed inverse by multiplying to obtain the identity.
2.2 Equations with matrix factors
Solving matrix equations means multiplying by inverses on chosen sides. The familiar idea of undoing an operation still works, but the side and the order must stay visible.
Undo a product in reverse order
For invertible square matrices,
To check the formula, multiply: . The inverse next to cancels it first, leaving the pair involving . The pattern extends to .
For and , . Its inverse is , which equals . The unreversed product is and does not undo .
Other useful rules are
For a positive integer , . The scalar rule needs a nonzero scalar because scaling an entire matrix to zero destroys invertibility.
Isolate the unknown on its own side
| Equation | Operation | Result |
|---|---|---|
| Multiply on the left by | ||
| Multiply on the right by | ||
| Multiply on the left by and right by |
Each operation is applied to both sides of the equation. A factor cancels only when its inverse is adjacent in the product after valid regrouping.
Using the same and , has solution . But has solution . Those are different equations, even though they use the same two known matrices.
Collect a repeated unknown
For , bring the terms with together:
The identity appears because . If is invertible, the solution is . A scalar cannot replace the identity in the expression . For a repeated unknown on the other side, factor on that side: .
Recognize what inverses do not distribute over
An inverse of a sum is not generally a sum of inverses. Take : then , but . Also, two invertible matrices can have a singular sum: .
Invertibility does behave well under products: products of invertible matrices are invertible. For square factors of the same size, invertibility of also forces both factors to be invertible. This supports cancellation when the factor being removed has a verified inverse.
Key Takeaways
- The inverse of a product reverses the factor order.
- Multiply on the left to undo a left factor and on the right to undo a right factor.
- gives when the outside factors are invertible.
- Factor as .
- Inversion does not distribute over addition.
- Transposing an inverse gives the inverse of the transpose.
2.3 The inverse recorded by row operations
Row reduction can find an inverse of any size. Elementary matrices explain why the operations applied beside a matrix record exactly the inverse being built.
Turn one row operation into a matrix
An elementary matrix is obtained by applying one row operation to an identity matrix. The operation may replace a row by itself plus a multiple of another row, interchange two rows, or scale a row by a nonzero number.
For example,
comes from applied to . Multiplying any matrix with three rows on the left by performs that same row replacement. The inverse of adds back to row 3. A swap undoes itself; scaling by is undone by scaling by . Every elementary matrix is therefore invertible. Multiplication on the right acts on columns instead, so the side matters.
Reduce both blocks together
Start with and apply each row operation to the entire augmented row. If the left side becomes , the right side is :
If the left block has fewer than pivots for an matrix, it cannot become , and is singular. A zero row in the left block after elimination is evidence of this, even if the corresponding right-block row is nonzero.
Follow a 3×3 example
Take . Begin with
- Apply . Row 2 becomes .
- Apply using the new row 2. Row 3 becomes .
- Apply . Row 2 becomes .
- Apply . Row 1 becomes .
The left side is now the identity, so
Stopping after forward elimination would leave entries above pivots and would not yet produce the inverse. Multiplication checks the result; for example, row 1 of dotted with column 1 of this answer is , and with column 2 it is .
Explain the recorded operations
If the row operations correspond in order to , their combined effect is . Thus the combined matrix is . Applying it to the identity produces the right block. Reversing the operations gives , so an invertible matrix is a product of elementary matrices.
The same procedure handles several right-hand sides: solves . Each column of is a separate system with the same coefficient matrix. For a singular example, eliminating in produces rows twice, then a zero row; only two pivots remain, so no inverse exists.
Read the inverse column by column
The identity block is , where has a one in position and zeros elsewhere. Its first column asks for the solution of , its second asks for , and so on. Those solutions become the columns of . In the worked example, the first inverse column is . Multiplying by gives . This explains why an inverse calculation can solve all the identity right-hand sides in one reduction: they share exactly the same operations on the coefficient matrix.
Key Takeaways
- An elementary matrix performs one row operation through left multiplication.
- Every elementary matrix is invertible by reversing its row operation.
- Apply each operation to both blocks of .
- Read the inverse only when the left block is exactly .
- Fewer than left-block pivots means a square matrix is singular.
- The same reduction with several right-hand sides solves .
3Equivalent tests for invertibility
Invertibility can be recognized through equations, columns, pivots or transformations. These views are connected by one theorem for square matrices, allowing a quick observation to replace a long inverse calculation. Following the links between the conditions also gives short proofs about products and one-sided inverses. Geometric examples show what an invertible map preserves and what goes wrong when different inputs collapse to one output.
3.1 Equivalent tests for square matrices
Many questions about a square matrix have the same answer. The Invertible Matrix Theorem connects them, so one well-chosen check can settle several properties at once.
State the equivalent conditions
For an matrix , all the following statements are equivalent:
- is invertible.
- is row equivalent to and has pivot positions.
- has only the trivial solution.
- The columns of are linearly independent.
- The map is one-to-one.
- has a solution for every .
- The columns of span .
- The map is onto .
- There is an matrix with .
- There is an matrix with .
- is invertible.
Here equivalent means all are true or all are false for the particular square matrix. You may prove the easiest condition instead of calculating an inverse.
Use pivots to connect the statements
In a square matrix, pivots give a pivot in every column and every row. Every column having a pivot removes free variables, so the homogeneous system has only the zero solution and the columns are independent. Every row having a pivot makes consistent for every right-hand side, so the columns span the output space.
A left inverse also forces the homogeneous condition: if and , then . A right inverse gives a solution for every right-hand side: if , then solves . These are links between tests, not separate algorithms to run on every matrix.
Choose an efficient test
For , the replacements and leave lower rows and . Then gives . There are three pivots. We now know that is invertible, its columns are independent and span , and every right-hand side has a unique solution.
Inspection can be faster. In , column 3 is column 1 plus column 2. The nonzero vector therefore solves the homogeneous equation, and the matrix is singular. A zero column, repeated columns or a zero row can also settle singularity immediately.
An upper or lower triangular square matrix is invertible exactly when every diagonal entry is nonzero. With all diagonal entries nonzero, they supply the full set of pivots.
Check the square hypothesis
For a matrix, independent columns need not span . The matrix gives a one-to-one map whose outputs all have third coordinate zero. Conversely, a matrix may span its output space while having dependent columns. The square shape is what lets the row and column pivot requirements become equivalent.
Key Takeaways
- For a square matrix, every condition in the Invertible Matrix Theorem has the same truth value.
- Full pivot coverage links independence, spanning, unique solvability and invertibility.
- Choose an easy test such as a visible column dependence or a triangular diagonal.
- The full theorem requires a square matrix.
3.2 Reversible transformations and one-sided inverses
An invertible transformation loses no input information and can reach every output. Its inverse is a linear transformation represented by the inverse of its standard matrix.
Undo a map in both directions
For , an inverse satisfies and for every vector. If , then is invertible exactly when is invertible, and .
A 90° counterclockwise rotation has matrix . A 90° clockwise rotation, with matrix , undoes it. A horizontal shear adds three times the second coordinate to the first; subtracts it again. Reflection in swaps coordinates and is its own inverse.
Identify information loss
Projection onto the horizontal axis has matrix . Both and become . An inverse could not know which input to return. Points off the axis are also unreachable. The map is neither one-to-one nor onto, and its matrix is singular.
For maps from to the same , one-to-one, onto and invertible are equivalent. For different input and output dimensions, they can separate. The map is one-to-one from to , but is not onto .
Use a one-sided inverse for square matrices
If and are both and , then as well. For any , . Thus reaches every output, so the Invertible Matrix Theorem makes it invertible. Multiplying on the left by gives . One product check is therefore sufficient for a proposed inverse of a square matrix.
The same shortcut fails for rectangular matrices. Let and . Then , but , not . The rectangular maps undo one composition without undoing the other.
Build a short argument about products
Suppose square matrices have invertible product . If , then . Invertibility of the product forces . The homogeneous condition in the theorem makes invertible. Now is a product of invertible matrices and is invertible too.
This proof uses the homogeneous equation because the implication is easy to follow. A transformation question may instead be easiest through one-to-one or onto behavior. Start with the property the available evidence directly supports, then use the theorem to obtain the rest.
Key Takeaways
- The inverse transformation has standard matrix .
- For a map from to itself, one-to-one and onto each imply invertibility.
- A projection loses input information and cannot be inverted.
- For square matrices, one inverse product equal to is enough.
- An invertible square product has invertible square factors.
4Computing with blocks
Partitioning a matrix lets a large calculation be organized around smaller pieces. The same row–column rule still applies, but the shapes and order of the blocks need care. Zero and identity blocks can save work, while inverse blocks can be found by solving equations. Moving from individual pivots to block pivots leads to the Schur complement, which records what remains after eliminating a whole block of entries.
4.1 Products arranged in blocks
A large matrix can be divided into smaller matrices called blocks. The entries stay where they were; the partition simply lets us organize the calculation around useful pieces such as identity and zero blocks.
Partition and check block sizes
Take
Split after row 2 and column 2. Then , , and . The top blocks have two rows; the bottom blocks have one. Blocks in a partition need not all be square or the same size.
Add and scale block by block when the overall sizes and partitions match. To multiply, the column widths of the left matrix must match the row heights of the right matrix. Then the ordinary row–column rule applies to blocks:
Keep the left matrix's block on the left of each product. Blocks are matrices and generally do not commute.
Multiply using the partition
Let and split it into the two blocks and . Their heights match the column widths in .
The top block of the product is
The bottom block is . Therefore . The identity and zero blocks remove some arithmetic without changing the multiplication rule.
Expand as column-times-row terms
Another partition treats as columns and as rows . It gives
Each term is an outer product. For example,
Each term uses one column from the left factor and the matching row from the right factor. Their sum collects every contribution to every output entry.
Transpose both levels
The block transpose is
The block positions exchange across the diagonal, and the entries inside each block exchange too. Merely moving the blocks leaves their internal shapes wrong. Block calculations help organize large computations and exploit structure; choosing one-column blocks in the right factor recovers .
Key Takeaways
- Block multiplication needs matching inner partitions.
- Use the row–column rule with blocks while preserving factor order.
- Zero and identity blocks can simplify the arithmetic.
- A column–row expansion sums outer products of matching columns and rows.
- Transpose each block as well as its position.
4.2 Inverse blocks and the Schur complement
A block inverse depends on the arrangement of the blocks. Diagonal structure lets separate inverses stay separate; an off-diagonal block creates an extra correction term.
Invert independent diagonal blocks
For square blocks and ,
exactly when both diagonal blocks are invertible. Multiplication produces and on the diagonal, with zeros elsewhere. For blocks and , use and .
Find the corner of a triangular inverse
If with square invertible diagonal blocks, then
To derive the corner, write the inverse as and impose . The bottom row gives and , so and . The top-left equation gives . The remaining equation is ; multiply on the left by to get . This keeps the product order required by the equation.
For , and ,
First . Multiplying by and negating gives the corner . The full inverse places these three computed blocks in their corresponding positions, with a zero bottom-left block.
Eliminate a nonzero lower-left block
For with invertible, subtract times the first block row from the second. In matrix form,
The new lower-right block is the Schur complement of . The lower-left block vanishes because . The block operation is reversible: change its minus sign to a plus sign. Consequently is invertible exactly when is invertible, with the invertibility of already assumed.
For scalar blocks , , and , the complement is , so the full matrix is invertible. Do not invert every block of a general full block matrix separately. The blocks interact through products, and the triangular inverse formula requires square diagonal blocks and their inverses.
Verify the full inverse by blocks
In the worked triangular example, assemble the result as
Checking the corner can be much shorter than checking all sixteen entries separately. The product's upper-right block is . Here and , so their sum is zero. The two diagonal blocks multiply to identities and the lower-left block stays zero. These four block equations verify the whole inverse.
A nonzero solution of shows directly how invertibility can fail. Set and combine the two blocks into the column . Its top output block is ; its bottom output block is . Because , the combined input is nonzero. The full square matrix therefore has a nontrivial homogeneous solution and is singular, just as the Schur test predicts.
Key Takeaways
- Invert a block-diagonal matrix by inverting its square diagonal blocks.
- The upper-right inverse block is for .
- Derive inverse blocks from the equations obtained by multiplying to get .
- With invertible, the Schur complement is .
- Block elimination is reversible and reduces the invertibility test to the remaining diagonal block.
- General block inversion is not entrywise block inversion.
5Elimination saved as triangular factors
Elimination can be saved as triangular factors and reused whenever a system’s right-hand side changes. The lower factor records elimination multipliers, and the upper factor holds the reduced equations. Two substitution passes then recover a solution. Permutation matrices account for row exchanges, including those chosen to improve numerical behavior, and a diagonal factor separates the pivots when an LDU form is useful.
5.1 Two triangular systems for one solution
An LU factorization separates a matrix into two triangular factors. Once those factors are known, each new system with the same coefficient matrix needs only two substitution passes.
Interpret the factors
In , is unit lower triangular: its diagonal entries are one and its entries above the diagonal are zero. For an matrix, has size and has size and is an echelon form of . For a square matrix, is upper triangular.
To solve , set . Then solve
The lower system uses forward substitution, starting at the top row. The upper system uses back substitution, starting at the bottom. The intermediate vector is the right-hand side of the second solve.
Work through both passes
Let
Forward substitution gives:
- .
- , so .
- , so .
Now solve upward through :
- gives .
- gives .
- gives .
Thus . The original matrix is . Multiplying it by the answer gives . Solving directly would skip the effect of and solve a different system.
Reuse the expensive work
The elimination that constructs depends on alone. A new right-hand side changes the two substitution passes, not the factors. This is useful when one structure is analyzed under several loads or one model is solved for several input vectors.
A flop counts one addition, subtraction, multiplication or division. For dense matrices, factorization takes about flops, while forward and back substitution together take about . At , these are about once and per right-hand side. Forming the inverse takes about flops, and multiplying that inverse by each new vector still costs about .
For sparse matrices, many entries are zero. Their factors often retain useful sparsity, whereas the inverse is usually full. Factor-based solves can therefore save storage as well as arithmetic.
Notice a failed diagonal solve
A square triangular matrix is invertible exactly when all diagonal entries are nonzero. A zero diagonal in square means that is singular. The triangular systems may then have no solution or free variables, depending on the right-hand side; do not divide by zero in a substitution formula.
Key Takeaways
- An LU factorization separates elimination from solving for a right-hand side.
- Solve forward, then backward.
- Reuse the same factors when only changes.
- Dense factorization costs about flops; two triangular solves cost about .
- A zero diagonal entry in square means is singular.
5.2 Multipliers and diagonal pivots
Elimination builds the upper factor directly. The lower factor records the multipliers needed to undo those row replacements, so it can be assembled during the same computation.
Store each elimination multiplier
When no row exchanges are needed, use row replacements of the form
with a pivot row above the row being changed. The multiplier is the entry being removed divided by the pivot. Put in position of , put ones on its diagonal, and zeros above it. The final echelon matrix is .
For
the first pivot is . Use and . The operations give
The second pivot is now . Use to obtain . Hence
To check , its third row is minus row 1 of plus row 2 plus row 3: .
Keep the sign convention straight
The factor stores the multiplier being subtracted. The operation means , so its stored multiplier is . Copying the coefficient of an addition description gives the opposite sign. At each stage, dividing the pivot column from the pivot downward by that pivot gives the next column of , beginning with its diagonal one.
If records the elimination, then . That product of inverse replacement matrices is . Their triangular structure and order explain why the recorded multipliers rebuild the original matrix.
Separate the pivots into a diagonal factor
For invertible square , put the nonzero pivots of in and divide each row of by its pivot. The resulting is unit upper triangular, and .
In the example,
Here is symmetric and , giving . A singular matrix can have a zero diagonal in , so row normalization by those entries may fail.
Decide whether exchanges are needed
For invertible square matrices, elimination without exchanges succeeds exactly when every upper-left submatrix is invertible. In that case the unit-lower LU factorization is unique. But is invertible and has no such LU: would force the entry to be zero, although the original entry is one. A row exchange resolves this obstacle through a permutation factor.
Check each reconstructed row
For the worked factors, row 2 of is . This calculation uses the second row of as weights on the rows of . A negative entry in simply gives a negative row weight; it is not a second instruction to reverse a sign.
The leading-submatrix condition also explains why invertibility of the whole matrix is insufficient for no-swap LU. Eliminating within the first rows and columns must supply its first nonzero pivots without borrowing a row from below that block. Its triangular form has those pivots on the diagonal. A singular leading block prevents that sequence, even if a later row can provide the missing pivot after an exchange. Test the early pivot positions before committing to a no-exchange factorization.
Key Takeaways
- records the multiplier in .
- Build by elimination and check .
- The diagonal of is one; its entries above the diagonal are zero.
- LDU separates the nonzero pivots from into a diagonal matrix.
- For symmetric invertible with this factorization, .
- An invertible matrix can still need row exchanges before LU.
5.3 Row permutations in an LU solve
A zero in a needed pivot position can be a problem with the row order. A permutation matrix records row exchanges and lets the triangular-factor method continue.
Represent a row order
A permutation matrix is an identity matrix with its rows reordered. It has one one in every row and column and zeros elsewhere. Left multiplication by reorders a matrix's rows in the same way. There are such matrices of size .
Permutation matrices satisfy , since . A single row swap is its own inverse, but a general permutation need not be. With exchanges included, write
Every square matrix has a factorization with a permutation, unit lower triangular and upper triangular . A singular matrix's upper factor has a zero diagonal; factorization alone does not guarantee a unique solution.
Handle a later row exchange
Let . The operations and leave rows and . The second pivot position is zero, so exchange these rows. This is recorded by
The resulting factorization is
The first-column multipliers in are now then . When a swap occurs partway through elimination, swap the already stored multiplier entries in those rows as well. Future columns are still filled as elimination proceeds. Multiplication verifies that gives the reordered rows .
Permute the right-hand side too
Multiplying by gives . Solve forward, then backward.
For in the example, . Forward substitution gives , and . Back substitution gives , and . The original matrix times is . Leaving in its original order would pair equations with the wrong constants.
Choose a useful numerical pivot
Software usually exchanges rows even before encountering an exact zero. At step , partial pivoting chooses an entry of largest absolute value in column among rows through and moves its row into the pivot position. The resulting elimination multipliers have absolute value at most one.
For a candidate pivot with below it, proceeding without a swap gives multiplier . Swapping selects as the pivot and reduces the multiplier to . Large multipliers can magnify rounding errors; partial pivoting avoids this particular source of large intermediate values. The permutation remains part of the factorization and must be used in every solve.
Undo a row order that is not a single swap
Consider . It sends the rows into the order 2, 3, 1, so . Applying this same permutation a second time gives , which has not restored the original order. Instead, selects rows 3, 1, 2 and reverses the original cycle. Thus .
This distinction matters when a library returns several exchanges combined into one permutation. In , apply to the constants to solve the reordered equations; use when reconstructing the original matrix from the factors. A single swap hides the distinction because its matrix happens to equal its transpose.
Key Takeaways
- Left multiplication by reorders rows, and .
- Use and reconstruct .
- Solve with as the first right-hand side.
- Swap previously stored multipliers when elimination exchanges rows later.
- Partial pivoting selects the largest absolute candidate in the current column at or below the pivot row.
- Factorization with a permutation does not by itself guarantee invertibility.
Matrix Algebra examples
1Compute while keeping shapes and order visible
18 steps
- 1IntroductionStart with what the array means
A matrix is both an array of entries and a rule for combining coordinates. To calculate with it, track its shape before using its numbers.
We will build a product from individual dot products, interpret its factor order, and then use the same attention to order for powers and transposes.
- 2ExplanationRead the row before the column
In , the size is : two rows, three columns.
The entry sits in row 2, column 3. The second column is , a vector in . A column has one entry per row, so the number of rows determines the space containing the columns.
- 3ExampleScale before subtracting
Let . For the same , compute by scaling every entry of and subtracting matching positions:
The entry in row 2, column 1 is . Keeping the negative entry in parentheses protects the subtraction sign.
- 4ChallengeCan these arrays be combined?
A matrix has size and has size . Is defined? What about ?
---reveal---
The sum is undefined because corresponding row and column positions do not match. Having six entries each is insufficient. The scalar multiple is defined and remains because each entry is doubled without changing its position.
- 5ExplanationPredict the product shape
For of size and of size , the inner dimensions agree, so has size .
Each column of has two entries. It can therefore weight the two columns of . The result has three entries, and there is one output column for each column of . This explains both the inner-size check and the output size.
- 6ExampleBuild the first output column
Use and .
The first column of is , so the first output column is . Entry by entry, the top entry is and the bottom entry is .
The middle entry uses row 2: . This is the same middle coordinate obtained from the weighted columns.
- 7ExampleFinish the second column
The second column of is . Use those weights on the columns of :
Put the two output columns in the same order as the columns of :
Each output entry includes a sum of products. Multiplying entries in matching array positions would miss those sums.
For this column, the three row calculations are , , and . Negative weights subtract an entire column.
- 8ConnectionThe right factor acts first
Suppose shears a point and reflects the result. The output is .
To find the order, begin at the vector and work outward. The factor touching acts first. For a data product, the same shared dimension connects the categories being combined: columns of the left factor must match rows of the right factor in both meaning and order.
- 9ChallengeMultiply in a new shape
Let and . Find .
---reveal---
The product has size . Its first entry is ; its second is . Thus . The second entry uses the second column of , not its second row.
- 10Key InsightRegrouping keeps the sequence
Associativity gives . It lets us choose which adjacent pair to calculate first, but the factors remain in the order .
Distribution also preserves position: . A factor on the right stays on the right in both terms. Swapping factors requires evidence that they commute; matching square sizes alone is not enough.
- 11ExampleA matrix square mixes entries
For , calculate :
The upper-right entry is . Repeated multiplication gives for nonnegative integers. A power repeats the transformation; it does not raise each entry separately.
- 12ChallengeKeep both mixed products
For square matrices , expand without assuming that they commute. When can the mixed terms be combined?
---reveal---
The expansion is . The middle terms equal exactly when . Associativity cannot switch into ; it only changes parentheses around factors already in order.
- 13TipCheck the factor before canceling
A nonzero matrix can send a nonzero vector to zero. Thus may hold with , and cancellation from can fail.
If is invertible, left multiply by . The adjacent pair simplifies to and gives . The useful condition is an inverse, not merely a nonzero entry somewhere in .
- 14ExplanationTranspose rows into columns
For ,
The size changes from to . A second transpose restores . For a product, the rule is : transpose the factors and reverse their order. With rectangular factors, the unreversed product may not even have matching inner dimensions.
Here moves to : the old row number becomes the new column number, and the old column number becomes the new row number.
- 15Key InsightSymmetry has a product test
A matrix is symmetric when . Entries mirror across the main diagonal, so a symmetric matrix must be square.
Every real matrix gives symmetric products and . Indeed, . If is , these products are and . Symmetry does not make them equal.
- 16ChallengeA number or a matrix?
Let and be columns. Find and .
---reveal---
The dot product is , a scalar. The outer product is , a matrix. Moving the transpose changes the shapes of the factors and the type of output.
- 17ChallengeCombine size and transpose rules
If is and is , express as a product of transposes and give its size.
---reveal---
It is , with size . This matches the transpose of the product . The order would have inner dimensions 4 and 3, so it is undefined.
- 18RecapUse shape, position and order
For sums, align corresponding positions. For products, match inner dimensions and use row–column dot products. Powers repeat multiplication, and a transpose reverses the order of factors.
These checks answer different questions: shape tells you whether an operation exists, while the entry rule tells you its value. When simplifying, keep each factor in place unless a specific commutation or inverse rule permits the next step.
2Build and use an inverse
15 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionUndo an action with a matrix
- 2ExplanationUse the two-sided identity
- 3ExampleApply the 2×2 formula
- 4ExampleUse the inverse to solve
- 5ChallengeCan this action be undone?
- 6ExplanationChoose the side that cancels
- 7Key InsightUndo the latest action first
- 8ChallengeCollect the unknown correctly
- 9TipDo not distribute an inverse over a sum
- 10ExplanationRecord operations beside the matrix
- 11ExampleEliminate below the first pivot
- 12ExampleClear above the second pivot
- 13ChallengeDiagnose an unfinished inverse
- 14ChallengeA missing pivot changes the conclusion
- 15RecapRead the result only after the check
3Decide invertibility without computing an inverse
10 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionUse the evidence you already have
- 2ExplanationPivots connect rows and columns
- 3ExampleSee dependence without reducing
- 4ChallengeRead an upper triangular matrix
- 5Key InsightRectangular shapes separate the tests
- 6ExampleA shear keeps recoverable information
- 7ExplanationOne identity product settles the square case
- 8ChallengeTest the rectangular shortcut
- 9ChallengeReason backward from a product
- 10RecapChoose a short route through the theorem
4Calculate with blocks
11 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionTreat a block as a small matrix
- 2ExplanationMatch the internal boundaries
- 3ExampleUse an identity block
- 4ConnectionOne shared index gives one outer product
- 5ChallengeTranspose the whole partition
- 6ExplanationStart with independent diagonal blocks
- 7ExampleDerive the corner equation
- 8ChallengeCompute a scalar-block inverse
- 9ExplanationEliminate an entire block
- 10ChallengeUse elimination to test invertibility
- 11RecapLet the block equation set the order
5Factor once and solve with LU
17 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionSave what elimination does
- 2ExplanationSolve the lower system first
- 3ExampleForward substitution builds y
- 4ExampleBack substitution recovers x
- 5ChallengeIdentify the skipped solve
- 6Key InsightReuse the preparation
- 7ExplanationStore what is subtracted
- 8ExampleEliminate the first column
- 9ExampleFinish and reconstruct
- 10ChallengeCatch a multiplier sign error
- 11ConnectionPull out the diagonal pivots
- 12ExplanationA row order can remove a zero pivot
- 13ExampleMove the constants with their equations
- 14TipKeep earlier multipliers with the row
- 15ChallengeSelect a partial-pivoting row
- 16ChallengePut the full solve in order
- 17RecapFactors preserve elimination and row order
Matrix Algebra practice questions
Set 1: Choosing inverse rules and keeping row order10 Practice Questions
Question 1 of 10
Show answerHide answer
Question 2 of 10
Show answerHide answer
Question 3 of 10
Show answerHide answer
Question 4 of 10
Show answerHide answer
Question 5 of 10
Show answerHide answer
Question 6 of 10
Show answerHide answer
Question 7 of 10
Show answerHide answer
Question 8 of 10
Show answerHide answer
Question 9 of 10
Show answerHide answer
Question 10 of 10
Show answerHide answer
Set 2: Shapes, products and the first inverse checks10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 3: Compositions, reductions and reusable factors10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 4: Combining algebra, block structure and pivoting10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Set 5: Proofs, parameters and linked computations10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Stuck on your own question? Homework Help
Key Terms
A
Associativity
Augmented matrix
B
Back substitution
Block elimination
Block matrix
Block transpose
Block upper triangular matrix
Block-diagonal matrix
C
Cancellation
Column view of multiplication
Column–row expansion
Commuting matrices
Compatible block partitions
Composition
D
Diagonal matrix
Distributivity
Dot product
E
Elementary matrix
Elimination multiplier
Equivalent conditions
F
Flop
Forward substitution
I
Identity matrix
Inverse matrix
Inverse product rule
Invertible matrix
Invertible Matrix Theorem
Invertible transformation
L
LDLᵀ factorization
LDU factorization
Leading square submatrix
Left multiplication
Lower triangular matrix
LU factorization
M
Main diagonal
Matrix entry
Matrix equation
Matrix power
Matrix product
Matrix size
N
Negative matrix power
Nonsingular matrix
O
One-sided inverse
One-to-one transformation
Onto transformation
Outer product
P
Partial pivoting
Permutation matrix
Pivot position
Pivoted LU factorization
R
Row equivalence
Row interchange
Row replacement
Row scaling
Row–column rule
S
Scalar multiple
Schur complement
Singular matrix
Spanning columns
Sparse matrix
Square matrix
Symmetric matrix
T
Transpose
Trivial solution
U
Unit triangular matrix
Upper triangular matrix
Z
Zero matrix
Zero product
#
2×2 determinant
About this lesson
Make your own Study Materials
Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.