Chapter 10 · Relationships between two variables

Equations, Tables and Graphs: Three Views of One Rule

See how an equation, a table and a graph show the same relationship. Build a table and graph, match a line to an equation, and write an equation from a graph.

15 min read

An equation such as y=x+3y = x + 3 is a two-variable equation. It has two variables, which are letters that stand for numbers. You have met their roles before. Here xx is the independent variable: the number you choose. And yy is the dependent variable: the number the equation gives you once you choose xx.

This equation is a rule. It gives exactly one yy for each xx you choose. Choose x=2x = 2, and the rule gives y=2+3=5y = 2 + 3 = 5. The pair x=2x = 2, y=5y = 5 makes the equation true, because 5=2+35 = 2 + 3 is a true statement.

In this lesson you will show one rule in three ways: as an equation, as a table and as a graph. You will also move from one form to another.

You write a pair of values as an ordered pair (x,y)(x, y). The xx-value always comes first. So x=2x = 2, y=5y = 5 becomes (2,5)(2, 5).

A table lists some of the pairs that make an equation true, one pair in each row.

A graph shows pairs as points on the coordinate plane. This is a grid with a horizontal xx-axis and a vertical yy-axis. The axes meet at the origin, the point (0,0)(0, 0). The two numbers in an ordered pair are the point's coordinates. To plot (2,5)(2, 5), start at the origin, move 2 units right and then 5 units up. The order matters: (5,2)(5, 2) is a different point, 5 units right and 2 units up.

Key concept

One relationship, three views

An equation, a table and a graph can all describe the same relationship between xx and yy.

The graph of an equation is the set of all points (x,y)(x, y) whose coordinates make the equation true. A table lists a few of those pairs.

So, inside the part of the plane that a figure shows:

  • every point on the graph makes the equation true, and
  • every pair that makes the equation true is a point on the graph.

To be sure of a point's coordinates, read it at a gridline intersection. That is a place where two lines of the grid cross, one vertical and one horizontal.

Worked example

From an equation to a table and a graph

Complete a table for y=x+3y = x + 3 using x=0x = 0, 22, 44 and 66. Then graph the equation on a grid where each square is 1 unit.

  1. Substitute each x-value into the equation. To substitute means to replace a variable with a number. The equation says y is 3 more than x, so add 3 to each x-value.

    0+3=3,2+3=5,4+3=7,6+3=90 + 3 = 3, \quad 2 + 3 = 5, \quad 4 + 3 = 7, \quad 6 + 3 = 9
  2. Write each x with its y as an ordered pair, x first. Each pair makes the equation true, so these four pairs complete the table.

    (0,3),(2,5),(4,7),(6,9)(0, 3), \quad (2, 5), \quad (4, 7), \quad (6, 9)
  3. Plot each pair as a point. For (2, 5), start at the origin, move 2 units right and then 5 units up. Every coordinate is a whole number and each square is 1 unit, so every point lands on a gridline intersection.

  4. Draw a straight line through the points. You may do this because x can be any number, not only the four in the table. For an equation that adds the same number to every x, the pairs in between lie on the same straight line. Test one: x = 1 is not in the table. The equation gives y = 4, and the line passes through (1, 4).

    y=1+3=4y = 1 + 3 = 4

Answer

The table holds the pairs (0,3)(0, 3), (2,5)(2, 5), (4,7)(4, 7) and (6,9)(6, 9). The graph of y=x+3y = x + 3 is the straight line through those points. The table and the figure below show both.

Completed table for y = x + 3
xy = x + 3Ordered pair (x, y)
00
0+3=30 + 3 = 3
(0,3)(0, 3)
22
2+3=52 + 3 = 5
(2,5)(2, 5)
44
4+3=74 + 3 = 7
(4,7)(4, 7)
66
6+3=96 + 3 = 9
(6,9)(6, 9)
Coordinate grid from x 0 to 8 and y 0 to 10, with a grid step of 1, showing 6 plotted elements. Details: line 1 x plus -1 y equals -3; point at (0, 3), named (0, 3); point at (2, 5), named (2, 5); point at (4, 7), named (4, 7); point at (6, 9), named (6, 9); point at (1, 4), named (1, 4).
The graph of y=x+3y = x + 3 passes through the four table points and through the test point (1,4)(1, 4). Each grid square is 1 unit.

Every figure in this lesson uses the same grid. The horizontal axis is the xx-axis, for the independent variable. The vertical axis is the yy-axis, for the dependent variable. Each grid square is 1 unit wide and 1 unit tall. The grid shows xx from 0 to 8 and yy from 0 to 10.

In the figure above, each row of the table became one point: (0,3)(0, 3), (2,5)(2, 5), (4,7)(4, 7) and (6,9)(6, 9). The fifth point, (1,4)(1, 4), is the test from the last step. It was never in the table, yet it sits on the line.

The test point is on the line for a reason. Every equation in this lesson is one of two kinds: yy equals xx plus a fixed number, or yy equals a fixed number times xx. A fixed number is one that stays the same for every pair. For both kinds, the pairs that make the equation true lie along one straight line.

So when xx can be any number and you have plotted two or more points, the straight line through them is the graph. If xx could only be whole numbers, the graph would be separate points with no line between them.

The line carries on past the edges of the figure, but you can read only the part the figure shows.

Now suppose you have an equation and a figure with more than one line. Which line is the graph of the equation?

Use the key idea: the graph must pass through every point that makes the equation true. So you can test a line in three moves.

  1. Choose two or more whole-number xx-values.
  2. Use the equation to find the yy for each one. Keep the pairs that fit inside the figure.
  3. On this 1-unit grid, each whole-number pair sits at a gridline intersection. Does the line pass through it?

A line that misses even one of these points is not the graph of the equation. The figure below shows two lines to test, Line A and Line B.

Coordinate grid from x 0 to 8 and y 0 to 10, with a grid step of 1, showing 7 plotted elements. Details: line 1 x plus -1 y equals -2, named Line A; line 2 x plus -1 y equals 0, named Line B; point at (0, 2), named (0, 2); point at (4, 6), named (4, 6); point at (0, 0), named (0, 0); point at (4, 8), named (4, 8); point at (2, 4), named (2, 4).
Line A passes through (0,2)(0, 2), (2,4)(2, 4) and (4,6)(4, 6). Line B passes through (0,0)(0, 0), (2,4)(2, 4) and (4,8)(4, 8). Each grid square is 1 unit.

Worked example

Which line matches the equation?

The figure above shows Line A and Line B on a grid where each square is 1 unit. Which line is the graph of y=2xy = 2x?

  1. Choose two whole-number x-values and use the equation to find each y. The term 2x means 2 times x. Take x = 0 and x = 4.

    y=2×0=0,y=2×4=8y = 2 \times 0 = 0, \quad y = 2 \times 4 = 8
  2. The pairs (0, 0) and (4, 8) make the equation true, and both fit inside the figure. So the graph of y = 2x must pass through both points.

  3. Test Line A. At x = 0 it passes through (0, 2), not (0, 0). At x = 4 it passes through (4, 6), not (4, 8). Line A misses points that make the equation true, so it is not the graph.

  4. Test Line B. It passes through both (0, 0) and (4, 8). The graph of y = 2x is a straight line, and only one straight line passes through two different points. So Line B is that graph.

Answer

Line B is the graph of y=2xy = 2x.

You can also go the other way, from a graph to its equation. The plan has three parts.

  1. Read some points on the line. Use only points at gridline intersections, so both coordinates are exact. Do not guess at a place where the line passes between gridlines.
  2. List the points in a table. Look for one rule that turns every xx into its yy. In this lesson the rule is one of two kinds. An add rule says yy is xx plus a fixed number, like y=x+2y = x + 2 for Line A. A multiply rule says yy is a fixed number times xx, like y=2xy = 2x for Line B.
  3. Write the rule as an equation. Make sure it fits every point you read, not just one.

The figure below shows a new line to try. Its name is Line C.

Coordinate grid from x 0 to 8 and y 0 to 10, with a grid step of 1, showing 5 plotted elements. Details: line 3 x plus -1 y equals 0, named Line C; point at (0, 0), named (0, 0); point at (1, 3), named (1, 3); point at (2, 6), named (2, 6); point at (3, 9), named (3, 9).
Line C crosses gridline intersections at (0,0)(0, 0), (1,3)(1, 3), (2,6)(2, 6) and (3,9)(3, 9). Each grid square is 1 unit.

Worked example

From a graph to an equation

The figure above shows Line C on a grid where each square is 1 unit. Write an equation for Line C that gives yy for each xx.

  1. Read the marked points. Each one is at a gridline intersection, so its coordinates are exact. For example, one point is 1 unit right of the origin and 3 units up. That point is (1, 3).

    (0,0),(1,3),(2,6),(3,9)(0, 0), \quad (1, 3), \quad (2, 6), \quad (3, 9)
  2. Test for an add rule. Suppose y is x plus a fixed number. Then y minus x is that same number at every point, because taking x away from x plus the number leaves only the number. Here the differences change, so this is not an add rule.

    0−0=0,3−1=2,6−2=4,9−3=60 - 0 = 0, \quad 3 - 1 = 2, \quad 6 - 2 = 4, \quad 9 - 3 = 6
  3. Test for a multiply rule. At (1, 3) the fixed number must be 3, because 3 is the only number that gives 3 when you multiply it by 1. Try 3 at the other points. It gives the right y every time. The table after this example shows both tests side by side.

    3×0=0,3×2=6,3×3=93 \times 0 = 0, \quad 3 \times 2 = 6, \quad 3 \times 3 = 9
  4. Write the rule as an equation: y is 3 times x. Its graph is a straight line that passes through the points you read. Only one straight line passes through two different points, so that graph is Line C.

    y=3xy = 3x

Answer

An equation for Line C is y=3xy = 3x.

Points read from Line C, with both tests
xyAdd test: y minus xMultiply test: 3 times x
00
00
0−0=00 - 0 = 0
3×0=03 \times 0 = 0
11
33
3−1=23 - 1 = 2
3×1=33 \times 1 = 3
22
66
6−2=46 - 2 = 4
3×2=63 \times 2 = 6
33
99
9−3=69 - 3 = 6
3×3=93 \times 3 = 9

An equation, a table and a graph are three views of one relationship. Each pair that makes the equation true can be a row of the table and is a point on the graph.

So you can move between the views. Substitute values of xx to get pairs, then plot them. Test at least two points to match a straight line to an equation. Read points at gridline intersections, then find the one rule that fits them all.

Next, you will use these links to interpret graphs in word problems and to spot mistakes in graphing.