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.

Graph of y = 2x + 1 with table of values and plotted points

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. Since we have a fraction, 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)\).

Graph of y = 3 showing horizontal line

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)\).

Graph of x = -2 showing vertical line

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\): $$2x + 3(0) = 12$$ $$2x = 12$$ $$x = 6$$

The \(x\)-intercept is \((6, 0)\).

For the \(y\)-intercept, set \(x = 0\): $$2(0) + 3y = 12$$ $$3y = 12$$ $$y = 4$$

The \(y\)-intercept is \((0, 4)\).

Plot these two points and draw the line through them.

Practice Problems

  1. Make a table and graph \(y = x + 2\) using \(x = -2, 0, 2\).

  2. Graph \(y = -2x + 4\) using at least three points.

  3. Graph \(x + y = 7\).

  4. Graph \(y = -1\).

  5. Find the \(x\)- and \(y\)-intercepts of \(4x - 2y = 8\), then graph the line.

Answers:

  1. When \(x = -2\), \(y = 0\). When \(x = 0\), \(y = 2\). When \(x = 2\), \(y = 4\). Plot \((-2, 0)\), \((0, 2)\), \((2, 4)\).

  2. Choose \(x = 0, 1, 2\). You get \(y = 4, 2, 0\). Plot \((0, 4)\), \((1, 2)\), \((2, 0)\).

  3. Solve for \(y\): \(y = 7 - x\). Use \(x = 0, 3, 7\) to get points \((0, 7)\), \((3, 4)\), \((7, 0)\).

  4. Horizontal line through \(y = -1\).

  5. \(x\)-intercept: set \(y = 0\), get \(x = 2\), so \((2, 0)\). \(y\)-intercept: set \(x = 0\), get \(y = -4\), so \((0, -4)\). Graph these two points.

Where Things Go Wrong

Forgetting to extend the line in both directions is a rookie mistake. Your line shouldn't stop at the points you plotted—it continues infinitely in both directions. Add arrows at the ends.

Plotting points incorrectly happens more often than you'd think. Double-check that you're putting the \(x\)-coordinate on the horizontal axis and the \(y\)-coordinate on the vertical axis. It's easy to flip them when you're rushing.

Using too few points and then missing a calculation error is frustrating. Three points are better than two because if one doesn't line up, you know something went wrong.

Wobbly lines make graphs hard to read and unprofessional. Use a ruler or straightedge. Lines should be straight.

The difference between horizontal and vertical lines confuses people constantly. \(y = 3\) is horizontal (the \(y\)-value stays at 3 while \(x\) changes). \(x = 3\) is vertical (the \(x\)-value stays at 3 while \(y\) changes).