Exercise RREF.C19

Find all solutions to the system of linear equations:

\(\begin{array} 2x_1 + x_2 = 6 \\ -x_1 - x_2 = -2 \\ 3x_1 + 4x_2 = 4 \\ 3x_1 + 5x_2 = 2 \end{array}\)

The first thing to note here is that we have 2 variables/unknowns, yet we have 4 equations. This implies that we have more information than we need to solve this system of linear equations. This is will become obvious once we format the system into row echelon form.

First, we write the system of equations into augmented matrix form:

\(\begin{vmatrix} 2 & 1 & 6 \\ -1 & -1 & 2 \\ 3 & 4 & 4 \\ 3 & 5 & 2 \end{vmatrix}\)

We then proceed with the following row operations:

\(R_2 = -R_2 \\ R_2 \longleftrightarrow R_1\)

This is an easier format to work with the first column as a pivot column:

\(\begin{vmatrix} 1 & 1 & 2 \\ 2 & 1 & 6 \\ 3 & 4 & 4 \\ 3 & 5 & 2 \end{vmatrix}\)

We proceed with the following row operations:

\(R_2 = R_2-2R_1 \\ R_3 = R_3 - 3R_1 \\ R_4 = R_4 - 3R_1\)

\(\begin{vmatrix} 1 & 1 & 2 \\ 0 & -1 & 2 \\ 0 & 1 & -2 \\ 0 & 2 & 4 \end{vmatrix}\)

Now it is obvious that the last 3 equations are multiples of each other. We select the 3rd row and ignore the 2nd and 4th (which reduce to 0 = 0) to yield the following matrix in row echelon form:

\(\begin{vmatrix} 1 & 1 & 2 \\ 0 & 1 & -2 \end{vmatrix}\)

Let’s rewrite the system:

\(\begin{array}{rcr} x_1 + x_2 & = & 2 \\ x_2 & = & -2 \end{array}\)

Substituting \(x_2 = -2\) into the first equation we get that \(x_1 = 4\)

The solution set then can then be written as:

\(S = \begin{Bmatrix} 4 \\ -2 \end{Bmatrix}\)

Using R

An R approach using only the first two equations in the system:

A <- matrix(c(2, -1, 1, -1), 2, 2)
b <- c(6, -2)
solve(A,b)
## [1]  4 -2