Method guideAlgebra IFoundational9 min read

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.

yy1=m(xx1)y-y_1=m(x-x_1)
Method guide

How to recognize the method, run it, and know when it is the wrong choice.

Updated July 13, 2026
RouteStart here
(x1,y1),(x2,y2)myy1=m(xx1)(x_1,y_1),(x_2,y_2)\to m\to y-y_1=m(x-x_1)

Point-slope form uses the information you already have, so it is usually the least error-prone starting point.

01

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.

x1=x2x=x1x_1=x_2\quad\Longrightarrow\quad x=x_1
02

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.

yy1=m(xx1)y-y_1=m(x-x_1)
03

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.

y=mx+by=mx+b
Worked exampleBuild the line

Find the equation through (−2, 5) and (4, −1).

1m=154(2)=66=1m=\frac{-1-5}{4-(-2)}=\frac{-6}{6}=-1

Compute the slope.

2y5=1(x+2)y-5=-1(x+2)

Use the point (−2, 5).

3y=x+3y=-x+3

Distribute and isolate y.

41=4+3-1=-4+3

Verify the second point.

Resulty=x+3\boxed{y=-x+3}
Watch for

Common mistakes

  1. Dividing y-change by x-change with inconsistent order.
  2. Substituting a point as (y, x).
  3. Stopping without checking the second point.
Keep

Three takeaways

  1. Handle vertical lines separately.
  2. Point-slope form is the natural starting form.
  3. Both points must satisfy the result.