System of linear equations calculator

x1

+

x2

+

x3

+

x4

=
0

x1

+

x2

+

x3

+

x4

=
0

x1

+

x2

+

x3

+

x4

=
0

x1

+

x2

+

x3

+

x4

=
0
Number format
Solution comments
Without description (answer only)

a

b

c

d

x

y

z

clear

i

Randomize

313131313135151515151583137
2
2510
=Solve

  How to solve a system by Gauss-Jordan elimination

Augment the coefficient matrix with the constants vector. Apply elementary row operations to reach reduced row echelon form (1s on the diagonal, 0s above and below each pivot). The constants column then holds the solution directly.

  Gauss-Jordan worked example (4 equations)

Write the system of equations in matrix form:
1
3
4
2
2
2
4
0
1
4
3
1
-1
4
4
5
5
16
22
15
To find the roots of a system of linear equations, using the
Gauss-Jordan
method , we can transform the matrix form of the system so that the left part of the matrix becomes a identity, then on the right part we get the roots of the system;
2
Iteration 1
Obtain zeros in column
1
;
The element with indices
1,1
becomes the pivot;
The row containing the pivot element remains unchanged;
All other elements of the matrix are found using the rectangle method relative to the pivot element:
Zero the column containing the pivot element:
1
0
0
0
2
-4
-4
-4
1
1
-1
-1
-1
7
8
7
5
1
2
5
a
0
2,2
=
1
3
4
2
2
2
4
0
1
4
3
1
-1
4
4
5
5
16
22
15
=
a
0
2,2
*
a
0
1,1
- (
a
0
2,1
*
a
0
1,2
) =
2
*
1
- (
3
*
2
) =
-4
;
a
0
2,3
=
1
3
4
2
2
-4
4
0
1
4
3
1
-1
4
4
5
5
16
22
15
=
a
0
2,3
*
a
0
1,1
- (
a
0
2,1
*
a
0
1,3
) =
4
*
1
- (
3
*
1
) =
1
;
a
0
2,4
=
1
3
4
2
2
-4
4
0
1
1
3
1
-1
4
4
5
5
16
22
15
=
a
0
2,4
*
a
0
1,1
- (
a
0
2,1
*
a
0
1,4
) =
4
*
1
- (
3
*
-1
) =
7
;
a
0
2,5
=
1
3
4
2
2
-4
4
0
1
1
3
1
-1
7
4
5
5
16
22
15
=
a
0
2,5
*
a
0
1,1
- (
a
0
2,1
*
a
0
1,5
) =
16
*
1
- (
3
*
5
) =
1
;
a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
-1
-1
-1
3
4
8
7
5
-
1
4
2
5
a
0
2,2
=
-4
-4
=
1
;
a
0
2,3
=
1
-4
=
-
1
4
;
a
0
2,4
=
7
-4
=
-1
3
4
;
a
0
2,5
=
1
-4
=
-
1
4
;
Hide description
Obtain zeros in column
2
;
The element with indices
2,2
becomes the pivot;
The row containing the pivot element remains unchanged;
All other elements of the matrix are found using the rectangle method relative to the pivot element:
Zero the column containing the pivot element:
1
0
0
0
0
1
0
0
1
1
2
-
1
4
-2
-2
2
1
2
-1
3
4
1
0
5
1
2
-
1
4
1
4
a
0
1,3
=
1
0
0
0
2
1
-4
-4
1
-
1
4
-1
-1
-1
-1
3
4
8
7
5
-
1
4
2
5
=
a
0
1,3
*
a
0
2,2
- (
a
0
1,2
*
a
0
2,3
) =
1
*
1
- (
2
*
-
1
4
) =
1
1
2
;
a
0
1,4
=
1
0
0
0
2
1
-4
-4
1
1
2
-
1
4
-1
-1
-1
-1
3
4
8
7
5
-
1
4
2
5
=
a
0
1,4
*
a
0
2,2
- (
a
0
1,2
*
a
0
2,4
) =
-1
*
1
- (
2
*
-1
3
4
) =
2
1
2
;
a
0
1,5
=
1
0
0
0
2
1
-4
-4
1
1
2
-
1
4
-1
-1
2
1
2
-1
3
4
8
7
5
-
1
4
2
5
=
a
0
1,5
*
a
0
2,2
- (
a
0
1,2
*
a
0
2,5
) =
5
*
1
- (
2
*
-
1
4
) =
5
1
2
;
a
0
3,3
=
1
0
0
0
2
1
-4
-4
1
1
2
-
1
4
-1
-1
2
1
2
-1
3
4
8
7
5
1
2
-
1
4
2
5
=
a
0
3,3
*
a
0
2,2
- (
a
0
3,2
*
a
0
2,3
) =
-1
*
1
- (
-4
*
-
1
4
) =
-2
;
a
0
3,4
=
1
0
0
0
2
1
-4
-4
1
1
2
-
1
4
-2
-1
2
1
2
-1
3
4
8
7
5
1
2
-
1
4
2
5
=
a
0
3,4
*
a
0
2,2
- (
a
0
3,2
*
a
0
2,4
) =
8
*
1
- (
-4
*
-1
3
4
) =
1
;
a
0
3,5
=
1
0
0
0
2
1
-4
-4
1
1
2
-
1
4
-2
-1
2
1
2
-1
3
4
1
7
5
1
2
-
1
4
2
5
=
a
0
3,5
*
a
0
2,2
- (
a
0
3,2
*
a
0
2,5
) =
2
*
1
- (
-4
*
-
1
4
) =
1
;
a
0
4,3
=
1
0
0
0
2
1
-4
-4
1
1
2
-
1
4
-2
-1
2
1
2
-1
3
4
1
7
5
1
2
-
1
4
1
5
=
a
0
4,3
*
a
0
2,2
- (
a
0
4,2
*
a
0
2,3
) =
-1
*
1
- (
-4
*
-
1
4
) =
-2
;
a
0
4,4
=
1
0
0
0
2
1
-4
-4
1
1
2
-
1
4
-2
-2
2
1
2
-1
3
4
1
7
5
1
2
-
1
4
1
5
=
a
0
4,4
*
a
0
2,2
- (
a
0
4,2
*
a
0
2,4
) =
7
*
1
- (
-4
*
-1
3
4
) =
0
;
a
0
4,5
=
1
0
0
0
2
1
-4
-4
1
1
2
-
1
4
-2
-2
2
1
2
-1
3
4
1
0
5
1
2
-
1
4
1
5
=
a
0
4,5
*
a
0
2,2
- (
a
0
4,2
*
a
0
2,5
) =
5
*
1
- (
-4
*
-
1
4
) =
4
;
Hide description
4
Iteration 3
Divide
3
th row by
-2
;
1
0
0
0
0
1
0
0
1
1
2
-
1
4
1
-2
2
1
2
-1
3
4
-
1
2
0
5
1
2
-
1
4
-
1
2
4
a
0
3,3
=
-2
-2
=
1
;
a
0
3,4
=
1
-2
=
-
1
2
;
a
0
3,5
=
1
-2
=
-
1
2
;
Hide description
Obtain zeros in column
3
;
The element with indices
3,3
becomes the pivot;
The row containing the pivot element remains unchanged;
All other elements of the matrix are found using the rectangle method relative to the pivot element:
Zero the column containing the pivot element:
1
0
0
0
0
1
0
0
0
0
1
0
3
1
4
-1
7
8
-
1
2
-1
6
1
4
-
3
8
-
1
2
3
a
0
1,4
=
1
0
0
0
0
1
0
0
1
1
2
-
1
4
1
-2
2
1
2
-1
3
4
-
1
2
0
5
1
2
-
1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0
4,5
=
3
-1
=
-3
;
Hide description
Obtain zeros in column
4
;
The element with indices
4,4
becomes the pivot;
The row containing the pivot element remains unchanged;
All other elements of the matrix are found using the rectangle method relative to the pivot element:
Zero the column containing the pivot element:
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
1
16
-6
-2
-3
a
0
1,5
=
1
0
0
0
0
1
0
0
0
0
1
0
3
1
4
-1
7
8
-
1
2
1
6
1
4
-
3
8
-
1
2
-3
=
a
0
1,5
*
a
0
4,4
- (
a
0
1,4
*
a
0
4,5
) =
6
1
4
*
1
- (
3
1
4
*
-3
) =
16
;
a
0
2,5
=
1
0
0
0
0
1
0
0
0
0
1
0
3
1
4
-1
7
8
-
1
2
1
16
-
3
8
-
1
2
-3
=
a
0
2,5
*
a
0
4,4
- (
a
0
2,4
*
a
0
4,5
) =
-
3
8
*
1
- (
-1
7
8
*
-3
) =
-6
;
a
0
3,5
=
1
0
0
0
0
1
0
0
0
0
1
0
3
1
4
-1
7
8
-
1
2
1
16
-6
-
1
2
-3
=
a
0
3,5
*
a
0
4,4
- (
a
0
3,4
*
a
0
4,5
) =
-
1
2
*
1
- (
-
1
2
*
-3
) =
-2
;
Hide description
Answer
Ax = b
x
0
1
=
16
;
x
0
2
=
-6
;
x
0
3
=
-2
;
x
0
4
=
-3
;
SIZE4×5METHODGauss-Jordan

  Sources