Graphing Linear Equations
Recognize the relation between the solutions of an equation and its graph
In Use the Rectangular Coordinate System, we found a few 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 straight line to get the graph of the equation .
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. If you substitute and into the equation, you find that it is a solution to the equation:
So 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 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 straight 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? , , , .
Substitute the - and -values into the equation to check if each ordered pair is a solution.
So , , and are solutions to , but is not a solution. Plotting the points confirms it: , , and are on the line, and is not on the line.
The graph of passes through , , and . Is the ordered pair a solution to the equation? Enter the -value that actually gives when .
Substitute into and simplify. Compare the result to the -value of given in the ordered pair.Using the same equation , what is the -value when ? (Check whether the point is a solution.)
Substitute into and simplify.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 above is called plotting points, or the Point-Plotting Method.
Let’s graph the equation by plotting points. We start by finding three points that are solutions to the equation. We can choose any value for or , and then solve for the other variable. Since is isolated on the left side of the equation, it is easier to choose values for . We will use , , and for in this example. We substitute each value of into the equation and solve for .
We can organize the solutions in a table.
Now we plot the points on a rectangular coordinate system. Check that the points line up — if they did not, it would mean we made a mistake and should double-check our work. Draw the line through the three points, extending it to fill the grid with arrows on both ends. The line is the graph of .
Graph a linear equation by plotting points.
- Find three points whose coordinates are solutions to the equation. Organize them in a table.
- Plot the points on a rectangular coordinate system. Check that the points line up. If they do not, carefully check your work.
- Draw the line through the points. Extend the line to fill the grid and put arrows on both ends of the line.
It only takes two points to determine a line, but it is a good habit to use three points. If you plot only 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.
Example. Graph the equation .
Find three points that are solutions to the equation. It’s easier to choose values for and solve for .
Plot the points, check that they line up, and draw the line.
Graph the line by placing two points on it.
The line passes through the origin . The slope means from there, go down and right to reach a second point.Which graph shows the equation ?
Make a small table: when , ; when , . The -value always equals the -value.When an equation includes a fraction as the coefficient of , we can substitute any numbers for . But the math is easier if we make “good” choices for the values of — multiples of the denominator — so we avoid 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.
Plot the points, check that they line up, and draw the line.
The graph of is shown below. Use it to answer the question that follows.
Reading the graph of above, what is the -value where the line crosses the -axis (that is, when )?
The line crosses the -axis where . Read the -coordinate of that point straight off the graph.Graph the equation: . What is the -value when ?
Substitute into and simplify.So far, all the equations we graphed had given in terms of . Now we’ll graph an equation with and on the same side.
Example. Graph the equation .
Find three points that are solutions to the equation. Remember, you can start with any value of or .
Then plot the points, check that they line up, and draw the line.
Graph the equation: . What is the -value when ?
Substitute into and solve for .Graph the equation: . What is the -value when ?
Substitute into and solve for .In the previous example, the three points we found were easy to graph. But this is not always the case. Let’s see what happens with the equation . If is , what is the value of ?
The solution is the point . This point has a fraction for the -coordinate. While we could graph this point, it is hard to be precise graphing fractions. Remember, in the earlier example we carefully chose values for so as not to graph fractions at all. If we solve the equation for , it will be easier to find three solutions to the equation:
Now we can choose values for that will give coordinates that are integers. The solutions for , , and are shown below.
Example. Graph the equation .
Find three points that are solutions to the equation. First, solve the equation for :
We let be , , and to find three points. The ordered pairs are shown in the table. 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 answers of a book? If the points where the graphs cross the - and -axes are the same, the graphs match.
Solving for gives . Which graph shows this equation?
Solved for , the equation is : it crosses the -axis at and falls as increases.Graph each equation: . What is the -value when ?
Substitute into and solve for .Graph vertical and horizontal lines
Can we graph an equation with only one variable — just and no , or just without an ? How would we make a table of values to get the points to plot?
Let’s consider the equation . This equation says that is always equal to , so its value does not depend on . No matter what is, the value of is always .
To make a table of solutions, we write for all the -values. Then we choose any values for . Since does not depend on , we can choose any numbers we like — to fit the size of our coordinate graph, we’ll use , , and for the -coordinates.
Then we plot the points and connect them with a straight line. The graph is a vertical line.
Example. Graph the equation . What type of line does it form?
The equation has only one variable, , and is always equal to . We make a table where is always and we put in any values for .
Plot the points and connect them. The graph is a vertical line passing through the -axis at .
Graph the equation by placing two points on the line.
Every point on this line has , no matter what is. Place two points that both sit at , such as and — they make a vertical line.Graph the equation: . What is the -value when ? (This is where the line crosses the -axis.)
A vertical line has the same -coordinate, , for every point on it — including where it crosses the -axis.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 .
To make a table of solutions, we write for all the -values and then choose any values for . We’ll use , , and for the -values.
Plot the points and connect them. This 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 the table have the same -coordinate, . We choose , , and as values for .
The graph is a horizontal line passing through the -axis at .
Which graph shows the equation ?
has only the variable , always equal to . That makes a horizontal line crossing the -axis at .Graph the equation: . What is the -value when ? (This is where the line crosses the -axis.)
A horizontal line has the same -coordinate, , for every point on it — including where it crosses the -axis.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 — 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 .
Notice that the equation gives a slanted line, whereas gives a horizontal line.
Example. Graph and in the same rectangular coordinate system.
Find three solutions for each equation. Notice that the first equation has the variable , while the second does not.
The graph shows both equations: the slanted line and the horizontal line .
Which graph shows both and on the same coordinate system?
has both and , so it is a slanted line through the origin. has only , so it is a horizontal line at .Graph and in the same rectangular coordinate system. What is the -value of when ?
Substitute into . Compare it to the constant line , which has no matter what is.Key terms
graph of a linear equation — the straight line consisting of all the points that are solutions of the equation ; every point on the line is a solution, and every solution is a point on the line. plotting points (Point-Plotting Method) — a method of graphing a linear equation by finding three solutions, organizing them in a table, plotting them, and drawing the line through them. vertical line — the graph of an equation of the form ; it passes through the -axis at . horizontal line — the graph of an equation of the form ; it passes through the -axis at .
This section is adapted from Prealgebra 2e, Section 11.2: Graphing Linear Equations 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-grid line graphs as accessible inline graphics; omitted the Be Prepared quiz, Media links, and end-of-section exercises; and converted the practice problems (“Try Its”) into interactive exercises with instant feedback, adapting the “graph the following” Try Its into a mix of graph-production exercises, “which graph” recognition questions, and gradable questions about specific coordinate values.