Linear Equations In Two Variables

Systems Of Equations

To solve a linear equation in two variables you need to have two distinct equations. Given 2x-y=9 we can only solve for x or y in terms of the other variable:



If we add the equation 3y-x=-2 we now have a system of two equations in two variables, and it is possible to solve for numerical values of x and y.



There are several ways to solve a system of equations like this one, but we will focus on using substitution. This is similar to the substitution we did in an earlier lesson, but will involve two steps.

For the first step we need to solve one equation for one variable in terms of the other variable. There will be four different ways to do this depending on which equation and variable you choose; go whichever route is the easiest. Two of the possibilities are given above, and we will choose y=2x-9. Since this was derived from the first equation, we will substitute this into the second equation. We do this by replacing the y\; in 3y-x=-2\; with 2x-9, to get:


We now have a linear equation in one variable, which we know how to solve:


Now we have solved the value of x, and we can find y by substituting x=5 into either of the original equations. Using the first equation we’d have:


If we had chosen to substitute x=5 into the second equation we would get the same answer:


Now we have our solution set of x=5\; and y=1; this will often be written as the ‘ordered pair’ (x,y)=(5,1), or simply as (5,1).

A Graphical Representation

When given one linear equation in two variables, like 2x-y=9, there are many different values of (x,y) that we could plug into the equation and maintain equality; (5,1), (6,3), (0,-9), and (-1,-11) are all some of the infinite examples. We can represent the set of solutions as a line on a graph.

Observe the point on the line that we’ve highlighted in black. If you move directly downwards from this point you’ll hit the x-axis of the graph at 6, and if you move straight eastward from the point you’ll hit the y-axis at 3. This point graphically represents the ordered pair (6,3), and is one the infinitely many points on this line that all represent solutions to the equation: y=2x-9. In other words: if you take any point (x,y) on this line, and substitute the (x,y) values into the equation y=2x-9, you’ll get equal values on both sides of the equals sign. For example, when we substitute (6,3) into the equation we have:


When we combine the first equation with the equation 3y-x=-2\; we have a system of equations with a unique solution. Graphically this solution is represented by the intersection of the lines for each single equation.

As you can see, the point of intersection is (5,1), just as we solved. Each equation on its own had infinitely many solutions, but when you combine the two equations in a system, you get a unique solution at the point of intersection; this is the point that solves both of the individual equations.

There is actually a bit more to the story. With a system of equations it is still possible to still get infinitely many solutions, or to get no solutions.

If your system is composed of two identical but differently phrased equations, each equation will line up at every point giving you infinitely many solutions. For example look at y=2x-9\; and 2y=4x-18. The second equation is equal to the first equation multiplied by 2. To solve the second equation for y we’d divide both sides by 2 to get y=2x-9, which is equal to the first equation.

Graphing these ‘two’ equations would give you two identical lines on top of each other, intersecting at every point; therefore, there are infinite solutions.

When trying to solve a system like this using substitution, everything will cancel out. In this case, when we substitute one equation into the other we get:


Now if you have two equations that are parallel but not equal, you will have a system with no solution. Examine the system:



If we graph these lines we get:

The two lines are parallel and will never intersect, hence the system has no solution. If you tried to solve the system by substitution you’d get:


Clearly 0\neq-1 so we can conclude that the system has no solution. If substitution ever leads to a similar inequality you can conclude there is no solution to the system (although you may want to check your work once first).

Slope Intercept Form

To draw the line representing any equation it is helpful to convert the equation into ‘slope intercept form.’ This means rearranging the terms of your equation so that they’re in the order:


where m\; and b\; a constants. For example take the equation 2y-2=6x, we can convert this into slope intercept form by dividing both sides by 2, then adding 1 to both sides:


Now the equation is in slope intercept form; we have 3\; in place of m\; and 1\;  in place of b.

The term m\; is called the slope of the line. If you think of a line as a hill, the value of the slop determines how steep the hill is and whether the hill going up or down. Larger absolute values of slope indicate steeper hills. Positive slopes (like all the above graphs) indicate the line is going “uphill,” while a negative slope would produce a line going “downhill.” The below graph shows different equations with different slopes; compare the slope values to the steepness and direction of the graphs.

Did you notice the relationship between the slopes and the steepness of the lines? The slope is the rise over the run (\frac{\text{Rise}}{\text{Run}}), where the run is the horizontal distance between two points and the rise is the vertical distance between the same two points. If you are given two points on a line, (x_{1},y_{1}),\;(x_{2},y_{2})\; you can calculate the line’s slope by using the formula:

\text{Slope\;(m)}  =  \frac{y_{1}-y_{2}}{x_{1}-x_{2}}

For example given the points (-2,8)\; and (1,-1), we can calculate the slope of the line running through them:


The order of the points does not matter as long as we’re consistent with the order of the coordinates:


The following graph shows the slope of two lines in terms of the rise and runs.

When we graph linear equations with only one variable we get horizontal and vertical lines. The following graph shows the lines representing x=3 and y=-4. The line x=3 is said to have “no slope,” and the line y=-4 is said to have “zero slope.”

In slope-intercept form the term b\; is called the y-intercept, and it gives the y-coordinate at which the line crosses the y-axis. The y-axis has a x-coordinate of zero, so the point at which any line crosses the y-axis is always (0,b). Observe the above graphs and notice how they cross the y-axis at the “height” of their b\; term. The only lines that do not cross the y-axis are those with no slope, like x=3\; above.

When we have an equation in slope intercept form, we can easily graph the line representing it using the y-intercept and slope. Take the equation y=2x+1\; for example. Because b=1, we know the line will cross the y-axis at (0,1), so we can put a point there. Now the slope of 2 means that if we move 1 to the right we must move up 2, so (0+1,1+2)=(1,3)\; must also be a point on the line. Now we have two points, and can draw a straight line through them.

If given two points it is possible to derive the equation of the line that connects them. Say we’re given the points (-2,8)\; and (1,-1). As demonstrated above, we can calculate the slope of this line to be:


Now we’ve found the value of m, and just need to find the value of b. We can do this by substituting the coordinates for either point into our equation y=-3x+b, then solving for b. If we substitute (x,y)=(1,-1)\; into the equation we get:


We could have also substituted (x,y)=(-2,8)\; into the equation and gotten the same answer:


Both ways solve that b=2, and lead to the final equation: y=-3x+2.

Practice Questions

Solve the system of equations.

1.) x+y=3,\qquad 2y-1=-x

2.) x+2y=5, \qquad 2y-3x=1

3.) 2x+4=6y, \qquad 3x-4y=9

4.) x+y=2,\qquad x-y=-1

Use the graph to answer questions 5-12.

5.) What are the coordinates of the points (A-G) on the above graph?

6.) What is the slope of the line that passes through points A and C?

7.) What is the equation of the line that passes through the points C and D?

8.) What is the equation of the line that passes through the points A and B? What is the slope of this line?

9.) What is the equation of the line that passes through the points B and D? What is the slope of this line?

10.) What is the equation of the line that passes through the points C and E?

11.) Parallel lines have the same slope. What is the equation of the line that passes through point D and is parallel to the line y=-\frac{1}{4}x+5?

12.) If y=mx+b\; is a line and y=Mx+B\; is another line perpendicular to the first line, then M=-\frac{1}{m}. In other words, the slopes of two perpendicular lines are inverses and have opposite signs. What is the equation of the line that is perpendicular to y=\frac{2}{3}x-1 and passes through point A?

13.) What is the slope of the line with the equation 7x+5y+3=0?

14.) What is the equation of a line that has a slope 5 and intercepts the y-axis at (0,-8)?

15.) If Li spends $10 more than Jeb and Jeb spends \frac{4}{5} as much as Li, how much did each Li and Jeb spend?