Systems of linear equations
Matrix form AX = B, the consistency test by rank, and four solution methods — Cramer's rule, the inverse method, Gauss elimination and Gauss–Jordan — including homogeneous systems.
Module contents
This is what the whole module was building towards.
Matrix form
A system of equations in unknowns
collapses to a single matrix equation
where is the coefficient matrix (), the column of unknowns (), and the column of constants ().
The augmented matrix is with attached as an extra column:
A system with is homogeneous; otherwise non-homogeneous.
Consistency — will it even have a solution?
Compare the rank of the coefficient matrix with the rank of the augmented matrix.
where is the number of unknowns. In the third case, unknowns can be chosen freely; they are the free variables or parameters.
Inconsistency shows up in the reduced augmented matrix as a row of the form
which says . That is impossible, so no solution exists.
Method 1 — Cramer's rule
For a system of equations in unknowns with :
where is with the -th column replaced by .
For three unknowns:
When , Cramer's rule gives no answer directly:
- If and at least one — inconsistent, no solution.
- If and every — consistent, infinitely many solutions (analyse by rank).
Cramer's rule is clean for and but costs determinants, so it is unusable for large systems.
Method 2 — Matrix inversion
If is square and non-singular:
Compute (usually via adjoint), then multiply. Useful when several different vectors must be solved with the same — invert once, reuse.
Method 3 — Gauss elimination
- Form .
- Reduce the left block to upper triangular / echelon form by row operations.
- Read the last equation, solve for the last unknown, and back-substitute upwards.
This is the method actual software uses. It has the lowest operation count of the three and never requires a determinant.
Method 4 — Gauss–Jordan
Same start, but continue until the left block is :
The solution is read off directly — no back-substitution. Slightly more arithmetic than Gauss elimination, but no second phase.
Homogeneous systems
These are always consistent, because always works. That solution is called the trivial solution. The real question is whether anything else exists.
For equations in unknowns:
In general, has non-trivial solutions if and only if , and the solution set then has free parameters.
A homogeneous system with fewer equations than unknowns () always has non-trivial solutions, since .
Choosing a method
| Situation | Method |
|---|---|
| or unknowns, , question says "Cramer" | Cramer's rule |
| Same , several different | Inverse method |
| Any size, method free | Gauss elimination |
| Consistency to be discussed | Rank of vs rank of |
| Homogeneous | Check ; if zero, row-reduce and parametrise |
Worked examples
5 solvedEvery step is shown, in the order you would write it in an answer book.
Three unknowns by Cramer's rule
Question
Solve by Cramer's rule:
Write the coefficient determinant
Expanding along row 1:
, so a unique solution exists.
— replace column 1 with
— replace column 2
— replace column 3
Divide
Check in all three equations
✓ ✓ ✓
Answer
The same system by Gauss elimination
Question
Solve by Gauss elimination:
Form the augmented matrix
Clear column 1
:
:
Clear column 2
:
Upper triangular — elimination is complete.
Back-substitute
From row 3:
From row 2:
From row 1:
Note the ranks
and , with unknowns. Equal ranks, both equal to — consistent with a unique solution, exactly as found.
Answer
— the same as by Cramer's rule, with far less arithmetic.
NoteScaling R₃ by 2 before subtracting avoids fractions. Legal, and worth doing every time.
Solving by the inverse method
Question
Solve using :
Write in matrix form
Invert
Multiply
Check
✓ ✓
Answer
NoteKeep the 1/14 outside until the very last step — it turns the whole computation into integer arithmetic.
Testing consistency by rank
Question
Test for consistency and solve if possible:
Form the augmented matrix
Reduce
:
:
:
Read the ranks
Coefficient block: two non-zero rows, so .
Augmented matrix: three non-zero rows, so .
Conclude
The system is inconsistent — no solution.
The last row says , i.e. , which is impossible. Geometrically the three planes have no common point.
Answer
Inconsistent: . No solution exists.
A homogeneous system with non-trivial solutions
Question
Solve
Check the determinant
, so non-trivial solutions exist.
Row-reduce (no column needed — it stays zero)
:
:
:
Count the free variables
, unknowns, so there are free variable — a one-parameter family of solutions.
Parametrise and back-substitute
Let .
Row 2:
Row 1:
Write the solution
Check with , i.e. : ✓, ✓, ✓
Setting recovers the trivial solution.
Answer
for any real .
NoteAlways present a homogeneous answer as a multiple of a fixed vector. Giving one particular solution loses marks — the question asks for all of them.
Practice problems
7 with solutionsWork each one on paper first. The full solution — not just the answer — is one click away.
Solve by Cramer's rule: .
Show solutionHide solution
Check: ✓ ✓
Write in the form and state the augmented matrix.
Show solutionHide solution
Augmented matrix:
Solve by Gauss–Jordan:
Show solutionHide solution
, :
, then to get a leading :
, :
:
, :
Read off directly:
Check: ✓ ✓ ✓
Test for consistency and solve:
Show solutionHide solution
, :
:
Ranks. and . Equal, so the system is consistent. But unknowns and , so there are free variable and infinitely many solutions.
Parametrise. Let .
Row 2:
Row 1:
Check with , giving : ✓, ✓, ✓
Find the values of for which the system has (i) a unique solution, (ii) no solution, (iii) infinitely many solutions:
Show solutionHide solution
, :
:
since .
(i) Unique solution. This would need , but the coefficient block has a zero row for every , so always. A unique solution never occurs.
(ii) No solution. Need , which makes :
(iii) Infinitely many. Need , giving :
Solution when : row 2 becomes . With : , and .
Solution when : row 2 becomes . With : , and .
Show that the system has only the trivial solution.
Show solutionHide solution
Homogeneous, so it is automatically consistent. Test .
Expand along row 1:
Since the coefficient matrix is non-singular, , and the only solution of is
that is, — the trivial solution only. ∎
Find so that has a non-trivial solution, and find that solution for the smaller value of .
Show solutionHide solution
A homogeneous system has non-trivial solutions exactly when .
Expand along row 1:
Only one value, (a repeated root).
Solving at .
:
:
, , so one free parameter.
Row 2: .
Row 1: . Let .
Check with , i.e. : ✓, ✓, ✓