Lesson 5 of 8
Writing Equations & Slope From Two Points
Sometimes you're given two points and asked for the line through them. First find the slope, then find the y-intercept.
Slope from two points
Slope m equals (y2 - y1) divided by (x2 - x1). Subtract the y's on top and the x's on the bottom, in the same order.
- 1Find the line through (1, 3) and (3, 7)
- 2Slope m = (7 - 3) / (3 - 1) = 4 / 2 = 2
- 3Plug a point and the slope into y = mx + b: 3 = 2(1) + b
- 4Solve for b: 3 = 2 + b, so b = 1
- 5The equation is y = 2x + 1
REMEMBER
Keep the order consistent. If the first y is on top, the first x must be on the bottom. Mixing the order flips the sign of your slope.
A horizontal line has slope 0 (no rise). A vertical line has an undefined slope (no run, you can't divide by zero).