Section 7.1 : Linear Systems with Two Variables
A linear system of two equations with two variables is any system that can be written in the form.
\[\begin{align*}ax + by & = p\\ cx + dy & = q\end{align*}\]where any of the constants can be zero with the exception that each equation must have at least one variable in it.
Also, the system is called linear if the variables are only to the first power, are only in the numerator and there are no products of variables in any of the equations.
Here is an example of a system with numbers.
\[\begin{align*}3x - y & = 7\\ 2x + 3y & = 1\end{align*}\]Before we discuss how to solve systems we should first talk about just what a solution to a system of equations is. A solution to a system of equations is a value of \(x\) and a value of \(y\) that, when substituted into the equations, satisfies both equations at the same time.
For the example above \(x = 2\) and \(y = - 1\) is a solution to the system. This is easy enough to check.
\[\begin{align*}3\left( 2 \right) - \left( { - 1} \right) & = 7\\ 2\left( 2 \right) + 3\left( { - 1} \right) & = 1\end{align*}\]So, sure enough that pair of numbers is a solution to the system. Do not worry about how we got these values. This will be the very first system that we solve when we get into examples.
Note that it is important that the pair of numbers satisfy both equations. For instance, \(x = 1\) and \(y = - 4\) will satisfy the first equation, but not the second and so isn’t a solution to the system. Likewise, \(x = - 1\) and \(y = 1\) will satisfy the second equation but not the first and so can’t be a solution to the system.
Now, just what does a solution to a system of two equations represent? Well if you think about it both of the equations in the system are lines. So, let’s graph them and see what we get.
As you can see the solution to the system is the coordinates of the point where the two lines intersect. So, when solving linear systems with two variables we are really asking where the two lines will intersect.
We will be looking at two methods for solving systems in this section.
The first method is called the method of substitution. In this method we will solve one of the equations for one of the variables and substitute this into the other equation. This will yield one equation with one variable that we can solve. Once this is solved we substitute this value back into one of the equations to find the value of the remaining variable.
In words this method is not always very clear. Let’s work a couple of examples to see how this method works.
- \(\begin{align*}3x - y & = 7\\ 2x + 3y & = 1\end{align*}\)
- \(\begin{align*}5x + 4y & = 1\\ 3x - 6y & = 2\end{align*}\)
So, this was the first system that we looked at above. We already know the solution, but this will give us a chance to verify the values that we wrote down for the solution.
Now, the method says that we need to solve one of the equations for one of the variables. Which equation we choose and which variable that we choose is up to you, but it’s usually best to pick an equation and variable that will be easy to deal with. This means we should try to avoid fractions if at all possible.
In this case it looks like it will be really easy to solve the first equation for \(y\) so let’s do that.
\[3x - 7 = y\]Now, substitute this into the second equation.
\[2x + 3\left( {3x - 7} \right) = 1\]This is an equation in \(x\) that we can solve so let’s do that.
\[\begin{align*}2x + 9x - 21 & = 1\\ 11x & = 22\\ x & = 2\end{align*}\]So, there is the \(x\) portion of the solution.
Finally, do NOT forget to go back and find the \(y\) portion of the solution. This is one of the more common mistakes students make in solving systems. To so this we can either plug the \(x\) value into one of the original equations and solve for \(y\) or we can just plug it into our substitution that we found in the first step. That will be easier so let’s do that.
\[y = 3x - 7 = 3\left( 2 \right) - 7 = - 1\]So, the solution is \(x = 2\) and \(y = - 1\) as we noted above.
b \(\begin{align*}5x + 4y & = 1\\ 3x - 6y & = 2\end{align*}\) Show Solution
With this system we aren’t going to be able to completely avoid fractions. However, it looks like if we solve the second equation for \(x\) we can minimize them. Here is that work.
\[\begin{align*}3x & = 6y + 2\\ x & = 2y + \frac{2}{3}\end{align*}\]Now, substitute this into the first equation and solve the resulting equation for \(y\).
\[\begin{align*}5\left( {2y + \frac{2}{3}} \right) + 4y & = 1\\ 10y + \frac{{10}}{3} + 4y & = 1\\ 14y & = 1 - \frac{{10}}{3} = - \frac{7}{3}\\ y & = - \left( {\frac{7}{3}} \right)\left( {\frac{1}{{14}}} \right)\\ y & = - \frac{1}{6}\end{align*}\]Finally, substitute this into the original substitution to find \(x\).
\[x = 2\left( { - \frac{1}{6}} \right) + \frac{2}{3} = - \frac{1}{3} + \frac{2}{3} = \frac{1}{3}\]So, the solution to this system is \(x = \frac{1}{3}\) and \(y = - \frac{1}{6}\).
As with single equations we could always go back and check this solution by plugging it into both equations and making sure that it does satisfy both equations. Note as well that we really would need to plug into both equations. It is quite possible that a mistake could result in a pair of numbers that would satisfy one of the equations but not the other one.
Let’s now move into the next method for solving systems of equations. As we saw in the last part of the previous example the method of substitution will often force us to deal with fractions, which adds to the likelihood of mistakes. This second method will not have this problem. Well, that’s not completely true. If fractions are going to show up they will only show up in the final step and they will only show up if the solution contains fractions.
This second method is called the method of elimination. In this method we multiply one or both of the equations by appropriate numbers (i.e. multiply every term in the equation by the number) so that one of the variables will have the same coefficient with opposite signs. Then next step is to add the two equations together. Because one of the variables had the same coefficient with opposite signs it will be eliminated when we add the two equations. The result will be a single equation that we can solve for one of the variables. Once this is done substitute this answer back into one of the original equations.
As with the first method it’s much easier to see what’s going on here with a couple of examples.
- \(\begin{align*}5x + 4y & = 1\\ 3x - 6y & = 2\end{align*}\)
- \(\begin{align*}2x + 4y & = - 10\\ 6x + 3y & = 6\end{align*}\)
This is the system in the previous set of examples that made us work with fractions. Working it here will show the differences between the two methods and it will also show that either method can be used to get the solution to a system.
So, we need to multiply one or both equations by constants so that one of the variables has the same coefficient with opposite signs. So, since the \(y\) terms already have opposite signs let’s work with these terms. It looks like if we multiply the first equation by 3 and the second equation by 2 the \(y\) terms will have coefficients of 12 and -12 which is what we need for this method.
Here is the work for this step.
\[\begin{align*} 5x+4y & = 1 & \underrightarrow{\times \,\,3} \hspace{0.5in} & 15x+12y=3 \\ 3x-6y & = 2 & \underrightarrow{\times \,\,2} \hspace{0.5in} & \underline{\,\,6x-12y=4} \\ & & & 21x \hspace{0.5in} =7 \\ \end{align*}\]So, as the description of the method promised we have an equation that can be solved for \(x\). Doing this gives, \(x = \frac{1}{3}\) which is exactly what we found in the previous example. Notice however, that the only fraction that we had to deal with to this point is the answer itself which is different from the method of substitution.
Now, again don’t forget to find \(y\). In this case it will be a little more work than the method of substitution. To find \(y\) we need to substitute the value of \(x\) into either of the original equations and solve for \(y\). Since \(x\) is a fraction let’s notice that, in this case, if we plug this value into the second equation we will lose the fractions at least temporarily. Note that often this won’t happen and we’ll be forced to deal with fractions whether we want to or not.
\[\begin{align*}3\left( {\frac{1}{3}} \right) - 6y & = 2\\ 1 - 6y & = 2\\ - 6y & = 1\\ y & = - \frac{1}{6}\end{align*}\]Again, this is the same value we found in the previous example.
b \(\begin{align*}2x + 4y & = - 10\\ 6x + 3y & = 6\end{align*}\) Show Solution
In this part all the variables are positive so we’re going to have to force an opposite sign by multiplying by a negative number somewhere. Let’s also notice that in this case if we just multiply the first equation by -3 then the coefficients of the \(x\) will be -6 and 6.
Sometimes we only need to multiply one of the equations and can leave the other one alone. Here is this work for this part.
\[\begin{align*} 2x+4y & =-10 & \underrightarrow{\times \,\,-3} \hspace{0.5in} & -6x-12y=30 \\ 6x+3y & =6 & \underrightarrow{\text{same}} \hspace{0.5in} &\underline{\hspace{0.35in}6x+3y=6} \\ & & & \hspace{0.5in} -9y=36 \\ & & & \hspace{0.85in} y=-4 \\ \end{align*}\]Finally, plug this into either of the equations and solve for \(x\). We will use the first equation this time.
\[\begin{align*}2x + 4\left( { - 4} \right) & = - 10\\ 2x - 16 & = - 10\\ 2x & = 6\\ x & = 3\end{align*}\]So, the solution to this system is \(x = 3\) and \(y = - 4\).
There is a third method that we’ll be looking at to solve systems of two equations, but it’s a little more complicated and is probably more useful for systems with at least three equations so we’ll look at it in a later section.
Before leaving this section we should address a couple of special case in solving systems.
We can use either method here, but it looks like substitution would probably be slightly easier. We’ll solve the first equation for \(x\) and substitute that into the second equation.
\[\begin{align*}x & = 6 + y\\ & \\ - 2\left( {6 + y} \right) + 2y & = 1\\ - 12 - 2y + 2y & = 1\\ - 12 & = 1\,\,\,??\end{align*}\]So, this is clearly not true and there doesn’t appear to be a mistake anywhere in our work. So, what’s the problem? To see let’s graph these two lines and see what we get.
It appears that these two lines are parallel (can you verify that with the slopes?) and we know that two parallel lines with different \(y\)-intercepts (that’s important) will never cross.
As we saw in the opening discussion of this section solutions represent the point where two lines intersect. If two lines don’t intersect we can’t have a solution.
So, when we get this kind of nonsensical answer from our work we have two parallel lines and there is no solution to this system of equations.
The system in the previous example is called inconsistent. Note as well that if we’d used elimination on this system we would have ended up with a similar nonsensical answer.
In this example it looks like elimination would be the easiest method.
\[\begin{align*} 2x+5y & =-1 & \underrightarrow{\times \,\,5} \hspace{0.5in} & \,\,\,\,10x+25y=-5 \\ -10x-25y & =5 & \underrightarrow{\text{same}} \hspace{0.5in} & \underline{-10x-25y=5} \\ & & & \hspace{0.9in} 0=0 \\ \end{align*}\]On first glance this might appear to be the same problem as the previous example. However, in that case we ended up with an equality that simply wasn’t true. In this case we have 0=0 and that is a true equality and so in that sense there is nothing wrong with this.
However, this is clearly not what we were expecting for an answer here and so we need to determine just what is going on.
We’ll leave it to you to verify this, but if you find the slope and \(y\)-intercepts for these two lines you will find that both lines have exactly the same slope and both lines have exactly the same \(y\)-intercept. So, what does this mean for us? Well if two lines have the same slope and the same \(y\)-intercept then the graphs of the two lines are the same graph. In other words, the graphs of these two lines are the same graph. In these cases any set of points that satisfies one of the equations will also satisfy the other equation.
Also, recall that the graph of an equation is nothing more than the set of all points that satisfies the equation. In other words, there is an infinite set of points that will satisfy this set of equations.
In these cases we do want to write down something for a solution. So, what we’ll do is solve one of the equations for one of the variables (it doesn’t matter which you choose). We’ll solve the first for \(y\).
\[\begin{align*}2x + 5y & = - 1\\ 5y & = - 2x - 1\\ y & = - \frac{2}{5}x - \frac{1}{5}\end{align*}\]Then, given any \(x\) we can find a \(y\) and these two numbers will form a solution to the system of equations. We usually denote this by writing the solution as follows,
\[\begin{array}{*{20}{c}}\begin{aligned}x & = t\\ y & = - \frac{2}{5}t - \frac{1}{5}\end{aligned}&{\hspace{0.25in}{\mbox{where}}\,t{\mbox{ is any real number}}}\end{array}\]To show that these give solutions let’s work through a couple of values of \(t\).
\(t = 0\)
\[x = 0\hspace{0.25in}y = - \frac{1}{5}\]To show that this is a solution we need to plug it into both equations in the system.
\[\begin{align*}2\left( 0 \right) + 5\left( { - \frac{1}{5}} \right) & \mathop = \limits^? - 1 & \hspace{0.25in} - 10\left( 0 \right) - 25\left( { - \frac{1}{5}} \right) & \mathop = \limits^? 5\\ - 1 & = - 1 & \hspace{0.25in} 5 & = 5\end{align*}\]So, \(x = 0\) and \(y = - \frac{1}{5}\) is a solution to the system. Let’s do another one real quick.
\(t = - 3\)
\[x = - 3\hspace{0.25in}y = - \frac{2}{5}\left( { - 3} \right) - \frac{1}{5} = \frac{6}{5} - \frac{1}{5} = 1\]Again we need to plug it into both equations in the system to show that it’s a solution.
\[\begin{align*}2\left( { - 3} \right) + 5\left( 1 \right) & \mathop = \limits^? - 1 & \hspace{0.25in} - 10\left( { - 3} \right) - 25\left( 1 \right) & \mathop = \limits^? 5\\ - 1 & = - 1 & \hspace{0.25in}5 & = 5\end{align*}\]Sure enough \(x = - 3\) and \(y = 1\) is a solution.
So, since there are an infinite number of possible \(t\)’s there must be an infinite number of solutions to this system and they are given by,
\[\begin{array}{*{20}{c}}\begin{aligned}x & = t\\ y & = - \frac{2}{5}t - \frac{1}{5}\end{aligned}&{\hspace{0.25in}{\mbox{where}}\,t{\mbox{ is any real number}}}\end{array}\]Systems such as those in the previous examples are called dependent.
We’ve now seen all three possibilities for the solution to a system of equations. A system of equation will have either no solution, exactly one solution or infinitely many solutions.