Graphing Linear Equations
A linear equation is an equation whose graph is a straight line. These equations show up everywhere in real life: the relationship between hours worked and money earned, the connection between distance traveled and time, even the pattern of how temperature changes throughout the day can sometimes be linear.
The standard form of a linear equation in two variables is something like \(y = 2x + 3\) or \(3x + 2y = 12\). What makes these linear? When you graph all the possible solutions, they form a straight line.
Why Lines Are Special
Here's what makes a linear equation different from other types: it has no exponents on the variables (other than 1), no variables being multiplied together, and no variables in denominators. That's it. If an equation meets these criteria, its graph will be a line.
These are linear: \(y = 3x - 5\), \(2x + y = 7\), \(y = -x + 1\)
These are NOT linear: \(y = x^2\), \(xy = 5\), \(y = \frac{1}{x}\)
Graphing by Making a Table
The most basic way to graph a linear equation is to create a table of \(x\) and \(y\) values, plot those points, and connect them with a line.
Example: Graph \(y = 2x + 1\).
Step 1: Choose some values for \(x\). You can pick any numbers, but small integers make the arithmetic easier. Let's use -2, -1, 0, 1, and 2.
Step 2: Calculate the corresponding \(y\) values.
When \(x = -2\): \(y = 2(-2) + 1 = -4 + 1 = -3\)
When \(x = -1\): \(y = 2(-1) + 1 = -2 + 1 = -1\)
When \(x = 0\): \(y = 2(0) + 1 = 0 + 1 = 1\)
When \(x = 1\): \(y = 2(1) + 1 = 2 + 1 = 3\)
When \(x = 2\): \(y = 2(2) + 1 = 4 + 1 = 5\)
Step 3: Organize this in a table.
| \(x\) | \(y\) |
|---|---|
| -2 | -3 |
| -1 | -1 |
| 0 | 1 |
| 1 | 3 |
| 2 | 5 |
Step 4: Plot these points on a coordinate plane: \((-2, -3)\), \((-1, -1)\), \((0, 1)\), \((1, 3)\), \((2, 5)\).
Step 5: Draw a line through the points. Extend it in both directions with arrows to show it continues infinitely.
Notice that all five points line up perfectly. That's because the equation is linear. If even one point didn't line up, you'd know you made a calculation error.
How Many Points Do You Need?
Technically, you only need two points to draw a line. But using three or more points is safer because it helps you catch mistakes. If two points are off, you might not notice, but if one of three points doesn't line up, you'll see the problem immediately.
Example: Graph \(y = -x + 3\) using three points.
Choose \(x = -1, 0, 1\).
When \(x = -1\): \(y = -(-1) + 3 = 1 + 3 = 4\)
When \(x = 0\): \(y = -(0) + 3 = 3\)
When \(x = 1\): \(y = -(1) + 3 = -1 + 3 = 2\)
Plot \((-1, 4)\), \((0, 3)\), \((1, 2)\). All three should be in a straight line. Draw the line through them.
Graphing When the Equation Isn't Solved for y
Sometimes you'll see an equation like \(2x + y = 6\) that isn't already solved for \(y\). You have two options: solve for \(y\) first, or just work with it as-is.
Example: Graph \(x + y = 5\).
Option 1: Solve for \(y\) first. $$y = 5 - x$$
Now make a table using this equation.
Option 2: Pick \(x\) values and find \(y\) directly.
When \(x = 0\): \(0 + y = 5\), so \(y = 5\). Point: \((0, 5)\)
When \(x = 1\): \(1 + y = 5\), so \(y = 4\). Point: \((1, 4)\)
When \(x = 2\): \(2 + y = 5\), so \(y = 3\). Point: \((2, 3)\)
Either way works. Do whatever feels easier to you.
Example: Graph \(3x - 2y = 6\).
This one is messier, so let's solve for \(y\) first.
$$-2y = -3x + 6$$ $$y = \frac{3x - 6}{2}$$
Or simplified: \(y = \frac{3}{2}x - 3\)
Now create a table. Because there's a fraction in the equation, choose \(x\) values that make the arithmetic clean — multiples of 2 work well here.
When \(x = 0\): \(y = \frac{3}{2}(0) - 3 = -3\)
When \(x = 2\): \(y = \frac{3}{2}(2) - 3 = 3 - 3 = 0\)
When \(x = 4\): \(y = \frac{3}{2}(4) - 3 = 6 - 3 = 3\)
Plot \((0, -3)\), \((2, 0)\), \((4, 3)\) and draw the line.
Horizontal and Vertical Lines
Some linear equations produce horizontal or vertical lines.
Example: Graph \(y = 3\).
This equation says that \(y\) is always 3, no matter what \(x\) is. So every point on this graph has a \(y\)-coordinate of 3: \((-2, 3)\), \((0, 3)\), \((1, 3)\), \((5, 3)\), and so on.
This forms a horizontal line passing through \((0, 3)\).
Example: Graph \(x = -2\).
This equation says \(x\) is always -2, regardless of \(y\). Every point has an \(x\)-coordinate of -2: \((-2, -3)\), \((-2, 0)\), \((-2, 4)\), etc.
This forms a vertical line passing through \((-2, 0)\).
Horizontal lines have equations like \(y = c\) where \(c\) is a constant.
Vertical lines have equations like \(x = c\) where \(c\) is a constant.
Finding Intercepts
The \(x\)-intercept is where the line crosses the \(x\)-axis. At this point, \(y = 0\).
The \(y\)-intercept is where the line crosses the \(y\)-axis. At this point, \(x = 0\).
Finding intercepts is a quick way to get two useful points for graphing.
Example: Find the intercepts of \(2x + 3y = 12\).
For the \(x\)-intercept, set \(y = 0\). For the \(y\)-intercept, set \(x = 0\). What do you get? Show answer\(x\)-intercept: \(2x = 12\), so \(x = 6\). Point: \((6, 0)\). \(y\)-intercept: \(3y = 12\), so \(y = 4\). Point: \((0, 4)\).
Plot these two points and draw the line through them.
Practice Problems
-
Make a table and graph \(y = x + 2\) using \(x = -2, 0, 2\). Show answerWhen \(x = -2\), \(y = 0\). When \(x = 0\), \(y = 2\). When \(x = 2\), \(y = 4\). Plot \((-2, 0)\), \((0, 2)\), \((2, 4)\).
-
Graph \(y = -2x + 4\) using at least three points. Show answerChoose \(x = 0, 1, 2\). You get \(y = 4, 2, 0\). Plot \((0, 4)\), \((1, 2)\), \((2, 0)\).
-
Graph \(x + y = 7\). Show answerSolve for \(y\): \(y = 7 - x\). Use \(x = 0, 3, 7\) to get points \((0, 7)\), \((3, 4)\), \((7, 0)\).
-
Graph \(y = -1\). Show answerHorizontal line passing through every point where \(y = -1\).
-
Find the \(x\)- and \(y\)-intercepts of \(4x - 2y = 8\), then graph the line. Show answer\(x\)-intercept: set \(y = 0\), get \(x = 2\), so \((2, 0)\). \(y\)-intercept: set \(x = 0\), get \(y = -4\), so \((0, -4)\).
What's Next?
A handful of habits make graphing cleaner. Extend the line in both directions with arrows; a finite segment isn't the same as a line. Plot three points instead of two, so a calculation error stands out instead of going undetected. Use a ruler — wobbly lines are hard to read. And when graphing horizontal or vertical lines, remember that \(y = 3\) is horizontal (the \(y\)-value stays at 3 while \(x\) varies) and \(x = 3\) is vertical (the \(x\)-value stays at 3 while \(y\) varies).
Graphing by table works for any linear equation, but it's not always the fastest method. The next step, slope-intercept form, lets you read both the slope and the \(y\)-intercept directly from the equation — usually faster than building a table.