# Systems of Equations and Inequalities

## Solving Systems with Gaussian Elimination


### Learning Objectives

1. Use row operations on a matrix (IA 4.5.2)
2. Solve systems of equations using matrices (IA 4.5.3)

### Objective 1: Use row operations on a matrix (IA 4.5.2)

In the last section, we learned how to write the augmented matrix for a system of equations.

Once a system of equations is in its augmented matrix form, we will solve by elimination by performing operations on the rows that will lead us to the solution. Our goal will be to get 1 on the diagonal of the matrix and all entries below the diagonal must be zeros.


### Row Operations

In a matrix, the following operations can be performed on any row and the resulting matrix will be equivalent to the original matrix.

1. Interchange any two rows.
2. Multiply a row by any real number except 0.
3. Add a nonzero multiple of one row to another row.
These actions are called row operations and will help us use the matrix to solve a system of equations.


### Practice Makes Perfect


### Objective 2: Solve systems of equations using matrices (IA 4.5.3)

To solve a system of equations using matrices, we transform the augmented matrix into a matrix in row-echelon form using row operations. For a consistent and independent system of equations, the augmented matrix is in row-echelon form when to the left of the vertical line, each entry on the diagonal is a 1 and all entries below the diagonal are zeros.


Once we get the augmented matrix into row-echelon form, we can write the equivalent system of equations and solve for at least one variable. We then substitute this value in another equation to continue to solve for the other variables.


### Practice Makes Perfect

Carl Friedrich Gauss lived during the late 18th century and early 19th century, but he is still considered one of the most prolific mathematicians in history. His contributions to the science of mathematics and physics span fields such as algebra, number theory, analysis, differential geometry, astronomy, and optics, among others. His discoveries regarding matrix theory changed the way mathematicians have worked for the last two centuries.
We first encountered Gaussian elimination in Systems of Linear Equations: Two Variables. In this section, we will revisit this technique for solving systems, this time using matrices.

### Writing the Augmented Matrix of a System of Equations

A matrix can serve as a device for representing and solving a system of equations. To express a system in matrix form, we extract the coefficients of the variables and the constants, and these become the entries of the matrix. We use a vertical line to separate the coefficient entries from the constants, essentially replacing the equal signs. When a system is written in this form, we call it an augmented matrix.
For example, consider the following 
  system of equations.
We can write this system as an augmented matrix:
We can also write a matrix containing just the coefficients. This is called the coefficient matrix.
A three-by-three system of equations such as
has a coefficient matrix
and is represented by the augmented matrix
Notice that the matrix is written so that the variables line up in their own columns: x-terms go in the first column, y-terms in the second column, and z-terms in the third column. It is very important that each equation is written in standard form 
  so that the variables line up. When there is a missing variable term in an equation, the coefficient is 0.

### Writing a System of Equations from an Augmented Matrix

We can use augmented matrices to help us solve systems of equations because they simplify operations when the systems are not encumbered by the variables. However, it is important to understand how to move back and forth between formats in order to make finding solutions smoother and more intuitive. Here, we will use the information in an augmented matrix to write the system of equations in standard form.

### Performing Row Operations on a Matrix

Now that we can write systems of equations in augmented matrix form, we will examine the various row operations that can be performed on a matrix, such as addition, multiplication by a constant, and interchanging rows.
Performing row operations on a matrix is the method we use for solving a system of equations. In order to solve the system of equations, we want to convert the matrix to row-echelon form, in which there are ones down the main diagonal from the upper left corner to the lower right corner, and zeros in every position below the main diagonal as shown.
We use row operations corresponding to equation operations to obtain a new matrix that is row-equivalent in a simpler form. Here are the guidelines to obtaining row-echelon form.
1. In any nonzero row, the first nonzero number is a 1. It is called a leading 1.
2. Any all-zero rows are placed at the bottom on the matrix.
3. Any leading 1 is below and to the right of a previous leading 1.
4. Any column containing a leading 1 has zeros in all other positions in the column.
To solve a system of equations we can perform the following row operations to convert the coefficient matrix to row-echelon form and do back-substitution to find the solution.
1. Interchange rows. (Notation: 
  )
2. Multiply a row by a constant. (Notation: 
  )
3. Add the product of a row multiplied by a constant to another row. (Notation: 
  
Each of the row operations corresponds to the operations we have already learned to solve systems of equations in three variables. With these operations, there are some key moves that will quickly achieve the goal of writing a matrix in row-echelon form. To obtain a matrix in row-echelon form for finding solutions, we use Gaussian elimination, a method that uses row operations to obtain a 1 as the first entry so that row 1 can be used to convert the remaining rows.

### Solving a System of Linear Equations Using Matrices

We have seen how to write a system of equations with an augmented matrix, and then how to use row operations and back-substitution to obtain row-echelon form. Now, we will take row-echelon form a step farther to solve a 3 by 3 system of linear equations. The general idea is to eliminate all but one variable using row operations and then back-substitute to solve for the other variables.

### Key Concepts

1. An augmented matrix is one that contains the coefficients and constants of a system of equations. See .
2. A matrix augmented with the constant column can be represented as the original system of equations. See .
3. Row operations include multiplying a row by a constant, adding one row to another row, and interchanging rows.
4. We can use Gaussian elimination to solve a system of equations. See , , and .
5. Row operations are performed on matrices to obtain row-echelon form. See .
6. To solve a system of equations, write it in augmented matrix form. Perform row operations to obtain row-echelon form. Back-substitute to find the solutions. See  and .
7. A calculator can be used to solve systems of equations using matrices. See .
8. Many real-world problems can be solved using augmented matrices. See  and .

### Section Exercises


### Verbal


### Algebraic

For the following exercises, write the augmented matrix for the linear system.
For the following exercises, write the linear system from the augmented matrix.
For the following exercises, solve the system by Gaussian elimination.

### Extensions

For the following exercises, use Gaussian elimination to solve the system.

### Real-World Applications

For the following exercises, set up the augmented matrix that describes the situation, and solve for the desired solution.