This site is a work in progress. New lessons are added regularly. Contact us

Graphing Linear Equations

Learning goals

  • Treat the graph as the equation's whole solution set
  • Plot two solutions to fix the line, and a third to check
  • Build a table by solving for yy and choosing inputs
  • Find both intercepts by setting each variable to zero
  • Draw y=cy = c horizontal and x=cx = c vertical
  • Test a point by substituting its coordinates

What the graph of an equation is

A solution of a linear equation in two variables is an ordered pair (x,y)(x, y) that makes the equation true. In the last lesson you saw that a single such equation has infinitely many of these pairs. Since every ordered pair is a point on the coordinate plane, the whole collection of solutions is a collection of points, and that collection has a name.

The graph of an equation is the set of all points (x,y)(x, y) whose coordinates make the equation true, plotted on the coordinate plane. Nothing more and nothing less: a point is on the graph exactly when it is a solution. Likewise, a point that is not a solution is off the graph. So “the graph” and “the solution set” are two names for the same thing, one described with algebra and the other drawn as a picture.

For a linear equation this graph is always a straight line, which is exactly why the equation is called linear. That fact is what makes graphing fast. A line is fixed by just two different points. So once you have found two solutions and plotted them, you can lay a ruler across them and draw the entire graph. The rest of this lesson is really two questions, then: how to find a few solution points, and how to read the line they determine.

Graphing with a table of values

The most direct way to graph a linear equation is to find several solutions, plot them, and draw the line they fall on. Finding solutions is the job you already did last lesson: solve the equation for yy, choose values of xx, and compute the matching yy. Each pair (x,y)(x, y) is one point of the graph. A good habit is to pick a small spread of xx-values, including zero and a negative, so the points are not all crowded together.

Worked example 1 Graph y=2x1y = 2x - 1 from a table

The equation is already solved for yy, so choose a handful of xx-values and compute each yy.

y=2(1)1=3,y=2(0)1=1,y=2(1)1=1,y=2(2)1=3.\begin{aligned} y = 2(-1) - 1 &= -3, &\qquad y = 2(0) - 1 &= -1, \\ y = 2(1) - 1 &= 1, &\qquad y = 2(2) - 1 &= 3. \end{aligned}

Collecting the results in a table keeps the pairs straight:

xxy=2x1y = 2x - 1Solution (x,y)(x, y)
1-13-3(1,3)(-1, -3)
001-1(0,1)(0, -1)
1111(1,1)(1, 1)
2233(2,3)(2, 3)

Plot the four points. They line up perfectly, so lay a ruler across them and draw a straight line. Extend it past the outer points and add arrowheads to show it runs on forever in both directions. That line is the graph of y=2x1y = 2x - 1.

The graph of y = 2x - 1Four solution points of y = 2x - 1 plotted from a table, all lying on one straight line.xy-1123-3-1130(-1, -3)(0, -1)(1, 1)(2, 3)y = 2x - 1
The four table solutions of y = 2x - 1, the points (-1, -3), (0, -1), (1, 1), and (2, 3), all fall on one straight line. Extended in both directions, that line is the complete graph: every point on it is a solution, and every solution is a point on it.

Why do the points always line up instead of scattering? The table already hints at the reason: each time xx climbs by 11, the value of yy climbs by the same 22.

Why the solution points fall on a straight line#

Take the equation y=2x1y = 2x - 1 and watch yy as xx grows by 11. Going from any value xx to the next value x+1x + 1, the new yy is

2(x+1)1=2x+21=(2x1)+2,2(x + 1) - 1 = 2x + 2 - 1 = (2x - 1) + 2,

which is exactly 22 more than the old yy. This increase of 22 does not depend on where you started. From x=0x = 0 to x=1x = 1, from x=5x = 5 to x=6x = 6, from anywhere to the next step, yy goes up by the same 22.

That steadiness is the whole reason the points line up. Each time you move one unit to the right, you move the same fixed amount up. So from any plotted point the next one sits one across and a fixed jump away, over and over. Repeating one identical step can never bend: it marches in a single fixed direction, and a single fixed direction is what a straight line is. The particular equation only sets the size of that vertical jump. Every linear equation, once yy is alone on one side, has its lone xx-term multiplied by a constant. So every such equation’s jump is a fixed number, and its graph is always straight. (Just how steep that line looks is the subject of the next lesson.)

The same routine graphs any linear equation. When the equation is not already solved for yy, solve for it first, then build the table.

Worked example 2 Graph x+y=4x + y = 4 from a table

First solve for yy by subtracting xx from both sides:

y=4x.y = 4 - x.

Now choose a few values of xx and compute yy:

xxy=4xy = 4 - xSolution (x,y)(x, y)
0044(0,4)(0, 4)
1133(1,3)(1, 3)
2222(2,2)(2, 2)
3311(3,1)(3, 1)

Plotting (0,4)(0, 4), (1,3)(1, 3), (2,2)(2, 2), and (3,1)(3, 1) gives four points that fall on one line, and drawing through them graphs x+y=4x + y = 4. Notice the check built into the table: the points really do line up. So a fourth row that landed off the line would warn you of an arithmetic slip.

Check your understanding

You are graphing y=3x2y = 3x - 2 with a table. Which ordered pair belongs in the table?

Answer choices

Graphing with the intercepts

Because two points are enough to fix a line, you do not need a long table. You need only two solutions, and two of them are especially easy to find and to plot: the points where the graph crosses the axes.

The x-intercept is the point where the line crosses the x-axis. Every point on the x-axis has y=0y = 0, so to find it, set y=0y = 0 and solve for xx. The y-intercept is the point where the line crosses the y-axis. Every point on the y-axis has x=0x = 0, so set x=0x = 0 and solve for yy. Each choice makes one term drop out, which keeps the arithmetic short.

Take 3x+2y=123x + 2y = 12. For the x-intercept, set y=0y = 0:

3x+2(0)=12,3x=12,x=4,3x + 2(0) = 12, \qquad 3x = 12, \qquad x = 4,

so the line crosses the x-axis at (4,0)(4, 0). For the y-intercept, set x=0x = 0:

3(0)+2y=12,2y=12,y=6,3(0) + 2y = 12, \qquad 2y = 12, \qquad y = 6,

so it crosses the y-axis at (0,6)(0, 6). Plot those two points, draw the line through them, and the graph is done.

Graphing 3x + 2y = 12 from its interceptsThe line 3x + 2y = 12 drawn through the two intercept points (0, 6) on the y-axis and (4, 0) on the x-axis.xy2462460(0, 6)(4, 0)3x + 2y = 12
Graphing 3x + 2y = 12 from its two intercepts. Setting y = 0 gives the x-intercept (4, 0); setting x = 0 gives the y-intercept (0, 6). The single line through those two points is the graph.

Two cautions keep this method reliable. The intercepts are just two convenient solutions. So if one of them turns out awkward (a fraction, say), you are free to pick an easier value of xx instead and use that point. And a line through the origin, such as y=2xy = 2x, has both intercepts at the very same point (0,0)(0, 0), because setting x=0x = 0 and setting y=0y = 0 both return the origin. In that one case you need a second point somewhere else, so choose any other xx and compute its yy.

Worked example 3 Graph 3x4y=123x - 4y = 12 using its intercepts

Find the x-intercept by setting y=0y = 0:

3x4(0)=12,3x=12,x=4,3x - 4(0) = 12, \qquad 3x = 12, \qquad x = 4,

so the x-intercept is (4,0)(4, 0). Find the y-intercept by setting x=0x = 0:

3(0)4y=12,4y=12,y=3,3(0) - 4y = 12, \qquad -4y = 12, \qquad y = -3,

so the y-intercept is (0,3)(0, -3). The second intercept is below the x-axis, which is fine. Plot (4,0)(4, 0) on the x-axis and (0,3)(0, -3) on the y-axis, then draw the line through the two points to graph 3x4y=123x - 4y = 12.

Check your understanding

What is the x-intercept of the graph of 5x+2y=205x + 2y = 20?

Answer choices

Horizontal and vertical lines

Two kinds of lines look different from the slanted ones above, and they come from equations that mention only one variable.

Consider y=3y = 3. Read literally, it says the y-coordinate is 33 and says nothing at all about xx. So xx is free to be any number while yy must stay 33: the pairs (2,3)(-2, 3), (0,3)(0, 3), (1,3)(1, 3), and (100,3)(100, 3) are all solutions. Plot a few and they sit at the same height, three units above the x-axis. Connecting them gives a horizontal line. Every equation of the form y=cy = c graphs as a horizontal line at height cc.

Now consider x=2x = -2. It fixes the x-coordinate at 2-2 and says nothing about yy. So this time yy is free and xx stays 2-2: the pairs (2,2)(-2, -2), (2,0)(-2, 0), and (2,2)(-2, 2) are all solutions. They line up in a single column two units left of the y-axis, and connecting them gives a vertical line. Every equation of the form x=cx = c graphs as a vertical line through x=cx = c.

A horizontal line y = 3 and a vertical line x = -2The horizontal line y = 3 sits three units above the x-axis and the vertical line x = -2 sits two units left of the y-axis; they cross at (-2, 3).xy-22-230(-2, 3)y = 3x = -2
The equation y = 3 graphs as a horizontal line at height 3, and x = -2 graphs as a vertical line two units left of the y-axis. They cross at (-2, 3), the one point whose coordinates satisfy both equations.

These fit the same pattern as the slanted lines. You can write y=3y = 3 as 0x+y=30 \cdot x + y = 3: the coefficient of xx is zero, so changing xx changes nothing and yy stays pinned at 33. In the same way, x=2x = -2 is x+0y=2x + 0 \cdot y = -2. They are ordinary linear equations, just with one of the two coefficients equal to zero. A quick way to keep them straight is to read the equation as a rule about one coordinate. Read that way, y=3y = 3 says “stay at height 33” (a flat, horizontal line), and x=2x = -2 says “stay in the column 2-2” (a standing, vertical line).

Worked example 4 Graph x=4x = 4 and y=1y = -1 on the same axes

The equation x=4x = 4 fixes the x-coordinate at 44 and leaves yy free. Therefore its solutions are (4,3)(4, -3), (4,0)(4, 0), (4,2)(4, 2), and so on, all in the column four units right of the y-axis. They form a vertical line through x=4x = 4.

The equation y=1y = -1 fixes the y-coordinate at 1-1 and leaves xx free. Therefore its solutions are (3,1)(-3, -1), (0,1)(0, -1), (2,1)(2, -1), and so on, all at the height one unit below the x-axis. They form a horizontal line through y=1y = -1.

Drawn on the same axes, the vertical line x=4x = 4 and the horizontal line y=1y = -1 cross at the single point where both rules hold at once, namely (4,1)(4, -1).

Check your understanding

Which of these equations graphs as a horizontal line?

Answer choices

Checking whether a point is on a line

Because the graph is exactly the set of solutions, deciding whether a given point lies on a line takes no drawing at all. Substitute the point’s coordinates into the equation. If the two sides come out equal, the point is a solution and sits on the line. If they do not, the point is off the line.

Is (3,5)(3, 5) on the graph of y=2x1y = 2x - 1? Put in x=3x = 3 and y=5y = 5:

2(3)1=5,2(3) - 1 = 5,

and the right side equals the point’s yy-value of 55, so (3,5)(3, 5) is on the line. Is (2,4)(2, 4) on the graph of 3x+2y=123x + 2y = 12? Substitute:

3(2)+2(4)=6+8=14,3(2) + 2(4) = 6 + 8 = 14,

which is not 1212, so (2,4)(2, 4) is not on the line. The test is the same substitution you used to check solutions last lesson, now read geometrically. On the line means the pair solves the equation, and off the line means the pair does not.

Worked example 5 Find a missing coordinate so a point lies on a line

The point (k,7)(k, 7) lies on the line y=2x1y = 2x - 1. Because the point is on the line, its coordinates must satisfy the equation, so substitute y=7y = 7 and solve for the unknown xx-coordinate kk:

7=2k1,8=2k,k=4.7 = 2k - 1, \qquad 8 = 2k, \qquad k = 4.

So the point is (4,7)(4, 7).

For a second case, find the point on 3x+2y=123x + 2y = 12 whose x-coordinate is 11. Substitute x=1x = 1 and solve for yy:

3(1)+2y=12,2y=9,y=92.3(1) + 2y = 12, \qquad 2y = 9, \qquad y = \tfrac{9}{2}.

So the point is (1,92)\left(1, \tfrac{9}{2}\right). The fractional yy is no problem: the line passes through plenty of points that do not land on whole-number grid marks, and this is one of them.

Common mistakes

Practice

Multiple Choice Questions (MCQ)

Progressively harder sets of questions. Each opens on its own page.

Free Response Questions (FRQ)

Longer questions in parts, to be worked out on paper. Progressive hints, the answer on its own so you can check yourself and try again, then the full worked solution, plus a rubric to mark your own work against.

Free response Work it out on paper 5 questions Start →
More practice (optional)

Extra sets, as hard as the Challenge set. Each one opens on its own page.

More resources (optional)

Other explanations of this lesson, if you want a second take.

A bit of history (Optional)

For centuries people solved equations without ever drawing one. An equation was something you worked on in words and numbers. Nobody thought to look at it.

One early break came from Nicole Oresme, a French scholar of the 1300s who later became a bishop. He wanted a way to picture how one quantity shifts while a second quantity shifts alongside it. So he drew the second quantity as a row of upright bars, each bar as tall as the value it stood for. When a quantity grew at a steady rate, the tops of those bars ran along a straight edge. Steady change, he saw, has a straight shape. That is the claim this whole lesson rests on, noticed about three hundred years early.

Oresme had no grid to draw it on. That arrived in the 1630s, from Rene Descartes and Pierre de Fermat, two Frenchmen who reached it separately and never worked together. Their move was to let a pair of numbers name a point, so an equation in xx and yy could name a whole curve. Only after that could anyone ask what an equation looks like.

The name of your subject keeps the answer on record. Linear comes from linea, the Latin word for a line, because the solutions of ax+by=cax + by = c always land on one. Find two of them and draw.