If you have ever previously solved a system with multiple equations and multiple variables, you probably used the substitution method. In this method, you solve one equation for one of the variables, then substitute that solution into the other equation(s). Then, you repeat this process until you find a value for one of the variables. Finally, you substitue these solutions back into your prior work to find values for each variable.
Example 1. Use the substitution method to solve the system of equations \begin{alignat*}{5} x && {}+{} && 2y && = && 10 \\ -3x && {}+{} && y && = && -9 \end{alignat*}
Solution to Example 1. We can solve the first equation for \(x\), getting \(x=-2y+10\). Substituting this into the second equation, we see that \( -3(-2y+10)+y = -9\), which simplifies to \(7y-30 = -9\). Solving, we get \(y=3\). Finally, substituting gives us \(x=-2y+10 = -2(3)+10 = 4\). The solution is \(x=4\) and \(y = 3\).
While substitution is a viable solution method for simple systems, it can be quite difficult to use it for systems with more variables and more equations. Also, substitution can give ambiguous results for systems that have no solutions or many solutions. For these reasons, we prefer the elimination method.
We will illustrate the elimination method by solving Example 1 again. It may be helpful to number our equations: \begin{alignat}{5} x && {}+{} && 2y && = && 10 \\ -3x && {}+{} && y && = && -9 \end{alignat}
We look at the coefficients of \(x\) in our two equations, and multiply equation (1) by 3 to \begin{equation} 3x + 6y = 30 \end{equation}
Now we add this new equation (3) to equation (2) to eliminate the variable \( x \) from that equation: \begin{equation} 7y = 21 \end{equation}
From this, we can easily see that \(y=3\). Finally, as with the substitution method, we plug this value back into the original equation (1) to get \( x = 4\).
You may have noticed that with each step of our elimination process, we generated a new equation. In order to keep the number of equations manageable, we will focus on replacing an equation every time we apply an elimination step. We will have to make sure that each of our steps is reversible so that we don't lose any information when we replace an equation.
Here are the three operations we can apply when using the elimination method:
With these operations in mind, here's the solution to Example 1 one more time:
Example 2. Use the substitution method to solve the system of equations \begin{alignat*}{5} x && {}+{} && 2y && = && 10 \\ -3x && {}+{} && y && = && -9 \end{alignat*}
Step 1: Replace the second equation by the sum of itself and 3 times the first equation. \begin{alignat*}{5} x && {}+{} && 2y && = && 10 \\ {} && {} && 7y && = && 21 \end{alignat*}
Step 2: Scale the second equation by a factor of \( 1/7 \). \begin{alignat*}{5} x && {}+{} && 2y && = && 10 \\ {} && {} && y && = && 3 \end{alignat*}
At this point the elimination is over, as we have our value of \( y\) and can substitute this back into the first equation to find \(x \). \( \Box \)
In general, our strategy with elimination is:
We will see that this strategy is not robust enough to handle all possible cases, but don't worry about that for now.
Example 3. Apply the elimination strategy to solve this system of equations: \begin{alignat*}{6} 2x && -4y\ && + && 6z && = && 4 \\ 3x && -y \ && + && z && = && 4 \\ -4x && && + && 3z && = && -7 \end{alignat*}
Step 1. We want to use the \( 2x \) in the first equation to eliminate the \( x \)'s in the other two equations. While not necessary, it can be helpful to start by scaling the first equation by a factor of \( 1/2 \). In general, it is helpful to scale the first equation so that the coefficient of \( x\) is 1. If there are no \( x\)'s in the first equation, it would be necessary to do a "swap" operation with another equation. \begin{alignat*}{6} x && -2y\ && + && 3z && = && 2 \\ 3x && -y \ && + && z && = && 4 \\ -4x && && + && 3z && = && -7 \end{alignat*}
Step 2. Replace the second equation by itself plus \( -3 \) times the first equation. Note that this doesn't change the first equation, just the second one: \begin{alignat*}{6} x && -2y\ && + && 3z && = && 2 \\ && 5y \ && - && 8z && = && -2 \\ -4x && && + && 3z && = && -7 \end{alignat*}
Step 3. Replace the third equation by itself plus \( 4\) times the first equation: \begin{alignat*}{6} x && -2y\ && + && 3z && = && 2 \\ && 5y \ && - && 8z && = && -2 \\ && -8y\ && + && 15z && = && 1 \end{alignat*}
Step 4. Now we want to use the \( 5y \) in the second equation to eliminate \( y \) from the third equation. It's not wrong to also eliminate \( y\) from the first equation, but it's not necessary for the elimination process. As in Step 1, we can start by scaling the second equation by a factor of \( 1/5 \): \begin{alignat*}{6} x && -2y\ && + && 3z && = && 2 \\ && y \ && - && \tfrac{8}{5}z && = && -\tfrac{2}{5} \\ && -8y\ && + && 15z && = && 1 \end{alignat*}
Step 5. Replace the third equation by the sum of itself and \( 8 \) times the second equation. \begin{alignat*}{6} x && -2y\ && + && 3z && = && 2 \\ && y \ && - && \tfrac{8}{5}z && = && -\tfrac{2}{5} \\ && && && \tfrac{11}{5} z && = && -\tfrac{11}{5} \end{alignat*}
Note that we could have achieved a similar result and combined Steps 4 and 5 by replacing the third equation by \( \frac{8}{5} \) times the second equation after Step 3. \( \Box \)
We have succeeded in eliminating all but one variable from the last equation. Note that the left-hand sides of these three equations form a "triangular" shape, with the "bottom tip" of the triangle corresponding to the sole variable in the last equation. This type of shape is generally the goal of the elimination process, and we will make the idea more precise in the next lecture.
Now we can solve the last equation to get \( z=-1\). Taking this value and substituting into the second equation gives \( y=-2 \). Finally, taking both of these values and plugging them into the first equation gives \( x=1\).
Example 4. Use the elimination method to solve this system of equations. \begin{alignat*}{6} x && {}-3y\ && && && = 5 \\ -x && +y \ && + && 5z && = 2 \\ && y \ && + && z && = 0 \end{alignat*}
Step 1. We want to use the \( x \) in the first equation to eliminate the \( x \)'s in the other two equations. Replace the second equation with the sum of itself plus the first equation: \begin{alignat*}{6} x && -3y\ && && && = 5 \\ && -2y\ && + && 5z && = 7 \\ && y \ && + && z && = 0 \end{alignat*}
Step 2. Replace the third equation by the sum of itself and \( 1/2 \) times the second equation: \begin{alignat*}{6} x && -3y\ && && && = 5 \\ && -2y\ && + && 5z && = 7 \\ && && && \tfrac{7}{2} z && = \tfrac{7}{2} \end{alignat*}
Step 3. Solve the third equation for \( z\), then back-substitute to solve for the other variables. This gives the solution \( x=2 \), \(y=-1\), and \(z=1\). \( \Box \)
When working with systems of equations, it is often convenient to write them in augmented matrix notation. A matrix is a rectangular grid of numbers. When we write a system of linear equations in augmented matrix notation, each row of numbers (going left-to-right) represents one equation. The entries in each row are the coefficients of the variables, together with the number on the right-hand-side of the equal sign.
For example, the system from Example 3 looks like this in augmented matrix notation: \begin{bmatrix} 1 & -3 & 0 & 5 \\ -1 & 1 & 5 & 2 \\ 0 & 1 & 1 & 0 \end{bmatrix}
Each column (going up and down) of an augmented matrix (except the right-most column) represents one of the variables in our system. If a column contains a zero, then the corresponding equation is missing that variable (or, equivalently, the variable has a coefficient of zero in that equation). The right-most column, sometimes called the augmented column, represents the numbers on the right-hand sides of each equation.
When working with augmented matrices, the three elimination operations are rephrased as row operations:
Example 4 (again). Use matrix notation and row operations to solve this system of equations: \begin{alignat*}{6} x && {}-3y\ && && && = 5 \\ -x && +y \ && + && 5z && = 2 \\ && y \ && + && z && = 0 \end{alignat*}
Step 1. Replace Row 2 by the sum of itself and Row 1: \begin{bmatrix} 1 & -3 & 0 & 5 \\ 0 & -2 & 5 & 7 \\ 0 & 1 & 1 & 0 \end{bmatrix}
Step 2. Replace Row 3 by the sum of itself and \( 1/2 \) times Row 2: \begin{bmatrix} 1 & -3 & 0 & 5 \\ 0 & -2 & 5 & 7 \\ 0 & 0 & \tfrac 7 2 & \tfrac 7 2 \end{bmatrix} The last row of our matrix represents the equation \( \frac 7 2 z = \frac 7 2 \), which can easily be solved for \( z\). We can now back-substitute and find the values of the other variables as before. \( \Box \)
Example 5. Solve this system of equations: \begin{align*} x_1 - 3x_2 +4x_3 &= -4 \\ 3x_1 -7x_2 +7x_3 &= -8 \\ -4x_1 +6x_2 -x_3 &= 7 \end{align*}
We set up and perform row operations on an augmented matrix: \begin{bmatrix} 1 & -3 & 4 & -4 \\ 3 & -7 & 7 & -8 \\ -4 & 6 & -1 & 7 \end{bmatrix}
Step 1. We first want to use the \( x\) in the first equation to eliminate \( x\)'s in the other equations. In matrix notation, this means that we want to use the \( 1\) in the first column, first row to create zeroes in the other rows in the first column.
To do this, Replace Row 2 by itself plus \( -3\) times Row 1. We can also at the same time replace Row 3 by itself plus \( 4\) times Row 1: \begin{bmatrix} 1 & -3 & 4 & -4 \\ 0 & 2 & -5 & 4 \\ 0 & -6 & 15 & -9 \\ \end{bmatrix}
Step 2. Now, we want to use the \( y\) in the second equation to eliminate \(y\)'s from the third equation. In matrix notation, this means that we want to use the \( 2\) in the second column, second row to create a zero in the second column, third row.
To do this, replace Row 3 by itself plus \( 3\) times Row 2: \begin{bmatrix} 1 & -3 & 4 & -4 \\ 0 & 2 & -5 & 4 \\ 0 & 0 & 0 & 3 \end{bmatrix}
We succeeded in eliminating both \(x\) and \(y\) from the third equation, but we inadvertently eliminated \(z\) as well! The third row of our matrix represents the equation \( 0x+0y+0z=3\), or just \(0=3\). Since 0 clearly doesn't equal 3, this indicates that our system of equations has no solutions. \( \Box \)
In the next few lectures, we will talk in more detail about the strategies you should employ using row operations. We will also talk about how to interpret the solution(s) of the original system of equations based on the result of the operations you use.
« Lecture 1 Back to Top Lecture 3 »