Contents / Precalculus / Systems & Matrices
Chapter 6
Systems & Matrices
Linear systems, matrix arithmetic, determinants, inverses, and Gaussian elimination.
Introduction
Linear systems, matrix arithmetic, determinants, inverses, and Gaussian elimination.
6.1System of linear equations
Systems of linear equations arise everywhere: balancing chemical reactions, finding the intersection of lines/planes, optimizing with constraints, and describing steady states in networks.
Systems of Linear Equations
Definition 6.1 (Linear system and its solutions). A linear equation is one where each variable appears only to the first power (no , no , no ). A system of linear equations (or linear system) is a collection of such equations, each of the form
A solution is an assignment of values to the variables that satisfies every equation simultaneously — not just one of them.
Geometrically a linear equation describes a flat object: a line in 2D, a plane in 3D. That picture is what makes the following trichotomy believable — flats either meet in a flat, or miss each other entirely.
Theorem 6.2 (Three outcomes). A system of linear equations has exactly one of three outcomes: exactly one solution, infinitely many solutions, or no solution.
- Exactly one solution — the equations are independent and pin down every variable (full rank).
- Infinitely many solutions — some equations are redundant, leaving free variables that can slide along a line or plane of solutions (dependent equations).
- No solution — the equations contradict each other (inconsistent), e.g. two parallel lines that never meet.
A system with at least one solution is called consistent; one with no solution is inconsistent. Geometrically in 2D, two equations are two lines: they either cross at one point (one solution), coincide (infinitely many), or run parallel (none).
Intuition. Each equation is a straight-line rule ("twice the apples plus three oranges cost 10 dollars"). A solution is a shopping list — a number of apples and a number of oranges — that obeys every rule at once. If two rules flatly contradict each other ("2 apples cost 4" and "2 apples cost 9"), no shopping list works: that is an inconsistent system.
Example 6.3 (Solve the system by substitution, then verify.).
Solution. Solve the first equation for : . Substitute into the second: , so , i.e. . Isolate : , so . Back-substitute: . Sanity check in both originals: ✓ and ✓.
The unique solution is . Because we found one consistent answer and the two lines have different slopes, this is the only solution.□
Common Mistakes
- Inconsistent system detection: A row with means no solution; do not continue as if it were zero.
- Free variables and parametrization: When rank < number of variables, students forget to assign parameters to free variables and express the basic variables in terms of them.
- Augmented matrix column: Forgetting to include the constants when setting up the augmented matrix for elimination.
- Assuming unique solution always: Many systems have none or infinitely many; check the rank or row reduce fully before claiming uniqueness.
- Substitution vs elimination: Both work; elimination is often better for larger systems or when coefficients line up.
- Not verifying the solution: Plug back into all original equations, not just the one you solved last.
6.2Matrix (mathematics)
Matrices are rectangular arrays that compactly represent linear systems, transformations, and data tables.
Introduction to Matrices
Definition 6.4 (Matrix). A matrix is a rectangular array of numbers. An matrix has rows and columns — rows are counted first, columns second. The entry in row , column is written .
Matrices show up in three main roles:
- Coefficients of linear systems — stack the coefficients row by row. The augmented matrix appends one extra column holding the constants (right-hand sides).
- Linear transformations — the columns are the images of the basis vectors, so the matrix tells you where the transformation sends every point.
- Data tables — rows are samples, columns are features.
Definition 6.5 (Special matrices). A square matrix has ; the identity has s on the main diagonal and s elsewhere; the zero matrix has every entry ; a diagonal matrix is zero off the main diagonal; a matrix is symmetric if it equals its transpose; triangular matrices are zero either below (upper) or above (lower) the diagonal.
The identity and diagonal matrices are only defined for square shapes.
Intuition. A matrix is just a tidy table of numbers. When the table comes from a system of equations, each row is one equation and each column collects the coefficients of one variable, with a final column holding the answers on the right-hand side.
Example 6.6 (Write the augmented matrix for the system.).
Solution. Line up the variables in the same order (, then , then ) in every equation. Note the third equation has no term, so its -coefficient is . Read the coefficients into rows and put the constants after the bar:
Sanity check: the matrix is — three equations (rows) and three variables plus one constant column, exactly as expected.□
Common Mistakes
- Matrix multiplication order and dimensions: Always check that the inner dimensions match before multiplying; the result's size is the outer dimensions.
- Augmented matrix column: Forgetting to include the constants when setting up the augmented matrix for elimination.
- Confusing row and column vectors: A is a row vector; an is a column vector.
- Assuming all matrices are square: Many useful ones are not (data tables, transformations between spaces of different dimension).
- Identity only for square: is square by definition.
- Zero matrix multiplication: , but may be undefined if the dimensions do not match.
6.3Determinant
The determinant is a single number computed from a square matrix that tells you the volume scaling factor, whether the transformation flips orientation, and whether the matrix is invertible.
Determinants
Definition 6.7 (Determinant). The determinant (also written ) is defined only for a square matrix. For a matrix,
Intuitively, the determinant is the signed factor by which the matrix scales area (in 2D) or volume (in 3D): a determinant of triples areas, and a negative sign means the transformation flips orientation (like a mirror).
Proposition 6.8 (Cofactor expansion). For a matrix, expand along any row (or column) using cofactors. Expanding along the first row,
where the minor is the determinant of the matrix left after deleting row and column .
The factor produces the checkerboard sign pattern .
Proposition 6.9 (Properties of the determinant). For square matrices of matching size,
where is the size of the matrix in the third identity.
Theorem 6.10 (Invertibility criterion). A square matrix is invertible if and only if .
Intuition. The determinant tells you "how much the matrix stretches or squishes space," and whether it flips it. A determinant of zero means the transformation collapses everything onto a lower-dimensional flat (a line or a point) — like squashing a full sheet of paper down to a single crease, so it has no area left and cannot be un-squashed. That is exactly why means "no inverse."
Example 6.11 (Compute by cofactor expansion along the first row.). Expand along the first row, then say whether the matrix is invertible.
Solution. The first-row entries are , , . Because , that term will vanish, so we only need the first two minors. Minor (delete row 1, column 1): . Sign , so this contributes . Minor (delete row 1, column 2): . Sign , so this contributes . The third term is . Add them: . Since , this matrix is invertible by the invertibility criterion.□
Common Mistakes
- Determinant sign errors in expansion: The checkerboard pattern of for cofactors is easy to mess up on or larger.
- For swapping vs : It is always main diagonal minus anti-diagonal.
- Thinking means "no matrix": The matrix still exists; it is just singular (not invertible).
- Forgetting : The exponent is the matrix size, not .
- Computing for a non-square matrix: The determinant is only defined for square matrices.
- Row reduction changes the determinant: A row swap flips the sign, scaling a row by multiplies the determinant by , but adding a multiple of one row to another leaves it unchanged.
6.4Inverse matrix
The inverse matrix undoes the linear transformation represented by the original. It exists precisely when the determinant is nonzero.
Matrix Inverses
Definition 6.12 (Inverse matrix). The inverse of a square matrix is the matrix that satisfies
Not every square matrix has one: exists if and only if (such a matrix is called nonsingular or invertible). This is why checking the determinant first saves wasted effort.
Proposition 6.13 (Inverse of a matrix). If , then
In words: swap the diagonal entries, negate the off-diagonal entries, and divide by the determinant. For larger matrices, use Gauss–Jordan elimination (augment with the identity, then row-reduce until the left block becomes ; the right block is then ) or the adjugate formula (transpose of the cofactor matrix, divided by ).
Proposition 6.14 (Solving a system with the inverse). If and is invertible, then left-multiplying by gives
Intuition. The inverse is the "undo button" matrix. If rotates and stretches space, rotates and stretches it right back, so doing both in a row lands you exactly where you started (that is the identity ). It works just like dividing by a number undoes multiplying by it — and just as you cannot divide by , you cannot invert a matrix that squashes space flat ().
Example 6.15 (Find the inverse of and verify.). Determinant: . Since , the inverse exists. Apply the formula (swap the diagonal, negate the off-diagonal, divide by ): . Sanity check by multiplying:
Common Mistakes
- Inverse formula for : Forgetting the multiplier, or mishandling the diagonal swap and sign flips.
- Row operations on the wrong side: In Gauss–Jordan for the inverse, apply every row operation to the identity block on the right too.
- Assuming every square matrix has an inverse: Only those with do.
- The inverse of the inverse: .
- Inverse of a product: — the order reverses.
- Not checking first: You waste effort if the matrix turns out to be singular.
6.5Matrix multiplication
Matrix multiplication corresponds to composition of linear transformations. It is defined via row-by-column dot products and is not commutative.
Matrix Multiplication
Definition 6.16 (Matrix product). The product is defined only when the number of columns of equals the number of rows of (the "inner" dimensions match). If is and is , then is — the "outer" dimensions. Its entry is the dot product of row of with column of : multiply matching entries and add them up,
Proposition 6.17 (Associative, not commutative). Matrix multiplication is associative, , but not commutative: in general , and one order may even be undefined. Multiplying by the identity changes nothing: .
All of this mirrors function composition — means "apply , then apply " — which is exactly why order matters.
Intuition. To multiply two tables, you go "row-by-column." Each entry in the answer is a weighted sum that pairs up one row from the first table with one column from the second, entry by entry, and adds. Because "do then " is a different journey from "do then , " swapping the order usually gives a different result — just like putting on socks then shoes is not the same as shoes then socks.
Example 6.18 (Compute the product .). Check dimensions: is and is ; inner dimensions match, so the product exists and is . Entry = row of dotted with column of : . Entry = row of dotted with column of : . Assemble the result:
Common Mistakes
- Matrix multiplication order and dimensions: Always check that the inner dimensions match before multiplying; the result's size is the outer dimensions.
- Assuming : Almost never true; order matters, exactly like function composition.
- Forgetting the dot-product definition: You do not just multiply corresponding entries; it is row of the first with column of the second.
- Multiplying when inner dims don't match: A times a is undefined.
- Confusing with the elementwise (Hadamard) product: is the matrix product, not entry-by-entry multiplication.
- Scalar vs matrix: is scalar multiplication, which differs from multiplying by only in notation, but neither is the same as an entrywise product.
6.6Gaussian elimination
Gaussian elimination (row reduction) is the systematic way to solve linear systems by operating on the augmented matrix until the answers are easy to read off.
Gaussian Elimination
Definition 6.19 (Elementary row operations). There are three elementary row operations on a matrix:
- Swap two rows.
- Multiply a row by a nonzero scalar.
- Add a multiple of one row to another row.
Proposition 6.20 (Row operations preserve the solution set). Each elementary row operation mirrors a legal move on the equations themselves, so they never change the solution set of the system.
That is the licence for the whole method: reduce the augmented matrix as far as you like, and the answers you read off at the end are the answers to the original system. In row echelon form each leading entry (pivot) sits to the right of the one above it and has zeros below it; in RREF each pivot is a with zeros both above and below.
Method 6.21 (Gaussian elimination).
- Write the augmented matrix of the system.
- Use elementary row operations to reach row echelon form (upper triangular), or continue to reduced row echelon form (RREF).
- Back-substitute: solve for the last variable from the bottom row and work upward.
Watch for two signals while reducing: a row with means the system is inconsistent (no solution), while a row of all zeros means an equation was redundant, leaving a free variable (infinitely many solutions).
Intuition. Gaussian elimination is systematic "equation bookkeeping": you scale and add whole equations (rows) to knock out one variable at a time, column by column, until the last equation has just one unknown. Then you climb back up, plugging in what you just learned — like solving a staircase from the bottom step up.
Example 6.22 (Solve the system by Gaussian elimination.).
Solution. Write the augmented matrix:
Clear the first column below the pivot. gives , and gives :
The solution is , , .
Sanity check in the original equations: ✓; ✓; ✓.□
Common Mistakes
- Row operations on the wrong side: In Gauss–Jordan for an inverse, you must apply the same operations to the identity block on the right.
- Free variables and parametrization: When rank < number of variables, students forget to assign parameters to free variables and express the basic variables in terms of them.
- Inconsistent system detection: A row with means no solution; do not continue as if it were zero.
- Forgetting that scaling a row scales the equation: Multiplying a row by divides that whole equation by — apply it to the constant too.
- Not using the pivot to clear above in RREF: For fully reduced form, eliminate upward as well as downward.
- Arithmetic slips in elimination: Double-check every row operation, especially the signs.