Skip to content
One hour with George, then a written plan the next working day. Book yours.

The line through two points

Two points fix exactly one line. Find the slope by dividing the change in y by the change in x, then write the equation in point-slope form using either point. The same line comes out whichever point you choose. A vertical line, where both x values match, has no slope and is written x equals a constant.

For students and parents planning test prep or coursework: one hour with George Li, one to one by video, is $180, $200 or $160, by subject. You leave with a written plan within one working day.

Book your first session
Our own practice item
Find the line through (2, -4) and (6, 8)

Write the line that goes through (2, -4) and (6, 8), then check it with a third point.

  1. Find the slope: m = (8 - (-4)) / (6 - 2) = 12 / 4 = 3.
  2. Write point-slope form with the first point: y - (-4) = 3(x - 2), so y + 4 = 3(x - 2).
  3. Expand: y + 4 = 3x - 6, so y = 3x - 10.
  4. Test the second point: 3(6) - 10 = 8, which matches.
  5. Test a new point from the line, x = 0: y = -10, and the slope from (2, -4) to (0, -10) is (-10 + 4) / (0 - 2) = 3, which matches.

Answer y = 3x - 10, or 3x - y = 10 in standard form.

Original problem by George Li Tutoring; method as in OpenStax, Algebra and Trigonometry 2e

What do you need before you start?

You need the slope and one point. The slope is rise over run, which means subtracting the coordinates in the same order on top and bottom. Write m = (y2 - y1) / (x2 - x1). Reversing the order in both gives the same number, but mixing the order in one of them flips the sign, so decide on a direction and keep it.

For a line that rises as you move right, the slope is positive. For a line that falls, it is negative. A slope near zero means a nearly flat line. If you have a rough picture in mind, compare it with the sign of your answer before going on.

How do you write the equation once you have the slope?

Use point-slope form, y - y1 = m(x - x1), with either given point. Then rearrange to whichever form your problem asks for.

How do you write the equation once you have the slope?
FormPatternBest use
Point-slopey - y1 = m(x - x1)Going straight from a point and a slope
Slope-intercepty = mx + bReading the slope and the y-intercept, graphing quickly
StandardAx + By = CSystems of equations and intercept problems

Many problems ask for slope-intercept form as the final answer, but point-slope form is the quicker way to get there, because it never asks you to solve for b by trial.

Another worked case: a negative slope with fractions

Find the line through (-4, 3) and (2, -1). The slope is (-1 - 3) / (2 - (-4)) = -4 / 6 = -2/3. With the second point, y - (-1) = (-2/3)(x - 2), so y + 1 = (-2/3)x + 4/3. Subtract 1, which is 3/3, from both sides: y = (-2/3)x + 1/3. Test the first point: (-2/3)(-4) + 1/3 = 8/3 + 1/3 = 3, which matches.

When the slope is a fraction, multiply through by the denominator to reach standard form: 3y = -2x + 1, so 2x + 3y = 1.

What are the two special cases?

If the two points share the same y value, the line is horizontal. The change in y is zero, the slope is zero, and the equation is y = that value. The points (1, 4) and (9, 4) give y = 4.

If the two points share the same x value, the line is vertical. The change in x is zero, so the slope formula divides by zero and the slope is undefined. The equation is x = that value. The points (3, -2) and (3, 8) give x = 3. A vertical line is not a function of x, which is why slope-intercept form cannot describe it.

How do you find points on a line you already have?

Go the other way. Rewrite the equation as y = mx + b, then choose x values and compute y. For y = 5x - 7, the choices x = 0, 1 and 2 give (0, -7), (1, -2) and (2, 3). The intercept b is the y value when x is 0, so (0, b) is always one point, and the slope tells you how to move to the next: for each step of 1 in x, y changes by m.

Pick values that keep the arithmetic easy, and pick at least three. If your three points do not sit on a straight line when you plot them, one of the calculations has an error.

How do you check the answer?

Do two checks. First, both original points must satisfy your equation. Second, recompute the slope between any two points of your final line and compare it with the first slope. Checking only with the point you used to build the equation is not a real check, since it passes by construction.

Practice problems

These are original to George Li Tutoring. Write each answer in slope-intercept form unless the line is vertical.

  1. Through (1, 2) and (4, 11)
  2. Through (-3, 5) and (3, 1)
  3. Through (7, -2) and (7, 9)
  4. Through (0, 6) and (5, 6)

Answers: 1) The slope is 9 / 3 = 3, so y - 2 = 3(x - 1) and y = 3x - 1. 2) The slope is -4 / 6 = -2/3, so y - 5 = (-2/3)(x + 3), which gives y = (-2/3)x + 3. 3) Both x values are 7, so the line is vertical: x = 7. 4) Both y values are 6, so the line is horizontal: y = 6.

For more practice that is matched to a test, the math tutoring page explains how sessions start from your own mistakes, and the first session is the way in. The study planner fits the work into your weeks.

Common questions

Does it matter which point I use in point-slope form?

No. Both points lie on the line, so either one produces the same line. The expanded equation after simplifying will be identical.

What if the slope comes out as a fraction?

Keep it as a fraction. Fractions are exact, and decimals can hide a repeating value. Clear the denominator at the end if you want standard form.

Why is the slope of a vertical line undefined and not zero?

Because the run is zero, and division by zero has no value. A horizontal line is the one with slope zero: the rise is zero and the run is not.

Can I use the slope formula with the points in either order?

Yes, as long as you keep the same order in the numerator and the denominator. Swapping the points in both gives the same slope.

Sources