Matrix Calculator
English

Linear Systems Guide

How to Solve Systems of Equations with Matrices

To solve a linear system with matrices, place the coefficients in A, the variables in x, and the constants in b so the system becomes Ax = b. Form the augmented matrix [A | b], use row operations to reduce it to RREF, and then read the solution from the final rows.

On this page

From Equations to Ax = b

Start with the same variable order in every equation:

x + y = 5
2x - y = 1

The coefficients become A, the variables become x, and the constants become b:

A
112-1
×
x
xy
=
b
51

The matrix form keeps the coefficients, variables, and constants in separate roles.

Solve with Equations or A and b →

Build the Augmented Matrix

Place b as the final column beside A. Each equation becomes one row:

[1  1 | 5]
[2 -1 | 1]

The separator is a visual reminder that the last column contains constants, not another variable coefficient.

Open the Augmented Matrix Calculator →

The Three Valid Row Operations

Gauss-Jordan elimination uses only operations that keep the solution set equivalent:

Swap two rows

Exchange the position of two equations when a better pivot is available.

Multiply a row by a nonzero number

Scale a row to create a pivot of 1 without changing the solution set.

Add a multiple of one row to another row

Clear entries above or below a pivot while preserving equivalent equations.

The goal is RREF, where pivot columns make the solution easy to read.

Complete 2×2 Example

For the system x + y = 5 and 2x - y = 1, start with:

[1  1 |  5]
[2 -1 |  1]

Step 1

R2 ← R2 − 2R1

[1  1 |  5]
[0 -3 | -9]

Step 2

R2 ← −⅓R2

[1 1 | 5]
[0 1 | 3]

Step 3

R1 ← R1 − R2

[1 0 | 2]
[0 1 | 3]

The final RREF gives x = 2 and y = 3.

How RREF Shows the Solution Type

Unique

[1 0 | 2]
[0 1 | 3]

Every variable column has a pivot, so each variable has one value.

No solution

[1 0 | 2]
[0 0 | 1]

The second row says 0 = 1, so the system is inconsistent.

Infinite

[1 2 | 5]
[0 0 | 0]

The system is consistent with a free variable, so the solutions use a parameter.

Open the RREF Calculator →

Three-Variable Example

Use the same route for a larger system:

x + y + z = 6
2x - y + z = 3
x + 2y - z = 2

The augmented matrix is:

[1  1  1 | 6]
[2 -1  1 | 3]
[1  2 -1 | 2]

One efficient reduction route is R2 ← R2 − 2R1, R3 ← R3 − R1, scale the second and third pivot rows, then clear the entries above the pivots. The final RREF is:

[1 0 0 | 1]
[0 1 0 | 2]
[0 0 1 | 3]

Therefore x = 1, y = 2, and z = 3.

When the Inverse Method Works

You can use x = A⁻¹b only when A is square and invertible. Many systems are rectangular or singular, so RREF is the main method for solving systems with matrices.

Fractions and Decimals

Fractions preserve exact values during row reduction. Decimals can be useful for estimates, but rounding too early can hide exact relationships. Keep fractions such as 1/2 and -3/4 exact when possible.

Common Mistakes

  • Changing the variable order between equations.
  • Putting constants inside A instead of b.
  • Applying a row operation to only part of a row.
  • Confusing row echelon form with reduced row echelon form.
  • Rounding decimals before the final answer.
  • Assuming every system has one solution.

Check Your Work

Use the calculator to enter equations, A and b, or an augmented matrix and verify the RREF result.

Frequently Asked Questions

What does Ax = b mean?

A is the coefficient matrix, x is the column vector of unknown variables, and b is the constants vector. Together they represent the same linear system in matrix form.

Why use an augmented matrix?

An augmented matrix places the constants beside the coefficient matrix so each row operation updates the equations and constants together.

How does RREF show that a system has no solution?

RREF shows no solution when a row becomes a contradiction, such as [0 0 | 1]. That row means 0 = 1, which cannot be true.

What causes infinitely many solutions?

Infinitely many solutions occur when the system is consistent but at least one variable column has no pivot. That variable is free and can be written as a parameter.

Can every system be solved with an inverse matrix?

No. The inverse method x = A⁻¹b works only when A is square and invertible. RREF is the more general method for linear systems.

Do row operations change the solution set?

Valid row operations do not change the solution set. They rewrite the system into an equivalent form that is easier to read.