How to write a line equation from two points
Find the slope first, anchor it to either point, then convert forms only if the problem needs a different presentation.
How to recognize the method, run it, and know when it is the wrong choice.
Updated July 13, 2026Point-slope form uses the information you already have, so it is usually the least error-prone starting point.
Check for a vertical line first
If the x-coordinates are equal, the slope denominator is zero and the line is vertical. Its equation is x equal to that shared coordinate.
Otherwise compute the slope with consistent subtraction order and simplify before substituting.
Either point gives the same line
Once the slope is known, substitute either given point into point-slope form. The two resulting equations look different before simplification but describe the same set of points.
Using the point with smaller or simpler coordinates often makes expansion easier.
Verify with both points
A correct equation must make a true statement for each original point. Testing both catches a wrong slope and a wrong intercept quickly.
If slope-intercept form is requested, isolate y only after the point-slope equation is secure.
Find the equation through (−2, 5) and (4, −1).
Compute the slope.
Use the point (−2, 5).
Distribute and isolate y.
Verify the second point.
Common mistakes
- Dividing y-change by x-change with inconsistent order.
- Substituting a point as (y, x).
- Stopping without checking the second point.
Three takeaways
- Handle vertical lines separately.
- Point-slope form is the natural starting form.
- Both points must satisfy the result.