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
$3x+4y$ | $=6$ | ||
$x+2y$ | $=5.$ |
The corresponding matrix equation is $A\mathbf{x}=\mathbf{b}$ where
$$A=\left(\begin{array}{cc}3& 4\\ 1& 2\end{array}\right),\mathbf{b}=\left(\begin{array}{c}6\\ 5\end{array}\right),\mathbf{x}=\left(\begin{array}{c}x\\ y\end{array}\right).$$ |
The augmented matrix is $(A\mid \mathbf{b})=\left(\begin{array}{ccc}3& 4& 6\\ 1& 2& 5\end{array}\right)$.
To solve the system, we first eliminate $x$ from first equation by subtracting 3 times the second equation from the first. The equations become
$-2y$ | $=-9$ | ||
$x+2y$ | $=5$ |
The augmented matrix $\left(\begin{array}{ccc}-2& 0& -9\\ 1& 2& 5\end{array}\right)$ 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
$y$ | $=9/2$ | ||
$x+2y$ | $=5$ |
The augmented matrix $\left(\begin{array}{ccc}0& 1& 9/2\\ 1& 2& 5\end{array}\right)$ 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
$y$ | $=9/2$ | ||
$x$ | $=-4$ |
The augmented matrix $\left(\begin{array}{ccc}0& 1& 9/2\\ 1& 0& -4\end{array}\right)$ 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 $\left(\begin{array}{ccc}1& 0& -4\\ 0& 1& 9/2\end{array}\right)$.
The manipulations we do to systems of linear equations correspond to doing row operations to the augmented matrices.
A row operation is one of the following things we can do to a matrix.
Add $\lambda $ times row $i$ to row $j$ (for $j\ne i$, $\lambda $ any number), written ${\text{\mathbf{r}}}_{j}\mapsto {\text{\mathbf{r}}}_{j}+\lambda {\text{\mathbf{r}}}_{i}$.
Multiply row $i$ by $\lambda $, where $\lambda \ne 0$, written ${\text{\mathbf{r}}}_{i}\mapsto \lambda {\text{\mathbf{r}}}_{i}$.
Swap rows $i$ and $j$, written ${\text{\mathbf{r}}}_{i}\leftrightarrow {\text{\mathbf{r}}}_{j}$.
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.
row operation | inverse |
---|---|
${\text{\mathbf{r}}}_{j}\mapsto {\text{\mathbf{r}}}_{j}+\lambda {\text{\mathbf{r}}}_{i}$ (add $\lambda $ times ${\text{\mathbf{r}}}_{i}$ to ${\text{\mathbf{r}}}_{j}$) | ${\text{\mathbf{r}}}_{j}\mapsto {\text{\mathbf{r}}}_{j}-\lambda {\text{\mathbf{r}}}_{i}$ (add $-\lambda $ times ${\text{\mathbf{r}}}_{i}$ to ${\text{\mathbf{r}}}_{j}$) |
${\text{\mathbf{r}}}_{i}\mapsto \lambda {\text{\mathbf{r}}}_{i}$ (multiply ${\text{\mathbf{r}}}_{i}$ by $\lambda \ne 0$) | ${\text{\mathbf{r}}}_{i}\mapsto {\lambda}^{-1}{\text{\mathbf{r}}}_{i}$ (multiply ${\text{\mathbf{r}}}_{i}$ by ${\lambda}^{-1}$) |
${\text{\mathbf{r}}}_{i}\leftrightarrow {\text{\mathbf{r}}}_{j}$ (swap ${\text{\mathbf{r}}}_{i}$ and ${\text{\mathbf{r}}}_{j}$) | ${\text{\mathbf{r}}}_{i}\leftrightarrow {\text{\mathbf{r}}}_{j}$ (swap ${\text{\mathbf{r}}}_{i}$ and ${\text{\mathbf{r}}}_{j}$) |