Graphing a linear equation
The equation y = 2x − 1 has infinitely many solutions, such as (0, −1), (1, 1) and (2, 3). Plotted, they all sit on one straight line.
Solutions are ordered pairs
The equations in the linear equations course had one variable and usually one solution. An equation such as y = 2x − 1 has two variables, and its solutions are pairs of numbers: an x and a y that make the equation true together. Pick x = 2, work out y = 2 × 2 − 1 = 3, and the ordered pair (2, 3) is a solution. Pick x = 0 and you get (0, −1). Every choice of x gives exactly one y, so there are infinitely many solutions, far too many to list. A graph shows them all at once.
Plot several solutions of y = 2x − 1 and they line up exactly. That is true of every linear equation in two variables, an equation that can be written as Ax + By = C with A and B not both zero: the graph is a straight line, and every point on the line is a solution. Points off the line are not solutions. So the graph is a picture of the solution set, and reading a point from the line is the same as reading a solution.
| x | y = 2x − 1 | (x, y) |
|---|---|---|
| −1 | 2(−1) − 1 = −3 | (−1, −3) |
| 0 | 2(0) − 1 = −1 | (0, −1) |
| 1 | 2(1) − 1 = 1 | (1, 1) |
| 2 | 2(2) − 1 = 3 | (2, 3) |
Plot three points, then draw
Two points are enough to fix a line, but OpenStax recommends finding three. If all three line up, you can be confident; if one is off, a calculation went wrong and the third point shows it. Choose small x-values such as −1, 0 and 1, or values that make the arithmetic easy. For y = (1/2)x + 3, choose even numbers such as 0, 2 and 4, so y comes out whole: (0, 3), (2, 4), (4, 5). Then draw the line through the points with arrows on both ends, because it keeps going.
Two points are especially quick to find. The y-intercept is where the line crosses the y-axis, so x = 0 there. The x-intercept is where it crosses the x-axis, so y = 0 there. For x + 2y = 6, put x = 0 to get 2y = 6 and the y-intercept (0, 3). Put y = 0 to get x = 6 and the x-intercept (6, 0). Two intercepts and one check point give a quick, reliable graph. Some lines are even simpler: y = 4 is a horizontal line through every point with y-coordinate 4, and x = −2 is a vertical line.
The line also works as a test. To decide whether (3, 5) is a solution of y = 2x − 1 you can substitute, 2 × 3 − 1 = 5, or you can look: the point sits on the line. The point (1, 2) is off the line, and substituting agrees, because 2 × 1 − 1 = 1, not 2. In the graph lab, move the slope and intercept sliders and watch the five table points ride along with the line; each one is still a solution of the new equation.
Drag to turn. Scroll or pinch to zoom.
- Is (3, 5) on the line y = 2x − 1?
- Yes
- No
- Is (1, 2) on the line y = 2x − 1?
- Yes
- No
- Is (2, −2) on the line y = −3x + 4?
- Yes
- No
- For y = 2x − 1, what is y when x = 4?
- What is the x-coordinate of the x-intercept of x + 2y = 6?
- What is the y-coordinate of the y-intercept of x + 2y = 6?
- What is the x-coordinate of the x-intercept of 3x − 4y = 12?
- What is the y-coordinate of the y-intercept of 3x − 4y = 12?
- What does the graph of y = 4 look like?
- A horizontal line
- A vertical line
- A line through the origin
- A single point
- Why plot a third point when two fix the line?
- To catch a calculation mistake
- Because a line needs three points
- To find the slope
- To make the line longer
- A solution of an equation in two variables is an ordered pair.
- The graph of a linear equation is a straight line of all its solutions.
- Find three points; the third is a check.
- Intercepts: put x = 0 for the y-intercept, y = 0 for the x-intercept.