Equation of a Line Through Two Points — Definition, Formula & Examples
The equation of a line through two points is a linear equation determined by substituting two known coordinate pairs into the slope formula, then using that slope with either point to write the line's equation. Given any two distinct points, this process produces the unique line passing through both.
Given two distinct points and where , the equation of the line through them is , where . If , the line is vertical with equation .
Key Formula
Where:
- = Slope of the line
- = First given point
- = Second given point
How It Works
To find the equation, start by computing the slope from the two points using the slope formula. Then plug that slope and either point into point-slope form. Finally, simplify into slope-intercept form if needed. You can verify your result by checking that both original points satisfy the final equation.
Worked Example
Problem: Find the equation of the line through the points (1, 2) and (4, 8).
Step 1: Find the slope: Use the slope formula with the two points.
Step 2: Write in point-slope form: Substitute the slope and one of the points—here (1, 2)—into point-slope form.
Step 3: Simplify to slope-intercept form: Distribute and solve for y.
Step 4: Verify: Check the second point (4, 8): y = 2(4) = 8. It checks out.
Answer: The equation of the line is .
Another Example
Problem: Find the equation of the line through (-3, 7) and (5, 1).
Step 1: Find the slope: Compute the change in y over the change in x.
Step 2: Use point-slope form: Substitute the slope and the point (5, 1).
Step 3: Convert to slope-intercept form: Distribute and isolate y.
Answer: The equation is .
Visualization
Why It Matters
This technique appears constantly in Algebra 1, Algebra 2, and on the SAT/ACT. In science and statistics, you often have two data points and need to model a trend between them—for instance, predicting future values from two known measurements. It also forms the foundation for more advanced topics like linear interpolation and constructing the line of best fit.
Common Mistakes
Mistake: Subtracting coordinates in different orders, such as computing (y₂ − y₁) in the numerator but (x₁ − x₂) in the denominator.
Correction: Always subtract in the same order. If you do y₂ − y₁ on top, you must do x₂ − x₁ on the bottom. Mixing the order flips the sign of the slope.
Mistake: Forgetting to distribute the slope to both terms inside the parentheses in point-slope form.
Correction: In , multiply m by both and . For example, becomes , not .
Check Your Understanding
Find the equation of the line through (0, 5) and (3, -1).
Hint: Start by finding the slope using the slope formula.
Answer:
Find the equation of the line through (-2, -4) and (6, 12).
Hint: The slope is .
Answer:
Two points on a line are (10, 3) and (10, 9). What is the equation of the line?
Hint: What happens when both x-coordinates are the same?
Answer: (a vertical line — slope is undefined)
