Tool to apply the gaussian elimination method and get the row reduced echelon form, with steps, details, inverse matrix and vector solution.
Gaussian Elimination - dCode
Tag(s) : Matrix, Symbolic Computation
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
The Gaussian elimination algorithm (also called Gauss-Jordan, or pivot method) makes it possible to find the solutions of a system of linear equations, and to determine the inverse of a matrix.
The algorithm works on the rows of the matrix, by exchanging or multiplying the rows between them (up to a factor).
At each step, the algorithm aims to introduce into the matrix, on the elements outside the diagonal, zero values.
From a system of linear equations, the first step is to convert the equations into a matrix.
Example: $$ \left\{ \begin{array}{} x&-&y&+&2z&=&5\\3x&+&2y&+&z&=&10\\2x&-&3y&-&2z&=&-10\\\end{array} \right. $$ can be written under multiplication">matrix multiplication form: $$ \left( \begin{array}{ccc} 1 & -1 & 2 \\ 3 & 2 & 1 \\ 2 & -3 & -2 \end{array} \right) . \left( \begin{array}{c} x \\ y \\ z \end{array} \right) = \left( \begin{array}{c} 5 \\ 10 \\ -10 \end{array} \right) $$ that corresponds to the (augmented) matrix $$ \left( \begin{array}{ccc|c} 1 & -1 & 2 & 5 \\ 3 & 2 & 1 & 10 \\ 2 & -3 & -2 & -10 \end{array} \right) $$
Then, for each element outside the non-zero diagonal, perform an adequate calculation by adding or subtracting the other lines so that the element becomes 0.
Example: Subtract 3 times (Row 1) to (Row 2) such as the element in row 2, column 1 becomes 0: $$ \left( \begin{array}{ccc|c} 1 & -1 & 2 & 5 \\ 0 & 5 & -5 & -5 \\ 2 & -3 & -2 & -10 \end{array} \right) $$
Subtract 2 times (Row 1) to (Row 3) such as the element in row 3, column 1 becomes 0: $$ \left( \begin{array}{ccc|c} 1 & -1 & 2 & 5 \\ 0 & 5 & -5 & -5 \\ 0 & -1 & -6 & -20 \end{array} \right) $$
Subtract 1/5 times (Row 2) to (Row 3) such as the element in row 3, column 2 becomes 0: $$ \left( \begin{array}{ccc|c} 1 & -1 & 2 & 5 \\ 0 & 5 & -5 & -5 \\ 0 & 0 & -7 & -21 \end{array} \right) $$
Subtract 1/5 times (Row 2) to (Row 1) such as the element in row 1, column 2 becomes 0: $$ \left( \begin{array}{ccc|c} 1 & 0 & 1 & 4 \\ 0 & 5 & -5 & -5 \\ 0 & 0 & -7 & -21 \end{array} \right) $$
Subtract 1/7 times (Row 3) to (Row 1) such as the element in row 1, column 3 becomes 0: $$ \left( \begin{array}{ccc|c} 1 & 0 & 0 & 1 \\ 0 & 5 & -5 & -5 \\ 0 & 0 & -7 & -21 \end{array} \right) $$
Subtract 5/7 times (Row 3) to (Row 2) such as the element in row 2, column 3 becomes 0: $$ \left( \begin{array}{ccc|c} 1 & 0 & 0 & 1 \\ 0 & 5 & 0 & 10 \\ 0 & 0 & -7 & -21 \end{array} \right) $$
Simplify each line by dividing the value on the diagonal
Example: $$ \left( \begin{array}{ccc|c} 1 & 0 & 0 & 1 \\ 0 & 1 & 0 & 2 \\ 0 & 0 & 1 & 3 \end{array} \right) $$
The result vector is the last column.
Example: $ {1,2,3} $ that corresponds to $ {x,y,z} $ so $ x=1, y=2, z=3 $
dCode retains ownership of the "Gaussian Elimination" source code. Any algorithm for the "Gaussian Elimination" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Gaussian Elimination" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Gaussian Elimination" or any other element are not public (except explicit open source licence like Creative Commons). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "Gaussian Elimination" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source.
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: Gaussian Elimination on dCode.fr [online website], retrieved on 2025-04-16,