Skip to main content
Logo image

Section 1.1 Solving Linear Systems

We will
  • find solutions (sets of values) to linear systems like
    \begin{equation*} \begin{array}{rrrr} x & -3y & +2z= & 8. \\ 2x & -y & +z= & 10. \\ 4x & +2y & -3z= & 10. \\ \end{array} \end{equation*}
  • learn an efficient algorithm for solving these,
  • learn an efficient notation for this algorithm.
By the end of this section
  • you will understand how the method of elimination works,
  • you will know what types of solutions can occur,
  • you will be able to solve systems using Gaussian elimination

Subsection 1.1.1 Solving by Elimination

This example illustrates the process of solving a system of linear equations by elimination. Notice how equations are used as tools to simplify other equations.
We will solve this system of linear equations.
\begin{equation*} \begin{array}{l*{3}{r}rl} & x & -3y & +2z= & 8. & E1 \\ & 2x & -y & +z= & 10. & E2 \\ & 4x & +2y & -3z= & 10. & E3 \end{array} \end{equation*}
We modify the first equation so that its first coefficient has the same magnitude but oppositely signed value as the first coefficient of the second equation. Then we add this modified equation one to equation 2. Note the effect.
\begin{equation*} \begin{array}{l*{3}{r}rl} -2( & x & -3y & +2z)= & -2(8). & E1 \\ & -2x & +6y & -4z= & -16. \\ + & 2x & -y & +z= & 10. & E2 \\ & & 5y & -3z= & -6. & E4 \end{array} \end{equation*}
Next is eliminating the first term of the third equation using the same method.
\begin{equation*} \begin{array}{l*{3}{r}rl} -4( & x & -3y & +2z)= & -4(8). & E1 \\ & -4x & +12y & -8z= & -32. \\ + & 4x & +2y & -3z= & 10. & E3 \\ & & 14y & -11z= & -22. & E5 \end{array} \end{equation*}
\begin{equation*} \begin{array}{r*{2}{r}rl} & 5y & -3z= & -6. & E4 \\ & 14y & -11z= & -22. & E5 \\ \\ -\frac{14}{5}( & 5y & -3z)= & -\frac{14}{5}(-6). & E4 \\ & -14y & +\frac{42}{5}z= & \frac{84}{5}. & \\ + & 14y & -11z= & -22. & E5 \\ & & -\frac{13}{5}z= & -\frac{26}{5}. & E6 \\ & & z & 2. \end{array} \end{equation*}
\begin{equation*} \begin{array}{*{3}{r}rl} & & z= & 2. & E6 \\ & 5y & -3z= & -6. & E4 \\ & 5y & -3(2)= & -6. & \\ & 5y & = & 0. & \\ & y & = & 0. & E7 \\ \\ & & z= & 2. & E6 \\ & y & = & 0. & E7 \\ x & -3y & +2z= & 8. & E1 \\ x & -3(0) & +2(2)= & 8. & \\ x & & = & 4. & \end{array} \end{equation*}
Thus the solution is \((4,0,2)\)
Review these steps and check if the variables, particularly the symbols, were important. Clearly we could use three other symbols and obtain the same numeric result. Also we do not use the symbols in the solution but know which is which. Do you think we could eliminate the symbols altogether and still keep track of each variable?

Subsection 1.1.2 A More Efficient Notation

Here we will work the exact same problem, but we will skip writing the symbols for the variables. Compare this notation to the previous example to see how we keep track of each variable.
We start with the same system.
\(\begin{array}{*{3}{r}r} x & -3y & +2z= & 8. \\ 2x & -y & +z= & 10. \\ 4x & +2y & -3z= & 10. \\ \end{array}\)
\(\left[ \begin{array}{rrr|r} 1 & -3 & 2 & 8 \\ 2 & -1 & 1 & 10 \\ 4 & 2 & -3 & 10 \end{array} \right]\)
\(\begin{array}[b]{l} \\ R_2 \leftarrow -2R_1+R_2 \\ \end{array}\)
\(\begin{array}{r*{3}{r}r} -2( & x & -3y & +2z)= & -2(8). \\ & -2x & +6y & -4z= & -16. \\ + & 2x & -y & +z= & 10. \\ & & 5y & -3z= & -6. \end{array}\)
\(\left[ \begin{array}{rrr|r} 1 & -3 & 2 & 8 \\ 0 & 5 & -3 & -6 \\ 4 & 2 & -3 & 10 \end{array} \right]\)
\(\begin{array}{l} \\ \\ R_3 \leftarrow -4R_1+R_3 \end{array}\)
\(\begin{array}{r*{3}{r}r} -4( & x & -3y & +2z)= & -4(8). \\ & -4x & +12y & -8z= & -32. \\ + & 4x & +2y & -3z= & 10. \\ & & 14y & -11z= & -22. \end{array}\)
\(\left[ \begin{array}{rrr|r} 1 & -3 & 2 & 8 \\ 0 & 5 & -3 & -6 \\ 0 & 14 & -11 & -22 \end{array} \right]\)
\(\begin{array}{*{2}{r}r} 5y & -3z= & -6. \\ 14y & -11z= & -22. \end{array}\)
\(\left[ \begin{array}{rrr|r} 1 & -3 & 2 & 8 \\ 0 & 5 & -3 & -6 \\ 0 & 14 & -11 & -22 \end{array} \right]\)
\(\begin{array}{l} \\ \\ R_3 \leftarrow -\frac{14}{5}R_2+R_3 \end{array}\)
\(\begin{array}{r*{2}{r}r} -\frac{14}{5}( & 5y & -3z)= & -\frac{14}{5}(-6). \\ & -14y & +\frac{42}{5}z= & \frac{84}{5}. \\ + & 14y & -11z= & -22. \\ & & -\frac{13}{5}z= & -\frac{26}{5}. \\ \end{array}\)
\(\left[ \begin{array}{rrr|r} 1 & -3 & 2 & 8 \\ 0 & 5 & -3 & -6 \\ 0 & 0 & -\frac{13}{5} & -\frac{26}{5} \\ \end{array} \right]\)
\(\begin{array}{l} \\ \\ R_3 \leftarrow -\frac{5}{13}R_3 \end{array}\)
\(\begin{array}{r*{2}{r}r} & & -\frac{13}{5}z= & -\frac{26}{5}. \\ & & z= & 2. \end{array}\)
\(\left[ \begin{array}{rrr|r} 1 & -3 & 2 & 8 \\ 0 & 5 & -3 & -6 \\ 0 & 0 & 1 & 2 \\ \end{array} \right]\)
\(\begin{array}{*{3}{r}r} x & -3y & +2z= & 8. \\ & 5y & -3z= & -6. \\ & & z= & 2. \\ \end{array}\)
\(\left[ \begin{array}{rrr|r} 1 & -3 & 2 & 8 \\ 0 & 5 & -3 & -6 \\ 0 & 0 & 1 & 2 \\ \end{array} \right]\)
\(\begin{array}[b]{l} \\ R_2 \leftarrow 3R_3+R_2 \\ \end{array}\)
\(\begin{array}{r*{2}{r}r} 3( & & z)= & 3(2). \\ & & 3z= & 6. \\ & 5y & -3z= & -6. \\ & 5y & = & 0. \\ \end{array}\)
\(\left[ \begin{array}{rrr|r} 1 & -3 & 2 & 8 \\ 0 & 5 & 0 & 0 \\ 0 & 0 & 1 & 2 \\ \end{array} \right]\)
\(\begin{array}[b]{l} \\ R_2 \leftarrow \frac{1}{5}R_2 \\ \end{array}\)
\(\begin{array}{r*{2}{r}r} \frac{1}{5}( 5y & ) & = & \frac{1}{5}(0). \\ y & & = & 0. \end{array}\)
\(\left[ \begin{array}{rrr|r} 1 & -3 & 2 & 8 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 2 \\ \end{array} \right]\)
\(\begin{array}{*{3}{r}r} x & -3y & +2z= & 8. \\ & y & = & 0. \\ & & z= & 2. \end{array}\)
\(\left[ \begin{array}{rrr|r} 1 & -3 & 2 & 8 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 2 \end{array} \right]\)
\(\begin{array}[b]{l} R_1 \leftarrow -2R_3+R_1 \\ \\ \end{array}\)
\(\begin{array}{r*{3}{r}r} -2( & & & z)= & -2(2). \\ & & & -2z= & -4. \\ & x & -3y & 2z= & 8. \\ & x & -3y & = & 4. \end{array} \)
\(\left[ \begin{array}{rrr|r} 1 & -3 & 0 & 4 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 2 \end{array} \right]\)
\(\begin{array}[b]{l} R_1 \leftarrow 3R_2+R_1 \\ \\ \end{array}\)
\(\begin{array}{r*{3}{r}r} 3( & & y & ) = & 3(0). \\ & & 3y & =& 0. \\ & x & -3y & = & 4. \\ & x & & = & 4. \end{array} \)
\(\left[ \begin{array}{rrr|r} 1 & 0 & 0 & 4 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 2 \end{array} \right]\)
Thus the solution is \((4,0,2) \text{.}\)

Subsection 1.1.3 Non-Unique Solutions

Sometimes the elimination process has different results.
\(\left[ \begin{array}{*{4}{r}} 1 & 4 & -1 & 1 \\ 1 & 5 & 1 & 8 \\ 1 & 7 & 5 & 22 \\ \end{array} \right]\)
\(\begin{array}{l} \\ R_2 \leftarrow -1R_1+R_2 \\ R_3 \leftarrow -1R_1+R_3 \\ \end{array}\)
\(\left[ \begin{array}{*{4}{r}} 1 & 4 & -1 & 1 \\ 0 & 1 & 2 & 7 \\ 0 & 3 & 6 & 21 \\ \end{array} \right]\)
\(\begin{array}{l} \\ \\ R_3 \leftarrow -3R_2+R_3 \\ \end{array}\)
\(\left[ \begin{array}{*{4}{r}} 1 & 4 & -1 & 1 \\ 0 & 1 & 2 & 7 \\ 0 & 0 & 0 & 0 \\ \end{array} \right]\)
\(\begin{array}{l} R_1 \leftarrow -4R_2+R_1 \\ \\ \\ \end{array}\)
\(\left[ \begin{array}{*{4}{r}} 1 & 0 & -9 & -27 \\ 0 & 1 & 2 & 7 \\ 0 & 0 & 0 & 0 \\ \end{array} \right]\)
This final matrix gives us the following relationships between the variables. \(x-9z=-27\) and \(y+2z=7\text{.}\) Thus we can write the solution \(( -27-9z, 7-2z, z )\)

Subsection 1.1.4 Terminology

The following terminology will be used throught this course.
  • Gaussian elimination with back substitution
  • Gauss-Jordan elimination
  • Upper triangular
  • Row echelon form
  • Pivot position