Let's look at the example from the end of [[Lecture 2]] more closely: $$\begin{array}{ccccccrrr} x&+&3y&+&z&=&5&\quad&(1)\\ 2x&+&7y&+&4z&=&17&&(2)\end{array}$$ We find the solutions of this [[system of linear equations|system]] by applying operations to the system to make a new system, aiming to end up with a very simple sort of system where we can see the solutions easily. First replace equation (2) with $(2)-2\times (1)$. We'll call the resulting equations (1) and (2) again, although of course we end up with a different system of linear equations: $$\begin{array}{ccccccrrr} x&+&3y&+&z&=&5&\quad&(1)\\ &&y&+&2z&=&7&&(2)\end{array}$$ Now replace equation (1) with $(1)-3\times (2)$: $$\begin{array}{ccccccrrr} x&&&-&5z&=&-16&\quad&(1)\\ &&y&+&2z&=&7&&(2)\end{array}$$ Notice that we can now easily rearrange (1) to find $x$ in terms of $z$, and we can rearrange (2) to find $y$ in terms of $z$. Since $z$ can take any value, we write $z=t$ where $t$ is a "free parameter" (which means $t$ can be any real number, or $t\in \mathbb{R}$). \begin{align*} x&=-16+5t\\ y&=7-2t\\ z&=t,\qquad t\in \mathbb{R}\end{align*} We can also write this in so-called "vector form": \[ \begin{bmatrix} x\\y\\z\end{bmatrix}=\begin{bmatrix} -16\\7\\0\end{bmatrix}+t\begin{bmatrix} 5\\-2\\1\end{bmatrix},\qquad t\in \mathbb{R}.\] This is the equation of the line where the two planes described by the original equations (1) and (2) intersect. Note for each different value of $t$, we get a different solutions (that is, a different point on the line of intersection). For example, setting $t=0$ we see that $(-16,7,0)$ is a solution; setting $t=1.5$, we see that $(-16+1.5\times 5,7+1.5\times (-2),1.5) = (-8.5,4,1.5)$ is another solution, and so on. This works for any value $t\in\mathbb{R}$, and every solution may be written in this way. ==== Observations ==== - The operations we applied to the original linear system don't change the set of solutions. This is because each operation is reversible. - Writing out the variables $x,y,z$ each time is unnecessary. If we erase the variables from the system $$\begin{array}{ccccccrrr} x&+&3y&+&z&=&5&\quad&(1)\\ 2x&+&7y&+&4z&=&17&&(2)\end{array}$$ and write all the numbers in a grid, or a **matrix**, we get: \[ \begin{bmatrix} 1&3&1&5\\2&7&4&17\end{bmatrix}\] Notice that the first column corresponds to the $x$ variable, the second to $y$, the third to $z$ and the numbers in the final column are the right hand sides of the equations. Each row corresponds to one equation. So instead of performing operations on equations, we can perform operations on the rows of this matrix: \begin{align*} &\begin{bmatrix} 1&3&1&5\\2&7&4&17\end{bmatrix} \\[6pt]\xrightarrow{R2\to R2-2\times R1}& \begin{bmatrix} 1&3&1&5\\0&1&2&7\end{bmatrix} \\[6pt]\xrightarrow{R1\to R1-3\times R1}& \begin{bmatrix} 1&0&-5&-16\\0&1&2&7\end{bmatrix} \end{align*} Now we translate this back into equations to solve: $$\begin{array}{ccccccrrr} x&&&-&5z&=&-16&\quad&(1)\\ &&y&+&2z&=&7&&(2)\end{array}$$ so \[ \begin{bmatrix} x\\y\\z\end{bmatrix}=\begin{bmatrix} -16\\7\\0\end{bmatrix}+t\begin{bmatrix} 5\\-2\\1\end{bmatrix},\qquad t\in \mathbb{R}.\] This sort of thing works in general: we can take any system of linear equations, write down a corresponding matrix, perform certain reversible operations on the rows of this matrix to get a new matrix, and then write down a new system of linear equations with the same solutions as the original system. If we do things in a sensible way then the new system will be easy to solve, so we'll be able to solve the original system (since the solution set is the same). Let's give some terminology which will allow us to make this process clear. ===== The augmented matrix of a system of linear equations ===== ==== Definition ==== {{page>augmented matrix}} The numbers in this matrix are called the **entries** of the matrix. We can be a bit more precise: the number in row $i$ and column $j$ is called the $(i,j)$ entry of the matrix. ==== Example ==== To find the augmented matrix of the linear system \begin{align*} 3x+4y+7z&=2\\x+3z&=0\\y-2z&=5 \end{align*} notice that we can rewrite it as \begin{align*} 3x+4y+7z&=2\\{\color{red}1}x+{\color{red}0y}+3z&=0\\{\color{red}0x}+{\color{red}1}y-2z&=5 \end{align*} so the augmented matrix is \[ \begin{bmatrix} 3&4&7&2\\1&0&3&0\\0&1&-2&5\end{bmatrix}.\] * the $(2,3)$ entry of this matrix is $3$; * the $(3,2)$ entry is $1$; * the $(1,4)$ entry is $2$; * the $(4,1)$ entry is undefined (since this matrix does not have a $4$th row). ===== Elementary operations on a system of linear equations ===== {{page>elementary operations on a linear system}} ===== Elementary row operations on a matrix ===== {{page>elementary row operation}} ==== Example ==== Use [[EROs]] to find the intersection of the planes \begin{align*} 3x+4y+7z&=2\\x+3z&=0\\y-2z&=5\end{align*} === Solution 1 === \begin{align*} \def\go#1#2#3{\begin{bmatrix}#1\\#2\\#3\end{bmatrix}} \def\ar#1{\\[6pt]\xrightarrow{#1}&} &\go{3&4&7&2}{1&0&3&0}{0&1&-2&5} \ar{\text{reorder rows}}\go{1&0&3&0}{0&1&-2&5}{3&4&7&2} \ar{R3\to R3-3R1}\go{1&0&3&0}{0&1&-2&5}{0&4&-2&2} \ar{R3\to R3-4R2}\go{1&0&3&0}{0&1&-2&5}{0&0&6&-18} \ar{R3\to \tfrac16 R3}\go{1&0&3&0}{0&1&-2&5}{0&0&1&-3} \end{align*} So * from the last row, we get $z=-3$ * from the second row, we get $y-2z=5$, so $y-2(-3)=5$, so $y=-1$ * from the first row, we get $x+3z=0$, so $x+3(-3)=0$, so $x=9$ The conclusion is that \[ \begin{bmatrix}x\\y\\z\end{bmatrix}=\begin{bmatrix}9\\-1\\-3\end{bmatrix}\] is the only solution.