Skip to main content
Mathematics LibreTexts

1.2: Gaussian Elimination

  • Page ID
    161288
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \( \newcommand{\dsum}{\displaystyle\sum\limits} \)

    \( \newcommand{\dint}{\displaystyle\int\limits} \)

    \( \newcommand{\dlim}{\displaystyle\lim\limits} \)

    \( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)

    ( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\id}{\mathrm{id}}\)

    \( \newcommand{\Span}{\mathrm{span}}\)

    \( \newcommand{\kernel}{\mathrm{null}\,}\)

    \( \newcommand{\range}{\mathrm{range}\,}\)

    \( \newcommand{\RealPart}{\mathrm{Re}}\)

    \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)

    \( \newcommand{\Argument}{\mathrm{Arg}}\)

    \( \newcommand{\norm}[1]{\| #1 \|}\)

    \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)

    \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    \( \newcommand{\vectorA}[1]{\vec{#1}}      % arrow\)

    \( \newcommand{\vectorAt}[1]{\vec{\text{#1}}}      % arrow\)

    \( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \( \newcommand{\vectorC}[1]{\textbf{#1}} \)

    \( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)

    \( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)

    \( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)

    \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)

    \(\newcommand{\longvect}{\overrightarrow}\)

    \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)

    \(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)
    Learning Objectives
    • Find the row-echelon form and reduced row-echelon form of a matrix.
    • Determine whether a system of linear equations has no solution, a unique solution, or an infinite number of solutions from its row-echelon or reduced row-echelon form.
    • Solve a system of equations using Gaussian Elimination and Gauss-Jordan Elimination.
    • Establish the uniqueness of the reduced row-echelon form.

    The work we did in the previous section will always find the solution to the system. In this section, we will explore a less cumbersome way to find the solutions. First, we will represent a linear system with an augmented matrix. A matrix is simply a rectangular array of numbers. The size or dimension of a matrix is defined as \(m\times n\) where \(m\) is the number of rows and \(n\) is the number of columns. In order to construct an augmented matrix from a linear system, we create a coefficient matrix from the coefficients of the variables in the system, as well as a constant matrix from the constants. The coefficients from one equation of the system create one row of the augmented matrix.

    For example, consider the linear system in Example 1.1.4 \[\begin{array}{c} x+3y+6z=25 \\ 2x+7y+14z=58 \\ 2y+5z=19 \end{array}\nonumber \] This system can be written as an augmented matrix, as follows \[\left[ \begin{array}{rrr|r} 1 & 3 & 6 & 25 \\ 2 & 7 & 14 & 58 \\ 0 & 2 & 5 & 19 \end{array} \right] \nonumber \]

    Notice that it has exactly the same information as the original system. Here it is understood that the first column contains the coefficients from \(x\) in each equation, in order, \(\left[ \begin{array}{r} 1 \\ 2 \\ 0 \end{array} \right] .\) Similarly, we create a column from the coefficients on \(y\) in each equation, \(\left[ \begin{array}{r} 3 \\ 7 \\ 2 \end{array} \right]\) and a column from the coefficients on \(z\) in each equation, \(\left[ \begin{array}{r} 6 \\ 14 \\ 5 \end{array} \right] .\) For a system of more than three variables, we would continue in this way constructing a column for each variable. Similarly, for a system of less than three variables, we simply construct a column for each variable.

    Finally, we construct a column from the constants of the equations, \(\left[ \begin{array}{r} 25\\ 58\\ 19 \end{array} \right] .\)

    In this system, the coefficient matrix refers to \(\left[ \begin{array}{rrr} 1 & 3 & 6 \\ 2 & 7 & 14\\ 0 & 2 & 5\end{array} \right] \) and the constant matrix refers to \(\left[ \begin{array}{r} 25\\ 58\\ 19 \end{array} \right]\).

    The rows of the augmented matrix correspond to the equations in the system. For example, the top row in the augmented matrix, \(\left[ \begin{array}{rrrrr} 1 & 3 & 6 & | & 25 \end{array} \right]\) corresponds to the equation \[x+3y+6z=25.\nonumber \]

    Consider the following definition.

    Definition \(\PageIndex{1}\): Augmented Matrix of a Linear System

    For a linear system of the form \[\begin{array}{c} a_{11}x_{1}+\cdots +a_{1n}x_{n}=b_{1} \\ \vdots \\ a_{m1}x_{1}+\cdots +a_{mn}x_{n}=b_{m} \end{array}\nonumber \] where the \(x_{i}\) are variables and the \(a_{ij}\) and \(b_{i}\) are constants, the augmented matrix of this system is given by \[\left[ \begin{array}{rrr|r} a_{11} & \cdots & a_{1n} & b_{1} \\ \vdots & & \vdots & \vdots \\ a_{m1} & \cdots & a_{mn} & b_{m} \end{array} \right]\nonumber \]

    Now, consider elementary operations in the context of the augmented matrix. The elementary operations in Definition 1.1.4 can be used on the rows just as we used them on equations previously. Changes to a system of equations as a result of an elementary operation are equivalent to changes in the augmented matrix resulting from the corresponding row operation. Note that Theorem 1.1.1 implies that any elementary row operations used on an augmented matrix will not change the solution to the corresponding system of equations. We now formally define elementary row operations. These are the key tool we will use to find solutions to systems of equations.

    Definition \(\PageIndex{2}\): Elementary Row Operations

    The elementary row operations (also known as row operations) consist of the following

    1. Switch two rows.
    2. Multiply a row by a nonzero number.
    3. Replace a row by any multiple of another row added to it.

    Recall how we solved Example 1.1.4. We can do the exact same steps as above, except now in the context of an augmented matrix and using row operations. The augmented matrix of this system is \[\left[ \begin{array}{rrr|r} 1 & 3 & 6 & 25 \\ 2 & 7 & 14 & 58 \\ 0 & 2 & 5 & 19 \end{array} \right]\nonumber \] Thus the first step in solving the system given by (1.1.5) in Example 1.1.4 would be to take \(\left( -2\right)\) times the first row of the augmented matrix and add it to the second row, \[\left[ \begin{array}{rrr|r} 1 & 3 & 6 & 25 \\ 0 & 1 & 2 & 8 \\ 0 & 2 & 5 & 19 \end{array} \right]\nonumber \] Note how this corresponds to (1.1.6) in Example 1.14. Next take \(\left( -2\right)\) times the second row and add to the third, \[\left[ \begin{array}{rrr|r} 1 & 3 & 6 & 25 \\ 0 & 1 & 2 & 8 \\ 0 & 0 & 1 & 3 \end{array} \right]\nonumber \] This augmented matrix corresponds to the system \[\begin{array}{c} x+3y+6z=25 \\ y+2z=8 \\ z=3 \end{array}\nonumber \] which is the same as (1.1.7) in Example 1.1.4. By back substitution you obtain the solution \(x=1,y=2,\) and \(z=3.\)

    Through a systematic procedure of row operations, we can simplify an augmented matrix and carry it to row-echelon form or reduced row-echelon form, which we define next. These forms are used to find the solutions of the system of equations corresponding to the augmented matrix.

    In the following definitions, the term leading entry refers to the first nonzero entry of a row when scanning the row from left to right.

    Definition \(\PageIndex{3}\): Row-Echelon Form

    An augmented matrix is in row-echelon form if

    1. All nonzero rows are above any rows of zeros.
    2. Each leading entry of a row is in a column to the right of the leading entries of any row above it.
    3. Each leading entry of a row is equal to \(1\).

    We also consider another reduced form of the augmented matrix which has one further condition.

    Definition \(\PageIndex{4}\): Reduced Row-Echelon Form

    An augmented matrix is in reduced row-echelon form if

    1. All nonzero rows are above any rows of zeros.
    2. Each leading entry of a row is in a column to the right of the leading entries of any rows above it.
    3. Each leading entry of a row is equal to \(1\).
    4. All entries in a column above and below a leading entry are zero.

    Notice that the first three conditions on a reduced row-echelon form matrix are the same as those for row-echelon form.

    Hence, every reduced row-echelon form matrix is also in row-echelon form. The converse is not necessarily true; we cannot assume that every matrix in row-echelon form is also in reduced row-echelon form. However, it often happens that the row-echelon form is sufficient to provide information about the solution of a system.

    The following examples describe matrices in these various forms. As an exercise, take the time to carefully verify that they are in the specified form.

    Example \(\PageIndex{1}\): Not in Row-Echelon Form

    The following augmented matrices are not in row-echelon form (and therefore also not in reduced row-echelon form).

    \[\left[ \begin{array}{rrr|r} 0 & 0 & 0 & 0 \\ 1 & 2 & 3 & 3 \\ 0 & 1 & 0 & 2 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 \end{array} \right] ,\left[ \begin{array}{rr|r} 1 & 2 & 3 \\ 2 & 4 & -6 \\ 4 & 0 & 7 \end{array} \right] ,\left[ \begin{array}{rrr|r} 0 & 2 & 3 & 3 \\ 1 & 5 & 0 & 2 \\ 7 & 5 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{array} \right] \nonumber\]

    Example \(\PageIndex{2}\): Matrices in Row-Echelon Form

    The following augmented matrices are in row-echelon form, but not in reduced row-echelon form. \[\left[ \begin{array}{rrrrr|r} 1 & 0 & 6 & 5 & 8 & 2 \\ 0 & 0 & 1 & 2 & 7 & 3 \\ 0 & 0 & 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 \end{array} \right] ,\left[ \begin{array}{rrr|r} 1 & 3 & 5 & 4 \\ 0 & 1 & 0 & 7 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 \end{array} \right], \left[ \begin{array}{rrr|r} 1 & 0 & 6 & 0 \\ 0 & 1 & 4 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 \end{array} \right]\nonumber \]

    Notice that we could apply further row operations to these matrices to carry them to reduced row-echelon form. Take the time to try that on your own. Consider the following matrices, which are in reduced row-echelon form.

    Example \(\PageIndex{3}\): Matrices in Reduced Row-Echelon Form

    The following augmented matrices are in reduced row-echelon form. \[\left[ \begin{array}{rrrrr|r} 1 & 0 & 0 & 5 & 0 & 0 \\ 0 & 0 & 1 & 2 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 0 & 0 & 0 \end{array} \right] ,\left[ \begin{array}{rrr|r} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 \end{array} \right] , \left[ \begin{array}{rrr|r} 1 & 0 & 0 & 4 \\ 0 & 1 & 0 & 3 \\ 0 & 0 & 1 & 2 \end{array} \right]\nonumber \]

    One way in which the row-echelon form of a matrix is useful is in identifying the pivot positions and pivot columns of the matrix.

    Definition \(\PageIndex{5}\): Pivot Position and Pivot Column

    A pivot position in a matrix is the location of a leading entry in the row-echelon form of a matrix.

    A pivot column is a column that contains a pivot position.

    For example consider the following.

    Example \(\PageIndex{4}\): Pivot Position

    Let \[A=\left[ \begin{array}{rrr|r} 1 & 2 & 3 & 4 \\ 3 & 2 & 1 & 6 \\ 4 & 4 & 4 & 10 \end{array} \right]\nonumber \] Where are the pivot positions and pivot columns of the augmented matrix \(A\)?

    Solution

    The row-echelon form of this matrix is \[\left[ \begin{array}{rrr|r} 1 & 2 & 3 & 4 \\ 0 & 1 & 2 & \frac{3}{2} \\ 0 & 0 & 0 & 0 \end{array} \right]\nonumber \]

    This is all we need in this example, but note that this matrix is not in reduced row-echelon form.

    In order to identify the pivot positions in the original matrix, we look for the leading entries in the row-echelon form of the matrix. Here, the entry in the first row and first column, as well as the entry in the second row and second column are the leading entries. Hence, these locations are the pivot positions. We identify the pivot positions in the original matrix, as in the following: \[\left[ \begin{array}{rrr|r} \fbox{1} & 2 & 3 & 4 \\ 3 & \fbox{2} & 1 & 6 \\ 4 & 4 & 4 & 10 \end{array} \right]\nonumber \] Thus the pivot columns in the matrix are the first two columns.

    The following is an algorithm for carrying a matrix to row-echelon form and reduced row-echelon form. You may wish to use this algorithm to carry the above matrix to row-echelon form or reduced row-echelon form yourself for practice.

    Algorithm \(\PageIndex{1}\): Reduced Row-Echelon Form Algorithm

    This algorithm provides a method for using row operations to take a matrix to its reduced row-echelon form. We begin with the matrix in its original form.

    1. Starting from the left, find the first nonzero column. This is the first pivot column, and the position at the top of this column is the first pivot position. Switch rows if necessary to place a nonzero number in the first pivot position.
    2. Use row operations to make the entries below the first pivot position (in the first pivot column) equal to zero.
    3. Ignoring the row containing the first pivot position, repeat steps 1 and 2 with the remaining rows. Repeat the process until there are no more rows to modify.
    4. Divide each nonzero row by the value of the leading entry, so that the leading entry becomes \(1\). The matrix will then be in row-echelon form.

      The following step will carry the matrix from row-echelon form to reduced row-echelon form.

    5. Moving from right to left, use row operations to create zeros in the entries of the pivot columns which are above the pivot positions. The result will be a matrix in reduced row-echelon form.

    Most often we will apply this algorithm to an augmented matrix in order to find the solution to a system of linear equations. However, we can use this algorithm to compute the reduced row-echelon form of any matrix which could be useful in other applications.

    Consider the following example of applying Algorithm \(\PageIndex{1}\).

    Example \(\PageIndex{5}\): Finding Row-Echelon Form and Reduced Row-Echelon Form of a Matrix

    Let \[A = \left[ \begin{array}{rrr} 0 & -5 & -4 \\ 1 & 4 & 3 \\ 5 & 10 & 7 \end{array} \right]\nonumber \] Find the row-echelon form of \(A\). Then complete the process until \(A\) is in reduced row-echelon form.

    Solution

    In working through this example, we will use the steps outlined in Algorithm \(\PageIndex{1}\).

    1. The first pivot column is the first column of the matrix, as this is the first nonzero column from the left. Hence the first pivot position is the one in the first row and first column. Switch the first two rows to obtain a nonzero entry in the first pivot position, outlined in a box below. \[\left[ \begin{array}{rrr} \fbox{1} & 4 & 3 \\ 0 & -5 & -4 \\ 5 & 10 & 7 \end{array} \right]\nonumber \]
    2. Step two involves creating zeros in the entries below the first pivot position. The first entry of the second row is already a zero. All we need to do is subtract \(5\) times the first row from the third row. The resulting matrix is \[\left[ \begin{array}{rrr} 1 & 4 & 3 \\ 0 & -5 & -4 \\ 0 & 10 & 8 \end{array} \right]\nonumber \]
    3. Now ignore the top row. Apply steps \(1\) and \(2\) to the smaller matrix \[\left[ \begin{array}{rr} -5 & -4\\ 10 & 8 \end{array} \right]\nonumber \] In this matrix, the first column is a pivot column, and \(-5\) is in the first pivot position. Therefore, we need to create a zero below it. To do this, add \(2\) times the first row (of this matrix) to the second. The resulting matrix is \[\left[ \begin{array}{rr} -5 & -4\\ 0 & 0 \end{array} \right]\nonumber \] Our original matrix now looks like \[\left[ \begin{array}{rrr} 1 & 4 & 3 \\ 0 & -5 & -4 \\ 0 & 0 & 0 \end{array} \right]\nonumber \] We can see that there are no more rows to modify.
    4. Now, we need to create leading \(1\)s in each row. The first row already has a leading \(1\) so no work is needed here. Divide the second row by \(-5\) to create a leading \(1\). The resulting matrix is \[\left[ \begin{array}{rrr} 1 & 4 & 3 \\ 0 & 1 & \frac{4}{5} \\ 0 & 0 & 0 \end{array} \right]\nonumber \] This matrix is now in row-echelon form.
    5. Now create zeros in the entries above pivot positions in each column, in order to carry this matrix all the way to reduced row-echelon form. Notice that there is no pivot position in the third column so we do not need to create any zeros in this column! The column in which we need to create zeros is the second. To do so, subtract \(4\) times the second row from the first row. The resulting matrix is \[\left[ \begin{array}{rrr} 1 & 0 & - \frac{1}{5} \\ 0 & 1 & \frac{4}{5} \\ 0 & 0 & 0 \end{array} \right]\nonumber \]

    This matrix is now in reduced row-echelon form.

    The above algorithm gives you a simple way to obtain the row-echelon form and reduced row-echelon form of a matrix. The main idea is to do row operations in such a way as to end up with a matrix in row-echelon form or reduced row-echelon form. This process is important because the resulting matrix will allow you to describe the solutions to the corresponding linear system of equations in a meaningful way.

    In the next example, we look at how to solve a system of equations using the corresponding augmented matrix.

    Example \(\PageIndex{6}\): Finding the Solution to a System

    Give the complete solution to the following system of equations \[\begin{array}{c} 2x+4y-3z=-1\\ 5x+10y-7z=-2\\ 3x+6y+5z=9 \end{array}\nonumber \]

    Solution

    The augmented matrix for this system is \[\left[ \begin{array}{rrr|r} 2 & 4 & -3 & -1 \\ 5 & 10 & -7 & -2 \\ 3 & 6 & 5 & 9 \end{array} \right]\nonumber \]

    In order to find the solution to this system, we wish to carry the augmented matrix to reduced row-echelon form. We will do so using Algorithm \(\PageIndex{1}\). Notice that the first column is nonzero, so this is our first pivot column. The first entry in the first row, \(2\), is the first leading entry and it is in the first pivot position. We will use row operations to create zeros in the entries below the \(2\). First, replace the second row with \(-5\) times the first row plus \(2\) times the second row. This yields \[\left[ \begin{array}{rrr|r} 2 & 4 & -3 & -1 \\ 0 & 0 & 1 & 1 \\ 3 & 6 & 5 & 9 \end{array} \right]\nonumber \] Now, replace the third row with \(-3\) times the first row plus \(2\) times the third row. This yields \[\left[ \begin{array}{rrr|r} 2 & 4 & -3 & -1 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 19 & 21 \end{array} \right]\nonumber \] Now the entries in the first column below the pivot position are zeros. We now look for the second pivot column, which in this case is column three. Here, the \(1\) in the second row and third column is in the pivot position. We need to do just one row operation to create a zero below the \(1\).

    Taking \(-19\) times the second row and adding it to the third row yields \[\left[ \begin{array}{rrr|r} 2 & 4 & -3 & -1 \\ 0 & 0 & 1 & 1 \\ 0 & 0 & 0 & 2 \end{array} \right]\nonumber \]

    We could proceed with the algorithm to carry this matrix to row-echelon form or reduced row-echelon form. However, remember that we are looking for the solutions to the system of equations. Take another look at the third row of the matrix. Notice that it corresponds to the equation \[0x+0y+0z=2\nonumber \] There is no solution to this equation because for all \(x,y,z\), the left side will equal \(0\) and \(0\neq 2.\) This shows there is no solution to the given system of equations. In other words, this system is inconsistent.

    Watch the accompanying video for a visual demonstration of the this concept.
    • Video Length: 9 minutes 41 seconds.
    • Context: This video demonstrates how to solve a system of three equations using an augmented matrix and finding the reduced row echelon form for the linear system:

      \(\begin{array}{c} x+2y-z=-10 \\ 2x-3y+2z=2\\ x+y+3z=0 \end{array} \)

    The following is another example of how to find the solution to a system of equations by carrying the corresponding augmented matrix to reduced row-echelon form.

    Example \(\PageIndex{7}\): An Infinite Set of Solutions

    Give the complete solution to the system of equations \[\begin{array}{c} 3x-y-5z=9 \\ y-10z=0 \\ -2x+y=-6 \end{array}\label{eq:1.8}\]

    Solution

    The augmented matrix of this system is \[\left[ \begin{array}{rrr|r} 3 & -1 & -5 & 9 \\ 0 & 1 & -10 & 0 \\ -2 & 1 & 0 & -6 \end{array} \right]\nonumber \] In order to find the solution to this system, we will carry the augmented matrix to reduced row-echelon form, using Algorithm \(\PageIndex{1}\). The first column is the first pivot column. We want to use row operations to create zeros beneath the first entry in this column, which is in the first pivot position. Replace the third row with \(2\) times the first row added to \(3\) times the third row. This gives

    \[\left[ \begin{array}{rrr|r} 3 & -1 & -5 & 9 \\ 0 & 1 & -10 & 0 \\ 0 & 1 & -10 & 0 \end{array} \right]\nonumber \]

    Now, we have created zeros beneath the \(3\) in the first column, so we move on to the second pivot column (which is the second column) and repeat the procedure. Take \(-1\) times the second row and add to the third row. \[\left[ \begin{array}{rrr|r} 3 & -1 & -5 & 9 \\ 0 & 1 & -10 & 0 \\ 0 & 0 & 0 & 0 \end{array} \right]\nonumber \] The entry below the pivot position in the second column is now a zero. Notice that we have no more pivot columns because we have only two leading entries.

    At this stage, we also want the leading entries to be equal to one. To do so, divide the first row by \(3\). \[\left[ \begin{array}{rrr|r} 1 & - \frac{1}{3} & - \frac{5}{3} & 3 \\ 0 & 1 & -10 & 0 \\ 0 & 0 & 0 & 0 \end{array} \right]\nonumber \]

    This matrix is now in row-echelon form.

    Let’s continue with row operations until the matrix is in reduced row-echelon form. This involves creating zeros above the pivot positions in each pivot column. This requires only one step, which is to add \(\frac{1}{3}\) times the second row to the first row. \[\left[ \begin{array}{rrr|r} 1 & 0 & -5 & 3 \\ 0 & 1 & -10 & 0 \\ 0 & 0 & 0 & 0 \end{array} \right]\nonumber \]

    This is in reduced row-echelon form, which you should verify using Definition \(\PageIndex{4}\). The equations corresponding to this reduced row-echelon form are \[\begin{array}{c} x - 5z=3 \\ y - 10z = 0 \end{array}\nonumber \] or \[\begin{array}{c} x=3+5z \\ y = 10z \end{array}\nonumber \]

    Observe that \(z\) is not restrained by any equation. In fact, \(z\) can equal any number. For example, we can let \(z = t\), where we can choose \(t\) to be any number. In this context \(t\) is called a parameter . Therefore, the solution set of this system is \[\begin{array}{c} x=3+5t \\ y=10t \\ z=t \end{array}\nonumber \] where \(t\) is arbitrary. The system has an infinite set of solutions which are given by these equations. For any value of \(t\) we select, \(x, y,\) and \(z\) will be given by the above equations. For example, if we choose \(t=4\) then the corresponding solution would be \[\begin{array}{c} x = 3 + 5 (4) = 23\\ y = 10(4)=40 \\ z=4 \end{array}\nonumber \]

    In Example \(\PageIndex{7}\) the solution involved one parameter. It may happen that the solution to a system involves more than one parameter, as shown in the following example.

    Example \(\PageIndex{8}\): A Two Parameter Set of Solutions

    Find the solution to the system \[\begin{array}{c} x+2y-z+w=3 \\ x+y-z+w=1 \\ x+3y-z+w=5 \end{array}\nonumber \]

    Solution

    The augmented matrix is \[\left[ \begin{array}{rrrr|r} 1 & 2 & -1 & 1 & 3 \\ 1 & 1 & -1 & 1 & 1 \\ 1 & 3 & -1 & 1 & 5 \end{array} \right]\nonumber \] We wish to carry this matrix to row-echelon form. Here, we will outline the row operations used. However, make sure that you understand the steps in terms of Algorithm \(\PageIndex{1}\).

    Take \(-1\) times the first row and add to the second. Then take \(-1\) times the first row and add to the third. This yields \[\left[ \begin{array}{rrrr|r} 1 & 2 & -1 & 1 & 3 \\ 0 & -1 & 0 & 0 & -2 \\ 0 & 1 & 0 & 0 & 2 \end{array} \right]\nonumber \]

    Now add the second row to the third row and divide the second row by \(-1\). \[\left[ \begin{array}{rrrr|r} 1 & 2 & -1 & 1 & 3 \\ 0 & 1 & 0 & 0 & 2 \\ 0 & 0 & 0 & 0 & 0 \end{array} \right] \label{twoparameters1}\]

    This matrix is in row-echelon form and we can see that \(x\) and \(y\) correspond to pivot columns, while \(z\) and \(w\) do not. Therefore, we will assign parameters to the variables \(z\) and \(w\). Assign the parameter \(s\) to \(z\) and the parameter \(t\) to \(w.\) Then the first row yields the equation \(x+2y-s+t=3\), while the second row yields the equation \(y=2\). Since \(y=2\), the first equation becomes \(x+4-s+t=3\) showing that the solution is given by \[\begin{array}{c} x=-1+s-t \\ y=2 \\ z=s \\ w=t \end{array}\nonumber \] It is customary to write this solution in the form \[\left[ \begin{array}{c} x \\ y \\ z \\ w \end{array} \right] =\left[ \begin{array}{c} -1+s-t \\ 2 \\ s \\ t \end{array} \right] \label{twoparameters2}\]

    This example shows a system of equations with an infinite solution set which depends on two parameters. It can be less confusing in the case of an infinite solution set to first place the augmented matrix in reduced row-echelon form rather than just row-echelon form before seeking to write down the description of the solution.

    In the above steps, this means we don’t stop with the row-echelon form in equation (). Instead we first place it in reduced row-echelon form as follows. \[\left[ \begin{array}{rrrr|r} 1 & 0 & -1 & 1 & -1 \\ 0 & 1 & 0 & 0 & 2 \\ 0 & 0 & 0 & 0 & 0 \end{array} \right]\nonumber \] Then the solution is \(y=2\) from the second row and \(x=-1+z-w\) from the first. Thus letting \(z=s\) and \(w=t,\) the solution is given by (1.2.3).

    You can see here that there are two paths to the correct answer, which both yield the same answer. Hence, either approach may be used. The process which we first used in the above solution is called Gaussian Elimination This process involves carrying the matrix to row-echelon form, converting back to equations, and using back substitution to find the solution. When you do row operations until you obtain reduced row-echelon form, the process is called Gauss-Jordan Elimination.

    We have now found solutions for systems of equations with no solution and infinitely many solutions, with one parameter as well as two parameters. Recall the three types of solution sets which we discussed in the previous section; no solution, one solution, and infinitely many solutions. Each of these types of solutions could be identified from the graph of the system. It turns out that we can also identify the type of solution from the reduced row-echelon form of the augmented matrix.

    • No Solution: In the case where the system of equations has no solution, the row-echelon form of the augmented matrix will have a row of the form \[\left[ \begin{array}{rrrrr} 0 & 0 & 0 & | & 1 \end{array} \right]\nonumber \] This row indicates that the system is inconsistent and has no solution.
    • One Solution: In the case where the system of equations has one solution, every column of the coefficient matrix is a pivot column. The following is an example of an augmented matrix in reduced row-echelon form for a system of equations with one solution. \[\left[ \begin{array}{rrr|r} 1 & 0 & 0 & 5 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 2 \end{array} \right]\nonumber \]
    • Infinitely Many Solutions: In the case where the system of equations has infinitely many solutions, the solution contains parameters. There will be columns of the coefficient matrix which are not pivot columns. The following are examples of augmented matrices in reduced row-echelon form for systems of equations with infinitely many solutions. \[\left[ \begin{array}{rrr|r} 1 & 0 & 0 & 5 \\ 0 & 1 & 2 & -3 \\ 0 & 0 & 0 & 0 \end{array} \right]\nonumber \] or \[\left[ \begin{array}{rrr|r} 1 & 0 & 0 & 5 \\ 0 & 1 & 0 & -3 \end{array} \right]\nonumber \]

    Uniqueness of Reduced Row Echelon Form

    As we have seen, we know that every matrix can be brought into reduced row-echelon form by a sequence of elementary row operations. We will now prove that the resulting matrix is unique; in other words, the resulting matrix in reduced row-echelon does not depend upon the particular sequence of elementary row operations or the order in which they were performed.

    Let \(A\) be the augmented matrix of a homogeneous system of linear equations in the variables \(x_1, x_2, \cdots, x_n\) which is also in reduced row-echelon form. The matrix \(A\) divides the set of variables in two different types. We say that \(x_i\) is a basic variable whenever \(A\) has a leading \(1\) in column number \(i\), in other words, when column \(i\) is a pivot column. Otherwise we say that \(x_i\) is a free variable.

    Recall Example \(\PageIndex{8}\) above. We continue with it in the following example.

    Example \(\PageIndex{9}\): Basic and Free Variables

    Find the basic and free variables in the system \[\begin{array}{c} x+2y-z+w=3 \\ x+y-z+w=1 \\ x+3y-z+w=5 \end{array}\nonumber \]

    Solution

    Recall from the solution of Example 1.2.8 that the row-echelon form of the augmented matrix of this system is given by \[\left [ \begin{array}{rrrr|r} 1 & 2 & -1 & 1 & 3 \\ 0 & 1 & 0 & 0 & 2 \\ 0 & 0 & 0 & 0 & 0 \end{array} \right ]\nonumber \] You can see that columns \(1\) and \(2\) are pivot columns. These columns correspond to variables \(x\) and \(y\), making these the basic variables. Columns \(3\) and \(4\) are not pivot columns, which means that \(z\) and \(w\) are free variables.

    We can write the solution to this system as \[\begin{array}{c} x=-1+s-t \\ y=2 \\ z=s \\ w=t \end{array}\nonumber \]

    Here the free variables are written as parameters, and the basic variables are given by linear functions of these parameters.

    In general, all solutions can be written in terms of the free variables. In such a description, the free variables can take any values (they become parameters), while the basic variables become simple linear functions of these parameters. Indeed, a basic variable \(x_i\) is a linear function of only those free variables \(x_j\) with \(j>i\). This leads to the following observation.

    Proposition \(\PageIndex{1}\): Basic and Free Variables

    If \(x_i\) is a basic variable of a homogeneous system of linear equations, then any solution of the system with \(x_j=0\) for all those free variables \(x_j\) with \(j>i\) must also have \(x_i=0\).

    Using this proposition, we prove a lemma which will be used in the proof of the main result of this section below.

    Lemma \(\PageIndex{1}\): Solutions and the Reduced Row-Echelon Form of a Matrix

    Let \(A\) and \(B\) be two distinct augmented matrices for two homogeneous systems of \(m\) equations in \(n\) variables, such that \(A\) and \(B\) are each in reduced row-echelon. Then, the two systems do not have exactly the same solutions.

    Proof

    With respect to the linear systems associated with the matrices \(A\) and \(B\), there are two cases to consider:

    • Case \(1\): the two systems have the same basic variables
    • Case \(2\): the two systems do not have the same basic variables

    In case \(1\), the two matrices will have exactly the same pivot positions. However, since \(A\) and \(B\) are not identical, there is some row of \(A\) which is different from the corresponding row of \(B\) and yet the rows each have a pivot in the same column position. Let \(i\) be the index of this column position. Since the matrices are in reduced row-echelon form, the two rows must differ at some entry in a column \(j>i\). Let these entries be \(a\) in \(A\) and \(b\) in \(B\), where \(a \neq b\). Since \(A\) is in reduced row-echelon form, if \(x_j\) were a basic variable for its linear system, we would have \(a=0\). Similarly, if \(x_j\) were a basic variable for the linear system of the matrix \(B\), we would have \(b=0\). Since \(a\) and \(b\) are unequal, they cannot both be equal to \(0\), and hence \(x_j\) cannot be a basic variable for both linear systems. However, since the systems have the same basic variables, \(x_j\) must then be a free variable for each system. We now look at the solutions of the systems in which \(x_j\) is set equal to \(1\) and all other free variables are set equal to \(0\). For this choice of parameters, the solution of the system for matrix \(A\) has \(x_j=-a\), while the solution of the system for matrix \(B\) has \(x_j=-b\), so that the two systems have different solutions.

    In case \(2\), there is a variable \(x_i\) which is a basic variable for one matrix, let’s say \(A\), and a free variable for the other matrix \(B\). The system for matrix \(B\) has a solution in which \(x_i=1\) and \(x_j=0\) for all other free variables \(x_j\). However, by Proposition \(\PageIndex{1}\)this cannot be a solution of the system for the matrix \(A\). This completes the proof of case \(2\).

    Now, we say that the matrix \(B\) is equivalent (or row equivalent) to the matrix \(A\) provided that \(B\) can be obtained from \(A\) by performing a sequence of elementary row operations beginning with \(A\). The importance of this concept lies in the following result.

    Theorem \(\PageIndex{1}\): Row Equivalent Matrices

    The two linear systems of equations corresponding to two row equivalent augmented matrices have exactly the same solutions.

    Proof

    The proof of this theorem is left as an exercise.

    Now, we can use Lemma \(\PageIndex{1}\) and Theorem \(\PageIndex{1}\) to prove the main result of this section.

    Theorem \(\PageIndex{2}\): Uniqueness of the Reduced Row-Echelon Form

    Every matrix \(A\) is row equivalent to a unique matrix in reduced row-echelon form.

    Proof

    Let \(A\) be an \(m \times n\) matrix and let \(B\) and \(C\) be matrices in reduced row-echelon form, each equivalent to \(A\). It suffices to show that \(B=C\).

    Let \(A^{+}\) be the matrix \(A\) augmented with a new rightmost column consisting entirely of zeros. Similarly, augment matrices \(B\) and \(C\) each with a rightmost column of zeros to obtain \(B^{+}\) and \(C^{+}\). Note that \(B^{+}\) and \(C^{+}\) are matrices in reduced row-echelon form which are obtained from \(A^{+}\) by respectively applying the same sequence of elementary row operations which were used to obtain \(B\) and \(C\) from \(A\).

    Now, \(A^{+}\), \(B^{+}\), and \(C^{+}\) can all be considered as augmented matrices of homogeneous linear systems in the variables \(x_1, x_2, \cdots, x_n\). Because \(B^{+}\) and \(C^{+}\) are each equivalent to \(A^{+}\), Theorem \(\PageIndex{1}\) ensures that all three homogeneous linear systems have exactly the same solutions. By Lemma \(\PageIndex{1}\) we conclude that \(B^{+}=C^{+}\). By construction, we must also have \(B=C\).

    According to this theorem we can say that each matrix \(A\) has a unique reduced row-echelon form.


    This page titled 1.2: Gaussian Elimination is shared under a CC BY 4.0 license and was authored, remixed, and/or curated by Doli Bambhania, Fatemeh Yarahmadi, and Bill Wilson.