# 3.7 Row operations

## 3.7.1 How we solve linear systems

If you are given a system of linear equations in variables $x,y,z$ and asked to solve them, what you probably do is to manipulate the equations by adding multiples of one equation to another until you have “eliminated” some of the variables and you can read off the solutions. We are going to try to formalise this method of solving linear equations.

Because we want to use matrix methods, let’s solve an example system and keep track of what our equation manipulation does to the corresponding augmented matrix.

Consider the linear system

 $\displaystyle 3x+4y$ $\displaystyle=6$ $\displaystyle x+2y$ $\displaystyle=5.$

The corresponding matrix equation is $A\mathbf{x}=\mathbf{b}$ where

 $A=\begin{pmatrix}3&4\\ 1&2\end{pmatrix},\mathbf{b}=\begin{pmatrix}6\\ 5\end{pmatrix},\mathbf{x}=\begin{pmatrix}x\\ y\end{pmatrix}.$

The augmented matrix is $(A\mid\mathbf{b})=\begin{pmatrix}3&4&6\\ 1&2&5\end{pmatrix}$.

To solve the system, we first eliminate $x$ from first equation by subtracting 3 times the second equation from the first. The equations become

 $\displaystyle-2y$ $\displaystyle=-9$ $\displaystyle x+2y$ $\displaystyle=5$

The augmented matrix $\begin{pmatrix}-2&0&-9\\ 1&2&5\end{pmatrix}$ of this new system is obtained by adding $-3$ times the second row of the old augmented matrix to the first row.

Next we get the coefficient of $y$ in the first equation to 1 by multiplying the first equation by $-1/2$. The equations become

 $\displaystyle y$ $\displaystyle=9/2$ $\displaystyle x+2y$ $\displaystyle=5$

The augmented matrix $\begin{pmatrix}0&1&9/2\\ 1&2&5\end{pmatrix}$ of this new system is obtained by multiplying every entry in the first row of the old augmented matrix by $-1/2$.

Next we eliminate $y$ from the second equation by subtracting 2 times the first equation from the second. The equations become

 $\displaystyle y$ $\displaystyle=9/2$ $\displaystyle x$ $\displaystyle=-4$

The augmented matrix $\begin{pmatrix}0&1&9/2\\ 1&0&-4\end{pmatrix}$ of this new system is obtained by adding $-2$ times the first row to the second row.

Lastly, if we wanted the first equation to tell us the value of the first variable and the second equation to tell us about the second variable, we could swap the order of the two equations, corresponding to swapping the rows of the augmented matrix so that it becomes $\begin{pmatrix}1&0&-4\\ 0&1&9/2\end{pmatrix}$.

## 3.7.2 Row operations

The manipulations we do to systems of linear equations correspond to doing row operations to the augmented matrices.

###### Definition 3.7.1.

A row operation is one of the following things we can do to a matrix.

1. 1.

Add $\lambda$ times row $i$ to row $j$ (for $j\neq i$, $\lambda$ any number), written $\textbf{r}_{j}\mapsto\textbf{r}_{j}+\lambda\textbf{r}_{i}$.

2. 2.

Multiply row $i$ by $\lambda$, where $\lambda\neq 0$, written $\textbf{r}_{i}\mapsto\lambda\textbf{r}_{i}$.

3. 3.

Swap rows $i$ and $j$, written $\textbf{r}_{i}\leftrightarrow\textbf{r}_{j}$.

## 3.7.3 Row operations are invertible

For each row operation $r$ there is another row operation $s$ such that doing $r$ then $s$, or doing $s$ then $r$, gets you back to the matrix you started with. Here is a table of the three types of row operations and their inverses.