You find the slope with m = (y₂ − y₁)/(x₂ − x₁), then substitute one point into y = mx + b to solve for b. For the points (2, 5) and (6, 13), that gives m = 2 and b = 1, so the equation is y = 2x + 1. The method works for every pair of distinct points with different x-values — and it fails loudly the moment the two x-values match.

Reading the Two-Point Problem Before You Substitute

Every two-point exercise hides a small decision: are the coordinates integers, and does the line rise, fall, or run vertical? The slope formula sorts that out first. Put the points in a fixed order — call one (x₁, y₁) and the other (x₂, y₂) — and subtract in the same direction on both the top and bottom. Switching order midway is the single most common sign error in student work.

Labeling is not cosmetic. If you write m = (y₁ − y₂)/(x₂ − x₁), you have flipped the sign of the numerator while leaving the denominator alone, and every downstream number inherits the mistake. Pick a direction and commit: second minus first, top and bottom.

Check the x-values before anything else. When x₁ = x₂, the denominator is zero and no slope exists — the line is vertical and cannot be written in slope-intercept form at all. This is not a technicality; it is the one case where the requested form is impossible, and it deserves its own answer rather than a forced decimal.

A quick mental sketch helps too. Two points in the same quadrant with the second higher and to the right give a positive slope; if the second is lower and to the right, expect a negative one. If your computed slope contradicts the sketch, recheck the subtraction before touching b.

The Slope Formula in Plain Arithmetic

The slope is the vertical change divided by the horizontal change between the two points: m = (y₂ − y₁)/(x₂ − x₁). For (2, 5) and (6, 13), the rise is 13 − 5 = 8 and the run is 6 − 2 = 4, so m = 8/4 = 2. A slope of 2 means the line climbs two units for every one unit it moves right.

Keep the subtraction inside parentheses. Writing 13 − 5 over 6 − 2 without brackets is fine on paper but invites order-of-operations slips in typed work, where 13 − 5/6 − 2 evaluates to something entirely different. Bracket both differences.

Negative coordinates are where most errors live. Take (−3, 4) and (5, −2): the rise is −2 − 4 = −6 and the run is 5 − (−3) = 8, giving m = −6/8 = −3/4. The double negative in the run is the trap — subtracting a negative adds.

Reduce the fraction. A slope of 8/4 should be reported as 2, and −6/8 as −3/4, because the reduced form is what makes graphing and later parallel-perpendicular checks readable. Leaving 8/4 is not wrong, just unfinished.

Solving for the Intercept With Real Numbers

With m known, substitute either point into y = mx + b and isolate b. Using m = 2 and the point (2, 5): 5 = 2(2) + b, so 5 = 4 + b and b = 1. The finished equation is y = 2x + 1, and substituting (6, 13) confirms it: 13 = 2(6) + 1.

Either point gives the same b, which is a free self-check. If (2, 5) yields b = 1 and (6, 13) yields b = 3, you have an arithmetic error somewhere, not two valid answers. Recompute both rather than picking the one that looks nicer.

Watch the sign of b. For the points (1, −2) and (4, 7), the slope is (7 − (−2))/(4 − 1) = 9/3 = 3, and substituting (1, −2) gives −2 = 3(1) + b, so b = −5. The equation is y = 3x − 5, and the negative intercept must survive into the final line.

Fractions are normal, not a failure. Points (1, 2) and (3, 5) give m = 3/2, and substituting (1, 2) gives 2 = 3/2 + b, so b = 1/2. The equation is y = (3/2)x + 1/2. Leave it as a fraction unless a decimal is requested.

Worked Table: Four Point Pairs, Four Equations

Run the same three-step routine on each pair below and compare your work to the table. The fourth row is the one worth studying, because the intercept lands on a fraction that many students round without noticing.

Points Slope m Intercept b Equation
(2, 5), (6, 13) 2 1 y = 2x + 1
(−3, 4), (5, −2) −3/4 7/4 y = −(3/4)x + 7/4
(1, −2), (4, 7) 3 −5 y = 3x − 5
(0, 3), (4, 0) −3/4 3 y = −(3/4)x + 3

Row two deserves a second look. Substituting (−3, 4) into y = −(3/4)x + b gives 4 = 9/4 + b, so b = 16/4 − 9/4 = 7/4. The intercept is not a whole number, and writing it as 1.75 is acceptable only if decimals were requested.

Row four shows the shortcut in action: when one point sits on the y-axis, its y-value is b immediately. That is the definition of the y-intercept, and spotting it saves a full substitution step.

When the Intercept Comes Out as a Fraction

Fractional intercepts are the most common place students lose points on otherwise correct work. The equation y = −(3/4)x + 7/4 is exact; y = −0.75x + 1.75 is a rounded cousin that may not satisfy the original points when substituted back. Keep fractions unless the problem specifies decimals.

Check by substitution when in doubt. Plug x = 5 into y = −(3/4)(5) + 7/4 and you get −15/4 + 7/4 = −8/4 = −2, which matches the original point (5, −2). That one-line verification catches sign errors in b that a glance will not.

Mixed forms cause trouble too. Writing y = −3x/4 + 7/4 is mathematically identical to y = −(3/4)x + 7/4, but the parenthesized coefficient is clearer when graphing, because the slope reads as a single number. Prefer the grouped version in written answers.

If a course insists on decimals, carry at least three places and state the rounding. Two decimal places can shift a line enough to miss a plotted point on graph paper, and the discrepancy looks like a wrong answer when it is only a rounding choice.

Failure Case: Same x-Value, No Slope-Intercept Answer

Take the points (4, 1) and (4, 7). The run is 4 − 4 = 0, so the slope is 7 − 1 over 0 — undefined. The line is vertical, its equation is x = 4, and no value of m or b can produce it in y = mx + b form. This is the edge scenario that two-point worksheets deliberately include.

Teachers phrase the question differently to test whether you notice. "Write the equation of the line through (4, 1) and (4, 7)" has the answer x = 4, not "no solution." A blank or a forced y = 0x + 4 both miss the point: the second describes a horizontal line through (0, 4), which is a different line entirely.

The same trap appears in reverse with (2, 3) and (9, 3). Here the rise is zero, the slope is 0, and the equation is y = 3 — which does fit slope-intercept form as y = 0x + 3. Horizontal lines are fine; vertical lines are the exception.

Test writers exploit the confusion between "zero slope" and "no slope." Zero slope means flat and fits the form; undefined slope means vertical and does not. If your answer says "slope is undefined," stop and write the vertical-line equation instead of hunting for b.

Checking the Answer With a Parallel-Line Probe

A fast correctness test most walkthroughs skip: build a second line with the same slope through a different point and confirm the two lines never meet. Take y = 2x + 1 from the opening example and a parallel line through (0, 6), which is y = 2x + 6. Setting 2x + 1 = 2x + 6 gives 1 = 6, a contradiction — so the lines are parallel, as they must be.

This probe catches slope errors that substitution alone can miss. If your computed slope for the original pair had been 3 instead of 2, the parallel test would still "pass" for the wrong line, so pair it with substitution into both original points. The two checks together are hard to fool.

The probe also answers a common follow-up question. "Find the line through (5, 0) parallel to the line through (2, 5) and (6, 13)" reduces to reusing m = 2 and solving 0 = 2(5) + b, giving b = −10 and y = 2x − 10. The slope work is already done; only the intercept is new.

Perpendicular questions flip the slope to its negative reciprocal instead. The line perpendicular to y = 2x + 1 has slope −1/2, so through (4, 3) it becomes 3 = −2 + b, b = 5, and y = −(1/2)x + 5. Same subroutine, one transformed number.

Rebuilding Slope-Intercept From Standard Form

Plenty of homework hands you 3x + 4y = 12 and asks for the slope-intercept version, which is the same skill in reverse. Isolate y: 4y = −3x + 12, then y = −(3/4)x + 3. The slope is −3/4 and the intercept is 3, matching the fourth table row — because (0, 3) and (4, 0) both satisfy that standard-form equation.

Reading slope and intercept straight off standard form is a frequent error. In 3x + 4y = 12, the slope is not 3 and the intercept is not 12; both require the division by 4. The coefficients only become m and b after y stands alone.

Converting back is just as mechanical. From y = −(3/4)x + 3, multiply every term by 4 to clear the fraction: 4y = −3x + 12, then 3x + 4y = 12. Integer coefficients are the usual reason to prefer standard form, and the round trip confirms no arithmetic was lost.

Both directions appear on standardized tests such as the SAT math section, where the College Board's practice materials routinely mix forms in a single question. Fluency in converting is worth more than memorizing either form alone.

A Four-Step Routine You Can Repeat

Here is the compact procedure, stripped to essentials and ordered the way you would actually write it on an exam page.

1: Label the points (x₁, y₁) and (x₂, y₂), and confirm x₁ ≠ x₂ before continuing. 2: Compute m = (y₂ − y₁)/(x₂ − x₁), keeping both differences bracketed, then reduce the fraction. 3: Substitute either point into y = mx + b and solve for b, watching signs on negative coordinates. 4: Write y = mx + b with m and b filled in, then verify by substituting the other point.

If step 1 fails because the x-values match, stop and write x = that value instead. If step 4 fails, the error is almost always in step 2 — a flipped subtraction — so recompute the slope before redoing b. The routine also scales to parallel and perpendicular variants: do steps 1–2, transform the slope if needed, then run steps 3–4.

Speed comes with repetition, not shortcuts. Doing four pairs in one sitting, as in the table above, builds the pattern recognition that turns a five-minute problem into a one-minute one.

FAQ

Can the y-intercept be zero, and what does that look like?

Yes — a line through (0, 0) has b = 0, so its equation is simply y = mx with the "+ 0" usually omitted. For points (0, 0) and (3, 6), the slope is 2 and the equation is y = 2x. This is a direct proportion, and its graph always passes through the origin, which distinguishes it from every other line in the same family.

Is slope-intercept form always the best final answer?

No. Vertical lines cannot be expressed in it at all, and standard form is often preferred when coefficients should be integers. Slope-intercept wins whenever you need to read the slope and intercept at a glance or graph quickly, which is why textbooks default to it for two-point problems.

Why do I get a different b depending on which point I use?

You shouldn't — if the slope is correct, both points yield the same b. A mismatch means the slope was computed with flipped subtraction, or one substitution has a sign error. Recompute m first, since that error propagates into both b calculations and is easier to spot.

Does the order of the two points change the slope?

No, as long as you subtract in the same direction on top and bottom. Reversing both gives (−8)/(−4) = 2, identical to 8/4. Reversing only one gives −2, which is wrong. Consistency, not order, is what protects the sign.

How is this different from point-slope form?

Point-slope is y − y₁ = m(x − x₁), which skips the solve-for-b step entirely and is faster when you only need an equation. Slope-intercept is the same line rearranged to expose b, so converting between them is just algebra: expand the point-slope form and isolate y.

What if the two points are identical?

Two identical points describe no unique line — infinitely many lines pass through a single location. The slope formula gives 0/0, which is undefined. A well-posed problem always supplies two distinct points; if yours doesn't, flag it rather than forcing an answer.