Graph Linear Equations in Two Variables
Recognize the relationship between the solutions of an equation and its graph
In the previous section, we found several solutions to the equation . They are listed in the table below. So the ordered pairs , , and are some solutions to the equation . We can plot these solutions in the rectangular coordinate system, as shown below.
Notice how the points line up perfectly? We connect the points with a line to get the graph of the equation , shown below. Notice the arrows on the ends of the line — they indicate the line continues in both directions.
Every point on the line is a solution of the equation. Also, every solution of this equation is a point on this line. Points not on the line are not solutions.
Notice that the point is on the line shown below. If you substitute and into the equation, you find that it is a solution to the equation:
So the point is a solution to the equation . What about ?
So is not a solution to the equation . Therefore, the point is not on the line. This is an example of the saying, “A picture is worth a thousand words.” The line shows you all the solutions to the equation. Every point on the line is a solution of the equation, and every solution of this equation is a point on this line. This line is called the graph of the equation .
Graph of a linear equation. The graph of a linear equation is a line.
- Every point on the line is a solution of the equation.
- Every solution of this equation is a point on this line.
Example. The graph of is shown below.
For each ordered pair, decide: (a) is the ordered pair a solution to the equation? (b) is the point on the line? We’ll check , , , and .
(a) Substitute the - and -values into the equation to check whether each ordered pair is a solution.
So , , and are solutions, while is not a solution.
(b) Plotting the four points confirms it: , , and fall on the line , but does not. The points that are solutions to are on the line, and the point that is not a solution is not on the line.
The line passes through the point . Is a solution to the equation? Enter the value of when .
Substitute into and simplify; compare the result to the y-coordinate 5.For the equation , substitute to find the y-coordinate of the point on the line.
.Graph a linear equation by plotting points
There are several methods that can be used to graph a linear equation. The method we used to graph is called plotting points, or the Point-Plotting Method.
How To: Graph an equation by plotting points. Graph the equation by plotting points.
Step 1. Find three points whose coordinates are solutions to the equation. You can choose any values for or . In this case, since is isolated on the left side of the equation, it is easier to choose values for .
Organize the solutions in a table:
Step 2. Plot the points in a rectangular coordinate system. Check that the points line up. If they do not, carefully check your work.
Step 3. Draw the line through the three points. Extend the line to fill the grid and put arrows on both ends of the line — this line is the graph of .
It is true that it only takes two points to determine a line, but it is a good habit to use three points. If you only plot two points and one of them is incorrect, you can still draw a line, but it will be the wrong line. If you use three points and one is incorrect, the points will not line up — this tells you something is wrong and you need to check your work.
Graph by plotting points. Let . Find y.
.For the equation , let . Find y.
.When an equation includes a fraction as the coefficient of , we can still substitute any numbers for . But the math is easier if we make “good” choices for the values of — choosing multiples of the denominator avoids fraction answers, which are hard to graph precisely.
Example. Graph the equation .
Since this equation has the fraction as a coefficient of , we choose values of carefully. We use zero as one choice and multiples of for the other choices, so that comes out even each time.
Plotting the points, checking that they line up, and drawing the line gives the graph of .
Graph by plotting points. To avoid fractions, let . Find y.
.For the equation , let . Find y.
.So far, all the equations we graphed had given in terms of . Now we’ll graph an equation with and on the same side, such as . When an equation is in this form, it is often easier to find the intercepts than to pick three arbitrary values — first solve the equation for so it is easier to find points, or find one point by letting and another by letting .
If we solve for , we get . The solutions for , , and are shown below.
Example. Graph the equation .
Since both and are on the same side, it is not that easy to solve for in one step, so we leave the equation in standard form and find a first point by letting , a second point by letting , and a third point by choosing some other value.
We need a third point. We’ll let :
Plot the points, check that they line up, and draw the line. If you can choose any three points to graph a line, how will you know if your graph matches the one shown in the answer key? If the points where the graphs cross the - and -axes are the same, the graphs match!
Graph the equation 2x - 3y = 6 (a different way): let and solve for x.
, so .For the equation , let and solve for y.
, so .Graph vertical and horizontal lines
Can we graph an equation with only one variable — just and no , or just without an ? How will we make a table of values to get the points to plot?
Let’s consider the equation . This equation has only one variable, . The equation says that is always equal to , so its value does not depend on . To make a table of values, we write in for all the -values, then choose any values for — we’ll use , , and .
Plotting these points and connecting them with a straight line gives a vertical line.
Example. Graph the equation .
The equation has only one variable, , and is always equal to . We create a table where is always , then put in any values for . The graph is a vertical line passing through the -axis at .
Graph the equation . What is the x-coordinate of every point on this line?
The equation says x is always 5, no matter what y is.Graph the equation . At what x-coordinate does this vertical line cross the x-axis?
A vertical line crosses the x-axis at .What if the equation has but no ? Let’s graph the equation . This time the -value is a constant, so in this equation does not depend on . Fill in for all the ’s in the table below and choose any values for — we’ll use , , and .
The graph is a horizontal line passing through the -axis at .
Example. Graph the equation .
The equation has only one variable, . The value of is constant. All the ordered pairs in its table have the same -coordinate. The graph is a horizontal line passing through the -axis at .
Graph the equation . What is the y-coordinate of every point on this line?
The equation says y is always -4, no matter what x is.Graph the equation . At what point does this horizontal line cross the y-axis?
A horizontal line crosses the y-axis at .The equations for vertical and horizontal lines look very similar to equations like . What is the difference between the equations and ?
The equation has both and . The value of depends on the value of , so the -coordinate changes according to the value of . The equation has only one variable. The value of is constant — the -coordinate is always . It does not depend on the value of .
Graphing both equations in the same rectangular coordinate system shows the difference clearly: gives a slanted line through the origin, while gives a horizontal line.
Compare and . When , what is y for the equation ?
.For the equation y = -3 (not y = -3x), what is y when ?
has only one variable — y never changes, no matter what x is.Key terms
graph of a linear equation — the line consisting of all the points that are solutions of the equation ; every point on the line is a solution of the equation, and every solution of the equation is a point on the line. plotting points (Point-Plotting Method) — a method for graphing a linear equation by finding several ordered-pair solutions, plotting them, and drawing the line through them. vertical line — the graph of an equation of the form ; a straight up-and-down line that crosses the -axis at . horizontal line — the graph of an equation of the form ; a straight side-to-side line that crosses the -axis at .
This section is adapted from Elementary Algebra 2e, Section 4.2: Graph Linear Equations in Two Variables by Lynn Marecek, MaryAnne Anthony-Smith, and Andrea Honeycutt Mathis, © OpenStax, licensed under CC BY-NC-SA 4.0. Access the original for free at openstax.org. Changes: recreated the coordinate-plane graphs (points, lines, vertical and horizontal lines, and the paired vs. comparison) as accessible inline SVGs and the solution tables as markdown tables; omitted the Be Prepared quiz, Self Check checklist, and end-of-section exercises; and converted the practice problems (“Try Its”) into interactive exercises with instant feedback.