HomeDerive a Linear Equation from Two Points: Slope-Intercept Method Free original lessons
Derive a Linear Equation from Two Points: Slope-Intercept Method
Learn to compute slope from two coordinate pairs, substitute into y = mx + b, solve for b, and write the equation with clear checks.
Free lesson
Four exercises
Worked answers
Algebra and Function Practice
When two points on a line are known, the line is uniquely determined. This lesson shows a reliable four-step routine: compute the slope from the two points, substitute one point and the slope into slope-intercept form, solve for the intercept, then write and verify the equation. The method works for any two distinct points with different x-coordinates. You will practice with integers and simple fractions, and you will learn to check your result by substituting both original points. A consistent convention is used throughout: slope is change in y divided by change in x, and the final equation is written as y = mx + b with m and b in simplest form.
Practice materials: Printable downloads are not available for this lesson yet. Use the instructions and four exercises below.
The four-step routine
Given two points (x1, y1) and (x2, y2), first compute the slope m = (y2 - y1) / (x2 - x1). Keep the subtraction order consistent: if you subtract the first y from the second y, subtract the first x from the second x in the same order. Second, substitute the slope and either point into y = mx + b to get an equation in b. Third, solve for b. Fourth, write the final equation and check both points.
The slope measures vertical change per horizontal change. A positive slope means the line rises from left to right; a negative slope means it falls. If the two points have the same x-coordinate, the line is vertical and cannot be written in slope-intercept form because the slope is undefined. If the two points have the same y-coordinate, the slope is zero and the equation is y = that constant.
- Label the points as (x1, y1) and (x2, y2).
- Compute m = (y2 - y1) / (x2 - x1) and simplify.
- Substitute m and one point into y = mx + b.
- Solve for b.
- Write y = mx + b with simplified m and b.
- Check by substituting both original points.
Choosing a point and handling fractions
Either point can be substituted to find b; both give the same result if the slope is correct. Choose the point with smaller numbers or fewer negative signs to reduce arithmetic errors. When the slope is a fraction, substitute it exactly and multiply carefully. For example, if m = 3/4 and the point is (2, 5), then 5 = (3/4)(2) + b, so 5 = 3/2 + b and b = 7/2. The equation is y = (3/4)x + 7/2.
Keep fractions in simplest form. Do not round unless the task explicitly asks for a decimal approximation. If a check with the other point produces a false statement, recheck the slope subtraction order and the arithmetic for b.
- Substitute the chosen point into y = mx + b.
- Multiply m by the x-coordinate before isolating b.
- Isolate b by subtracting the product from both sides.
- Simplify the result and write the final equation.
Checking the equation
A correct equation must satisfy both original points. Substitute each x-coordinate and confirm the computed y equals the given y. This check catches sign errors and swapped coordinates. For a quick mental check, confirm the slope between the two points matches m and that the line passes through the computed intercept.
If the check fails for one point but passes for the other, the likely error is in solving for b using the failing point. If both checks fail, recompute the slope first.
- Substitute the first point into the final equation.
- Substitute the second point into the final equation.
- Confirm both produce true statements.
- If not, recompute slope and b.
Worked example
Find the equation of the line through (1, 4) and (5, 12).
Worked answer
y = 2x + 2
Why: Slope m = (12 - 4) / (5 - 1) = 8 / 4 = 2. Substitute (1, 4): 4 = 2(1) + b, so b = 2. The equation is y = 2x + 2. Check (5, 12): 2(5) + 2 = 12, true.
Four practice exercises
Exercise 1
Find the equation of the line through (2, 3) and (6, 11).
Show answer and check
y = 2x - 1
Why: m = (11 - 3) / (6 - 2) = 8 / 4 = 2. Using (2, 3): 3 = 2(2) + b, so b = -1. Equation: y = 2x - 1. Check (6, 11): 2(6) - 1 = 11.
Check: Substitute both points into y = 2x - 1 and confirm equality.
Exercise 2
Find the equation of the line through (-1, 5) and (3, -3).
Show answer and check
y = -2x + 3
Why: m = (-3 - 5) / (3 - (-1)) = -8 / 4 = -2. Using (-1, 5): 5 = -2(-1) + b, so 5 = 2 + b and b = 3. Equation: y = -2x + 3. Check (3, -3): -2(3) + 3 = -3.
Check: Substitute both points into y = -2x + 3 and confirm equality.
Exercise 3
Find the equation of the line through (0, 4) and (4, 6).
Show answer and check
y = (1/2)x + 4
Why: m = (6 - 4) / (4 - 0) = 2 / 4 = 1/2. Using (0, 4): 4 = (1/2)(0) + b, so b = 4. Equation: y = (1/2)x + 4. Check (4, 6): (1/2)(4) + 4 = 6.
Check: Substitute both points into y = (1/2)x + 4 and confirm equality.
Exercise 4
Find the equation of the line through (2, 7) and (5, 1).
Show answer and check
y = -2x + 11
Why: m = (1 - 7) / (5 - 2) = -6 / 3 = -2. Using (2, 7): 7 = -2(2) + b, so 7 = -4 + b and b = 11. Equation: y = -2x + 11. Check (5, 1): -2(5) + 11 = 1.
Check: Substitute both points into y = -2x + 11 and confirm equality.
Common mistakes
- Subtracting coordinates in inconsistent order, such as (y2 - y1) over (x1 - x2). Use the same order for both differences: (y2 - y1) / (x2 - x1).
- Swapping x and y when substituting into y = mx + b. The x-coordinate replaces x and the y-coordinate replaces y; keep them in their original roles.
- Dropping a negative sign when simplifying the slope or b. Write each subtraction in parentheses before simplifying, and carry signs through every step.
- Rounding a fractional slope or intercept too early. Keep exact fractions until the final equation; only round if explicitly requested.
Self-check rubric
- Correctly labels the two points and computes the slope with consistent subtraction order.
- Simplifies the slope to lowest terms.
- Substitutes one point and the slope into y = mx + b correctly.
- Solves for b accurately, preserving signs and fractions.
- Writes the final equation in slope-intercept form with simplified coefficients.
- Checks both original points and confirms true statements.
- Uses clear notation and shows each step.
Questions and answers
Can I use either point to find b?
Yes. Both points lie on the same line, so substituting either one with the correct slope gives the same b.
What if the two points have the same x-coordinate?
The line is vertical, the slope is undefined, and it cannot be written as y = mx + b. The equation is x = that constant.
What if the slope is zero?
The line is horizontal. The equation is y = b, where b is the common y-coordinate.
Do I need to simplify fractions?
Yes, write m and b in simplest form unless the task asks for decimals.