Matrix Calculator

Linear Systems Guide

How to Solve Systems of Equations with Matrices

This tutorial shows how to write a linear system as Ax = b, build an augmented matrix, use Gauss-Jordan elimination, reach RREF, and identify the three possible solution types: unique, no solution, or infinitely many solutions.

On this page

Quick answer

  1. Write the equations in a consistent variable order.
  2. Place the coefficients in matrix A.
  3. Place the constants in vector b.
  4. Form the augmented matrix [A|b].
  5. Use row operations to reduce it to RREF.
  6. Read the solution or identify a contradiction/free variables.

When you want to check the final result, open the System of Equations Calculator.

What does Ax = b mean?

In a linear system, A is the coefficient matrix, x is the column vector of unknown variables, and b is the constants vector. For example:

x + y = 5
2x - y = 1

The same system can be written as Ax = b:

A
11 2-1
×
x
x y
=
b
5 1

Coefficient matrix × variable vector = constants vector

How to build an augmented matrix

To solve the system by row reduction, place the constants vector beside the coefficient matrix:

[A | b] =
115 2-11
  • The variable order must remain consistent.
  • Each equation becomes one row.
  • The last column contains constants.
  • The vertical bar is a visual separator, not an extra matrix entry.

The Augmented Matrix Calculator can help combine or check an augmented matrix structure.

Gauss-Jordan elimination

Gauss-Jordan elimination uses row operations that preserve the solution set of the system. The legal row operations are:

  1. Swap two rows.
  2. Multiply a row by a nonzero number.
  3. Add a multiple of one row to another row.

The goal is to reduce the augmented matrix to reduced row echelon form (RREF). For row-reduction help, use the RREF Calculator.

Complete example: solve a 2x2 system

Start with the system:

x + y = 5
2x - y = 1

The augmented matrix is:

115 2-11

Step 1: R2 -> R2 - 2R1

115 0-3-9

Step 2: R2 -> (-1/3)R2

115 013

Step 3: R1 -> R1 - R2

102 013

The RREF tells us:

x = 2
y = 3

Check the solution in the original equations:

2 + 3 = 5
2(2) - 3 = 1

Check this system with the System of Equations Calculator

Example with three variables

The same method works for more variables. For this system:

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

The augmented matrix is:

1116 2-113 12-12

After row reduction, the RREF is:

1001 0102 0013

Therefore x = 1, y = 2, and z = 3. The matrix size grows, but the logic does not change. The calculator can show the intermediate steps if you want to inspect them.

How RREF reveals the solution type

RREF determines the solution type even when the system is rectangular. Count pivots, check for contradictions, and look for free variables.

Unique solution

  • Every variable column has a pivot.
  • There is no contradictory row.
  • There are no free variables.
102 013

No solution

A row like this creates a contradiction:

001

It means 0 = 1, so the system is inconsistent.

Infinitely many solutions

  • The system is consistent.
  • At least one variable has no pivot.
  • That variable becomes a free parameter.
  • Answers may use parameters such as t1 or t2.

The Matrix Rank Calculator can help study consistency, but this tutorial mainly uses RREF to read the solution type.

Fractions and decimals

Fractions often preserve exact values, while converting to decimals too early can introduce rounding. The calculator accepts fractions such as 1/2 and -3/4, and empty cells in the calculator are treated as zero.

(1/2)x + y = 3
x - (1/3)y = 1
1/213 1-1/31

The exact solution is:

x = 12/7
y = 15/7

Check: (1/2)(12/7) + 15/7 = 3, and 12/7 - (1/3)(15/7) = 1.

Can I solve Ax = b with an inverse matrix?

When A is an invertible square matrix, you can write x = A^-1b. But not every matrix is invertible, and non-square matrices do not use the ordinary matrix inverse. Gauss-Jordan elimination and RREF are more general for linear systems, so you should not force the inverse method for every problem.

For square invertible matrices, the Matrix Inverse Calculator can help compute A^-1.

Common mistakes

  • Changing the variable order between equations.
  • Placing constants inside matrix A.
  • Applying a row operation to only part of a row.
  • Confusing REF with RREF.
  • Rounding decimals too early.
  • Assuming every system has one solution.
  • Assuming the matrix must be square.
  • Reading a free variable as zero without justification.

Check your work with the calculator

The main calculator supports equations, A and b, augmented matrices, RREF steps, unique/no/infinite solution types, fractions, and decimals.

Related matrix tools

Frequently Asked Questions

How do you solve a system of equations using matrices?

Write the system as an augmented matrix, use row operations to reach RREF, then read the variable values or identify the solution type.

What does Ax = b mean?

A is the coefficient matrix, x is the column vector of unknown variables, and b is the column vector of constants.

What is the difference between a coefficient matrix and an augmented matrix?

The coefficient matrix contains only variable coefficients. The augmented matrix adds the constants column after a separator.

Why is RREF useful for solving a system?

RREF isolates pivots, exposes contradictions, and shows whether variables are fixed or free.

How does RREF show that a system has no solution?

A row such as [0 0 | 1] means 0 = 1, so the system is inconsistent.

Can a rectangular system of equations be solved?

Yes. Rectangular systems can be solved with RREF; the final rows and pivots determine the solution type.

Can I use fractions in the system of equations calculator?

Yes. The calculator accepts fractions such as 1/2 and -3/4, along with decimals.

Solve your system with matrices and review RREF steps using this free calculator.

Enter equations, A and b, or an augmented matrix.

Open System Calculator