From equations to a single matrix equation
Stack the coefficients into A, the unknowns into x, the constants into b.
The key idea. A set of simultaneous linear equations is just a matrix multiplication waiting to happen. Once you write it as you can use all the matrix machinery — inverses, determinants, row operations.
Take the system:
Read off three things:
- The coefficient matrix — every coefficient, in order, row by row.
- The variable vector — the unknowns stacked in a column.
- The constant vector — the right-hand sides stacked in a column.
Check it reproduces the system. Multiplying gives a column whose entries are exactly the left-hand sides , , . Setting that column equal to recovers all three equations at once.
Cambridge tip. Keep the variables in the same order () across every equation before you build . If an equation is missing a variable (e.g. no ), put a in that slot — never leave a gap.
- holds the coefficients, the unknowns, the constants.
- multiplied out reproduces the left-hand sides of the equations.
- A missing variable means a entry — never a blank.
See the full worked example for simultaneous linear equations and matrix formulation →