How to Graph a Line
A linear equation describes a straight line, and graphing it just means finding points that satisfy the equation and drawing the line through them. There are a couple of efficient ways to do this — the most common starting point is slope-intercept form.
Slope-Intercept Form
The most common form of a linear equation is:
$$y = mx + b$$
The two numbers that define the line are m (the slope) and b (the y-intercept).
The y-intercept is the value of \(y\) when \(x = 0\) — in other words, the point where the line crosses the vertical axis. If \(b = 3\), the line passes through \((0, 3)\).
The slope describes how steep the line is and which direction it tilts. Slope is rise over run:
$$m = \frac{\text{rise}}{\text{run}} = \frac{\text{change in } y}{\text{change in } x}$$
A slope of \(\frac{2}{3}\) means: move right 3 units, go up 2. A slope of \(-\frac{1}{2}\) means: move right 2 units, go down 1. A slope of 4 is steep; a slope of \(\frac{1}{10}\) is nearly flat.
How to Graph a Line
The quickest method has two steps: plot the y-intercept, then use the slope to find a second point.
Example 1
Graph \(y = 2x + 1\).
Step 1 — Plot the y-intercept. The equation has \(b = 1\), so the line passes through \((0, 1)\). Put a point there.
Step 2 — Use the slope to find another point. The slope is \(2 = \frac{2}{1}\), meaning rise 2 and run 1. Starting from \((0, 1)\), move right 1 and up 2 to reach \((1, 3)\). Put a point there too.
Step 3 — Draw the line. Connect the two points and extend the line in both directions.
You can always check by plugging a value into the equation. Let's try \(x = 2\): \(y = 2(2) + 1 = 5\). The point \((2, 5)\) should be on your line.
Example 2
Graph \(y = -\frac{1}{2}x + 4\).
The y-intercept is \(4\), so start at \((0, 4)\). The slope is \(-\frac{1}{2}\): move right 2 and down 1 to reach \((2, 3)\). Plot both points and connect them.
When the slope is negative, the line falls from left to right. When it's positive, the line rises.
Horizontal and Vertical Lines
An equation like \(y = 5\) has no slope term — it's a horizontal line passing through every point where \(y = 5\). It's perfectly flat.
An equation like \(x = 3\) is a vertical line through \(x = 3\). Vertical lines have an undefined slope because you'd be dividing by zero in the rise-over-run formula (no horizontal movement).
Point-Slope Form
Sometimes you're given a point and a slope instead of a full equation. The point-slope form handles this directly:
$$y - y_1 = m(x - x_1)$$
where \((x_1, y_1)\) is the known point and \(m\) is the slope.
Example 3
A line passes through \((3, 5)\) with slope \(-2\). Graph it.
Write the equation: \(y - 5 = -2(x - 3)\).
To graph it, start at \((3, 5)\) — that's your known point. The slope is \(-2 = \frac{-2}{1}\), so move right 1 and down 2 to land on \((4, 3)\). Draw the line through both points.
If you want slope-intercept form instead, just solve for \(y\): $$y - 5 = -2x + 6 \implies y = -2x + 11$$
Either form gives you the same line — it's just two different starting points for the same information.
Practice Problems
1. Identify the slope and y-intercept of \(y = 3x - 2\). Show answerSlope \(m = 3\), y-intercept \(b = -2\). The line crosses the y-axis at \((0, -2)\) and rises steeply to the right.
2. Graph \(y = \frac{1}{3}x + 2\). What point does the line cross the y-axis? What second point do you land on after applying the slope? Show answerY-intercept: \((0, 2)\). Slope \(\frac{1}{3}\) means right 3, up 1 — second point: \((3, 3)\).
3. Write the equation of a line with slope \(4\) that passes through \((1, -1)\), then convert it to slope-intercept form. Show answerPoint-slope: \(y - (-1) = 4(x - 1)\). Expanding: \(y + 1 = 4x - 4\), so \(y = 4x - 5\).
4. A line passes through \((-2, 6)\) and \((4, -3)\). Find the slope, then write the equation. Show answerSlope: \(m = \frac{-3 - 6}{4 - (-2)} = \frac{-9}{6} = -\frac{3}{2}\). Using point \((4, -3)\): \(y + 3 = -\frac{3}{2}(x - 4)\), which gives \(y = -\frac{3}{2}x + 3\).
5. What is the slope and y-intercept of \(2x + 4y = 8\)? (Hint: solve for \(y\) first.) Show answerSolving: \(4y = -2x + 8 \implies y = -\frac{1}{2}x + 2\). Slope \(m = -\frac{1}{2}\), y-intercept \(b = 2\).