On this concept: Formula

Not sure which lesson to do first? Find your level and get a plan →

Math · Algebra Fundamentals · Grade 9-12

Solving Systems of Equations with Matrices

Solving a system with matrices represents it as Ax=b and solves via augmented-matrix row reduction, the inverse (x=A−1b), or Cramer's rule.

Matrix equation: Ax=b⇒x=A−1b. Cramer's rule: xi=det⁡(Ai)det⁡(A) where Ai replaces column i of A with b.

Quick Answer

Solving a system with matrices represents it as Ax=b and solves via augmented-matrix row reduction, the inverse (x=A−1b), or Cramer's rule. Use it when you have several linear equations in the same unknowns, especially three or more, or when the same system must be solved again for different right-hand sides. Row reduction works on any linear system and also shows when there is no solution or infinitely many. The inverse method and Cramer's rule need a square coefficient matrix with a nonzero determinant.

Why This Matters

Writing a system as Ax=b turns juggling equations into a routine that works the same way for 2 unknowns or 200, which is how calculators, spreadsheets and engineering software solve them. Row reduction also tells you plainly when a system has no solution or infinitely many. Without the matrix view, three equations become a page of substitutions where one sign slip spoils everything.

Intuitive Explanation

The system x+y=10, 2x+y=16 is really just its numbers. Strip away the letters and keep a grid: [11102116]. Each row is one equation; the columns hold the x coefficients, the y coefficients and the constants. In matrix form it reads Ax=b with A=[1121] and b=[1016].

Row operations are the elimination moves you already know, done on whole rows. Subtract twice row 1 from row 2: [11100−1−4], which says −y=−4, so y=4, and row 1 then gives x=6. Swapping rows, scaling a row by a nonzero number and adding a multiple of one row to another never change the solutions, because each turns true equations into true equations.

When A is square with det⁡A≠0, you can multiply by the inverse instead: x=A−1b. Here det⁡A=1⋅1−1⋅2=−1 and A−1=[−112−1], so A−1b=[−10+1620−16]=[64], the same answer. Cramer's rule finds each unknown as a ratio of two determinants.

If det⁡A=0, the methods that divide by it fail, and that failure is information. Row-reducing x+y=3, 2x+2y=7 produces the row 0=1, so the system has no solution: the two lines are parallel. A row of zeros, 0=0, would instead mean infinitely many solutions.

Think of it like this. An augmented matrix is a spreadsheet of the system with the letters deleted, and row operations are elimination moves applied to whole rows at once. Like tidying a spreadsheet, you work toward a clean layout, ones on the diagonal and zeros elsewhere, where the answers can be read straight off the last column.

Core idea. Write the system as a matrix equation and solve by row reduction, x=A−1b, or Cramer's rule.


When to Use

Use it for several linear equations in the same unknowns, particularly three or more, or when one coefficient matrix appears with many different right-hand sides. Row reduction handles any such system and classifies it. Use x=A−1b or Cramer's rule only when A is square and det⁡A≠0. For two small equations where one variable is already isolated, substitution is quicker by hand. If any equation contains x2, xy or a variable in a denominator, the system is not linear and these methods do not apply.

Tip. Ask: Can I write the system as Ax=b and solve mechanically by row ops, inverse, or determinants?

How to Recognize It

Before setting up a matrix, check that every equation is linear, then count the unknowns and the equations.

  1. Is each unknown only multiplied by numbers, never by itself or by another unknown?

    Yes means the system fits Ax=b. A term like xy or x2 makes it nonlinear, and you would solve by substitution instead, often ending with a quadratic.

  2. Are there three or more unknowns, or one set of left-hand sides with several different right-hand sides?

    That is where matrices save the most work. For two equations where one already reads y=…, plain substitution is quicker by hand.

  3. Are there as many equations as unknowns, with a coefficient determinant that is not zero?

    Then the inverse or Cramer's rule will give the one solution. If not, row-reduce: the final rows show whether there is no solution or a whole family of them.

  4. Are you asked for only one of the unknowns?

    Cramer's rule gives a single variable as a ratio of two determinants without solving for the rest, which suits a question like "find z only". For every unknown at once, row reduction is less arithmetic.

Solving Systems of Equations with Matrices compared with Substitution/elimination (algebra), Inverse matrix, and Determinant (Cramer's rule)

Every row solves the same kind of linear system, so the choice is about method rather than meaning. Ask how big the system is, whether its coefficient matrix has a nonzero determinant, and whether you want every unknown or just one.

Solving Systems of Equations with Matrices

Meaning
Use this when a system of linear equations is written as Ax=b and you want a systematic solution.
Key test
Can I write the system as Ax=b and solve mechanically by row ops, inverse, or determinants?
Formula
Matrix equation: Ax=b⇒x=A−1b. Cramer's rule: xi=det⁡(Ai)det⁡(A) where Ai replaces column i of A with b.
Example
Solve {2x+y=5x+3y=10 using matrices.

Substitution/elimination (algebra)

Meaning
Solves small systems by hand without matrices.
Key test
Use for 2-variable systems where matrices are overkill.
Formula
solve one equation, substitute
Example
{x+y=5x−y=1

Inverse matrix

Meaning
The tool for the x=A−1b method specifically.
Key test
Use when det⁡A≠0 and you prefer the inverse over row reduction.
Formula
x=A−1b
Example
invert A then multiply by b

Determinant (Cramer's rule)

Meaning
Builds each variable from a ratio of determinants.
Key test
Use Cramer's rule when you want one variable directly.
Formula
xi=det⁡(Ai)det⁡(A)
Example
replace a column with b

Formula & Notation

Matrix equation: Ax=b⇒x=A−1b. Cramer's rule: xi=det⁡(Ai)det⁡(A) where Ai replaces column i of A with b.
The system Ax=b with A∈Rm×n is solved by Gaussian elimination on [A∣b] to RREF. If det⁡(A)≠0 (m=n), the unique solution is x=A−1b. By Cramer's rule: xi=det⁡(Ai)det⁡(A).

How to read it: Augmented matrix: [A∣b]. Row operations: Ri↔Rj (swap), kRi (scale), Ri+kRj (add). Goal: reduced row echelon form.

Worked Examples

Example 1 — Solve a 2x2 system with the inverse

Easy

Solve {2x+y=5x+3y=10 using matrices.
Show the steps and the answer
  1. Write A=[2113] and b=[510], so the system is A[xy]=b.

    Each row of A holds one equation's coefficients, in the same variable order.

  2. Find det⁡A=2⋅3−1⋅1=5.

    It is nonzero, so A−1 exists and the solution is unique.

  3. Build A−1=15[3−1−12].

    Swap the diagonal entries, negate the other two, divide by the determinant.

  4. Multiply: A−1b=15[3⋅5−1⋅10−1⋅5+2⋅10]=15[515]=[13].

    Multiplying both sides of Ax=b by A−1 leaves the unknowns alone on the left.

  5. Check: 2(1)+3=5 and 1+3(3)=10.

    Both original equations hold.

Answer: x=1, y=3

Takeaway: When det⁡A≠0, x=A−1b solves the system with one multiplication.

Example 2 — No unique solution

Standard

Try to solve {x+2y=32x+4y=6 by the inverse.
Show the steps and the answer
  1. Find det⁡[1224]=1⋅4−2⋅2=0.

    A zero determinant means A−1 does not exist, so x=A−1b cannot be used.

  2. Row-reduce instead: R2−2R1 turns [123246] into [123000].

    Row reduction still works when the determinant is zero.

  3. Read the result: row 2 now says 0=0, so only x+2y=3 remains.

    One equation in two unknowns leaves one variable free.

  4. Describe the solutions: x=3−2y for any y, such as (3,0), (1,1) and (−1,2).

    The second equation is the first one doubled, so every point on the line x+2y=3 satisfies both.

Answer: Infinitely many solutions (singular A)

Takeaway: A zero determinant rules out the inverse, not the system; row reduction shows whether there are no solutions or infinitely many.

Example 3 — Find the mistake: columns in variable order

Application

Solve x+2y=8 and 3y−x=7 with an augmented matrix. Sam writes [1283−17] and gets x=227, y=177. Find the mistake and correct it.
Show the steps and the answer
  1. Test Sam's answer in the second equation: 3⋅177−227=51−227=297, not 7.

    Failing an original equation means the setup or the arithmetic went wrong.

  2. Rewrite 3y−x=7 in variable order: −x+3y=7, so row 2 is (−1, 3∣7).

    Each column must hold one variable's coefficients; Sam put the y coefficient in the x column.

  3. Row-reduce: R2+R1 gives [1280515], so 5y=15 and y=3.

    Adding the rows cancels the x terms.

  4. Back-substitute into row 1: x=8−2(3)=2.

    Row 1 still says x+2y=8.

  5. Check: 2+2(3)=8 and 3(3)−2=7.

    Both original equations hold now.

Answer: x=2, y=3

Takeaway: Rewrite every equation in the same variable order before building the augmented matrix.

Where You'll See It

  • Working out ticket prices

    A cinema took $41 for 3 adult and 2 child tickets, and $53 for 2 adult and 5 child tickets. With A=[3225], det⁡A=11 and A−1=111[5−2−23], so A−1[4153]=[97]: adults pay $9 and children $7.

  • Currents in an electrical circuit

    A 12 V battery drives a circuit with 2, 3 and 6 ohm resistors. Kirchhoff's laws give I1−I2−I3=0, 2I1+3I2=12 and 3I2−6I3=0. Row-reducing the augmented matrix gives currents of 3 A, 2 A and 1 A. Circuit simulators solve systems like this with thousands of unknowns.

  • Fitting a curve through data points

    For the parabola y=ax2+bx+c through (1,4), (2,9) and (3,16), each point gives one equation: a+b+c=4, 4a+2b+c=9, 9a+3b+c=16. Row reduction gives a=1, b=2, c=1, so the curve is y=x2+2x+1.

Common Mistakes

  1. The slip: Using x=A−1b when det⁡A=0

    Instead: there is no unique solution; switch to row reduction to classify it.

  2. The slip: Setting up the augmented matrix in the wrong order

    Instead: align coefficients column by variable and put constants after the bar.

  3. The slip: Mishandling a row operation

    Instead: only swap rows, scale a row, or add a multiple of one row to another.


Mini Practice

Try these on your own. Tap Reveal when you want to check.

  1. Write the augmented matrix for the system 3x−y=7, x+2y=0.

    Hint: One row per equation: x coefficient, y coefficient, then the constant.

  2. Solve x+y=6, x−y=2 using the inverse of the coefficient matrix.

    Hint: Find A−1 for A=[111−1], then multiply it by the constants.

  3. Use Cramer's rule to solve 2x+3y=13, x−y=−1.

    Hint: Replace one column at a time with the constants 13 and −1.

  4. Row-reduce [1253411] to solve the system.

    Hint: Subtract 3 times row 1 from row 2.

  5. For the system x+y=3, x−y=1, would you set up matrices or just use elimination?

    Hint: Could adding the two equations finish the job in one step?

  6. For x+3y=4 and 2x+6y=5, a student starts computing A−1 to solve the system. What goes wrong?

    Hint: Check the determinant of the coefficient matrix first.

Want the full set?

50 practice questions for this concept — free to try, every one with a complete worked solution showing the why, not just the answer.

Frequently Asked Questions

What does a row of zeros in the reduced matrix mean?

It depends on the number after the bar. In a system of three equations in three unknowns, a row reading [ 0  0  0∣0 ][\,0\;0\;0\mid 0\,] says 0=00=0: one equation was a combination of the others, and if no other row is impossible, there are infinitely many solutions, often written with a free variable such as z=tz=t. A row reading [ 0  0  0∣5 ][\,0\;0\;0\mid 5\,] says 0=50=5, so the system has no solution at all.

Is Cramer's rule worth learning if row reduction always works?

For hand work it is handy in one situation: a 2×22\times2 or 3×33\times3 system where you want a single unknown, or where the coefficients include a letter such as kk. For larger systems it is slow, because a 4×44\times4 system needs five 4×44\times4 determinants. It also gives a formula showing how the answer depends on each number in the system, which is why it appears in economics and in proofs.

How do computers solve systems with thousands of unknowns?

For small and medium systems they use row reduction, the same Gaussian elimination you do by hand, arranged to need as few operations as possible and swapping rows to avoid dividing by tiny numbers. They almost never compute A−1A^{-1}, because that takes more work and adds rounding error. For systems with millions of unknowns, as in weather and engineering simulations, they switch to methods that improve a guess step by step.

Does the order of the equations matter when I build the augmented matrix?

No, swapping rows is one of the allowed operations, so the equations can go in any order. What must stay fixed is the order of the variables: if column 1 is xx in one row, it must be xx in every row, with a 0 where a variable is missing. Putting an equation whose first coefficient is 1 at the top is a smart choice, because it gives an easy first pivot.

Learning Path

Solving Systems of Equations with Matrices

You are here

Next →

Nothing after this yet
You need Systems of Equations (what a solution is), the Inverse Matrix and the Determinant first. This concept adds the matrix form Ax=b and three ways to solve it: row reduction, x=A−1b and Cramer's rule. It prepares you for systems too big to solve by hand, such as finding the currents in an electrical network or fitting a curve through several data points.

See Also