Solving Linear Systems with Matrices
Use row operations to reveal solutions and dependencies.
Linear algebra is the math of vectors and matrices. It lets you handle many equations, or many dimensions, all at the same time instead of one line at a time.
Solving Linear Systems with Matrices: the central idea
An augmented matrix stores a linear system so elimination can reveal consistency, free variables, and the geometry of its complete solution set.
Words you need
- Augmented matrix
- An augmented matrix is the grid holding a system's coefficients with the constants attached as one extra column after a vertical bar.
- Pivot
- A pivot is the first nonzero entry in a row once the matrix is in echelon form, and the variable in that column is controlled rather than free.
- Elementary row operation
- An elementary row operation is one of the three legal moves on a matrix, swapping two rows, multiplying a row by a nonzero number, or adding a multiple of one row to another, and none of them changes the solution set.
- Reduced row echelon form
- Reduced row echelon form is the tidiest version of a matrix, where every pivot is a 1 and is the only nonzero entry in its whole column, so the answer can be read straight off.
- Free variable
- A free variable is a variable whose column has no pivot, meaning you may pick any value for it and the pivot variables adjust to match.
- Consistent system
- A consistent system is one that has at least one solution, which happens exactly when no row of the reduced matrix claims that zero equals a nonzero number.
What to know before this lesson
Review systems of equations, elementary row operations, matrix dimensions, and pivot positions.
If one of those prerequisites is uncertain, use the Linear Algebra subject guide to locate the earlier concept before memorizing a procedure.
Linear systems: a worked example
Every step, with the arithmetic
- Step 1 - Write the system as an augmented matrixx + 2y - z = 3, 2x + y + z = 6, 3x - y + 2z = 5 becomes [1 2 -1 | 3 ; 2 1 1 | 6 ; 3 -1 2 | 5]
- Step 2 - Clear the x below the first pivotR2 - 2R1: 2-2 = 0, 1-4 = -3, 1-(-2) = 3, 6-6 = 0, giving [0 -3 3 | 0]
- Step 3 - Clear the x from the third row tooR3 - 3R1: 3-3 = 0, -1-6 = -7, 2-(-3) = 5, 5-9 = -4, giving [0 -7 5 | -4]
- Step 4 - Scale row 2 to make its pivot a 1R2 divided by -3: [0 1 -1 | 0], which is the equation y - z = 0
- Step 5 - Clear the y from row 3R3 + 7R2: -7+7 = 0, 5-7 = -2, -4+0 = -4, giving [0 0 -2 | -4]
- Step 6 - Read the bottom row and solve for z-2z = -4, so z = -4 / -2 = 2
- Step 7 - Back-substitute into row 2y - z = 0 becomes y - 2 = 0, so y = 2
- Step 8 - Back-substitute into row 1 and checkx + 2(2) - 2 = 3 gives x = 1; check row 3 of the original: 3(1) - 2 + 2(2) = 3 - 2 + 4 = 5, correct
A pivot in every variable column gives a unique solution only when no row says $0=\text{nonzero}$. Missing pivots create free variables in a consistent system.
Reading the answer straight off a row-reduced augmented matrix
| What the reduced matrix shows | What it is telling you | Number of solutions | How to write the answer |
|---|---|---|---|
| A row reads 0 0 0 | 5 | The equation says 0 = 5, which can never be true | None (inconsistent) | No solution; the solution set is empty |
| Every variable column has a pivot and no false row | Each variable is pinned to one number | Exactly one | A single point such as (x, y, z) = (1, 2, 2) |
| One variable column has no pivot | That variable is free to be anything | Infinitely many | A line, written as (3, 0, 1) + t(-2, 1, 0) |
| Two variable columns have no pivot | Two variables are free at the same time | Infinitely many | A plane, written with two parameters s and t |
| A whole row becomes 0 0 0 | 0 | That equation repeated information already present | Does not change the count | Ignore it; three equations gave only two facts |
The step-by-step method for linear systems
- Translate coefficients and constants into an augmented matrix without changing variable order.
- Use row replacement, row scaling, and row swapping to reach echelon or reduced echelon form.
- Read pivots, identify free variables, classify the system, and substitute the solution into the original equations.
How to check your answer
Multiply the coefficient matrix by the proposed solution vector and verify that the product equals the original constant vector.
Multiply back, inspect dimensions, and test the result on a simple vector. Solutions to a system must satisfy every original equation, not merely the reduced matrix.
A mistake that changes the mathematics
Row reduction preserves a system's solution set, but the reduced matrix is not the same linear transformation as the original coefficient matrix.
Explain why the tempting step is invalid, then write the condition or definition that prevents it. This turns the error into a rule you can recognize in a new problem.
Where you will actually use this
Electrical circuits
Kirchhoff's current and voltage laws turn a circuit with several loops into a linear system, and row reduction returns the current flowing in each branch.
Balancing chemical equations
Setting the count of each atom equal on both sides makes a homogeneous system, and the free variable is what lets you scale the coefficients to whole numbers.
Traffic flow
Each intersection contributes the equation 'cars in equals cars out', and the free variables in the reduced system show which street counts an engineer still needs to measure.
How linear systems connects to the rest of linear algebra
- Systems of equations — Row reduction is exactly the elimination method you already know, just written without repeating the variable names on every line.
- Matrix operations — The same system is the single matrix equation Ax = b, and checking a solution means multiplying A by your answer vector and comparing it with b.
- Eigenvalues and eigenvectors — Finding an eigenvector means row-reducing the system (A minus lambda I)v = 0, so a free variable there is what gives the eigenvector its scalable form.
Try a transfer problem
Reduce a three-variable system with one free variable and write the solution in parametric vector form.
Show the worked answer
Take x + 2y + z = 4, 2x + 4y + 3z = 9, and 3x + 6y + 4z = 13, or [1 2 1 | 4 ; 2 4 3 | 9 ; 3 6 4 | 13]. R2 - 2R1 gives [0 0 1 | 1] and R3 - 3R1 gives [0 0 1 | 1]. Then R3 - R2 gives [0 0 0 | 0], a row that adds nothing. Finally R1 - R2 gives [1 2 0 | 3]. The reduced matrix is [1 2 0 | 3 ; 0 0 1 | 1 ; 0 0 0 | 0]. Column 1 and column 3 have pivots, but column 2 does not, so y is free. Let y = t. Row 2 says z = 1 and row 1 says x + 2t = 3, so x = 3 - 2t. In parametric vector form the solution is (x, y, z) = (3, 0, 1) + t(-2, 1, 0), a line through the point (3, 0, 1) in the direction (-2, 1, 0). Check with t = 2, which gives (-1, 2, 1): equation two is 2(-1) + 4(2) + 3(1) = -2 + 8 + 3 = 9, and equation three is 3(-1) + 6(2) + 4(1) = -3 + 12 + 4 = 13. Both hold for every t.
Work without copying the example. When finished, use the relevant focused calculator or formula reference to check the setup and result, then correct the first line where your reasoning changed. When the method feels reliable, move to linear algebra practice questions.
Questions about linear systems
What is the difference between row echelon form and reduced row echelon form?
Row echelon form only needs zeros below each pivot, which is enough to back-substitute by hand. Reduced row echelon form also clears the entries above each pivot and scales every pivot to 1, so each row reads like 'x = something' with no back-substitution left. Echelon form is not unique, but the reduced form of a matrix is.
What does a row of all zeros mean?
A row reading 0 0 0 | 0 means that equation was a combination of the others and told you nothing new, so you effectively had fewer equations than you thought. A row reading 0 0 0 | 5 is completely different: it claims 0 = 5, which proves the system is inconsistent and has no solution at all.
Can a linear system have exactly two solutions?
No. If two different solutions exist, then every point on the straight line joining them is also a solution, so you instantly have infinitely many. That leaves only three possibilities for any linear system: zero solutions, exactly one, or infinitely many.
Why is swapping two rows allowed?
Because the rows are just equations, and the order you write equations in has no effect on which values satisfy all of them. Swapping is useful when the entry you wanted as a pivot happens to be 0, since you cannot divide by 0 to scale that row.