Sub topic 3
Point-slope form: a line through a known point
This chapter assumes you can plot points, compute slope as rise over run, work with slope-intercept form y = mx + b, solve a linear equation for one variable, and do arithmetic with fractions and negative numbers. Here you will learn point-slope form, why it exists, how to read it, and where it goes wrong.
Why a second form is needed
Slope-intercept form, y = mx + b, needs the y-intercept b. Often you don't have it. A problem might tell you a line passes through (3, 7) with slope 2. To use y = mx + b, you would first solve 7 = 2(3) + b to get b = 1, and only then write y = 2x + 1. That extra step is easy to get wrong, and when the slope is a fraction it gets messy.
Point-slope form skips the step. It builds the equation directly from any one point on the line and the slope.
The form
If a line has slope m and passes through the point (x₁, y₁), then its equation is:
y - y₁ = m(x - x₁)
Here x and y are the variables, which stand for any point on the line. The values m, x₁ and y₁ are fixed numbers that you substitute in.
Where it comes from
Take any other point (x, y) on the line. The slope between (x₁, y₁) and (x, y) is:
m = (y - y₁) / (x - x₁)
Multiply both sides by (x - x₁) and you get y - y₁ = m(x - x₁). So point-slope form is the slope formula with the denominator cleared. Every point on the line satisfies it, and any point that does not lie on the line fails it.
Reading it
Each part has a meaning.
- The right side, m(x - x₁), is the change in y that comes from moving from x₁ to x. Moving one unit right changes y by m.
- The left side, y - y₁, is the actual change in y.
- When x = x₁, the right side is 0, so y = y₁. The equation therefore holds at the known point by construction.
Writing an equation from a point and a slope
The procedure has three steps.
- Identify m, x₁ and y₁.
- Substitute them into y - y₁ = m(x - x₁).
- Stop, or simplify if the problem asks for a particular form.
Example 1: positive integers
A line has slope 2 and passes through (3, 7).
y - 7 = 2(x - 3)
That is already a correct answer in point-slope form. To get slope-intercept form, distribute and add 7:
y - 7 = 2x - 6 y = 2x + 1
Example 2: negative coordinates
A line has slope -3 and passes through (-2, 5). Substituting x₁ = -2 gives x - (-2), which becomes x + 2:
y - 5 = -3(x + 2)
The sign flip on x₁ and y₁ is the most common source of errors, and a later section returns to it.
Example 3: fractional slope
A line has slope 1/2 and passes through (4, 1).
y - 1 = (1/2)(x - 4)
In slope-intercept form:
y - 1 = (1/2)x - 2 y = (1/2)x - 1
Point-slope form kept the fraction out of the way until you chose to simplify.
Many correct answers
A line contains infinitely many points, and any of them can serve as (x₁, y₁). Different choices give different-looking equations that describe the same line.
The line y = 2x + 1 passes through (3, 7) and also through (0, 1) and (-1, -1). All of these are valid point-slope forms:
- y - 7 = 2(x - 3)
- y - 1 = 2(x - 0)
- y + 1 = 2(x + 1)
Expand each one and you get y = 2x + 1. So a point-slope answer is not unique, and a grader who expects a different point is still looking at the same line. To compare two equations, convert both to one common form.
Writing an equation from two points
When you have two points instead of a slope, compute the slope first, then pick either point.
from fractions import Fraction
def slope_through(p, q):
(x1, y1), (x2, y2) = p, q
if x1 == x2:
raise ValueError(f"vertical line: x = {x1}")
return Fraction(y2 - y1, x2 - x1)
p, q = (1, 3), (4, 9)
m = slope_through(p, q) # 6/3 = 2
print(m) # 2
# Point-slope form using p: y - 3 = 2(x - 1)
# Check the standard form 2x - y = -1 by substituting both points.
A, B, C = 2, -1, -1
for x, y in (p, q):
assert A * x + B * y == CThe function uses Fraction so the slope stays exact. With floating-point numbers, a slope like 1/3 would be stored as an approximation, and later equality checks could fail.
For the points (1, 3) and (4, 9), the slope is (9 - 3)/(4 - 1) = 2. Using (1, 3) gives y - 3 = 2(x - 1). Using (4, 9) gives y - 9 = 2(x - 4). Both describe the line 2x - y = -1. The assertion at the end of the code checks this by substituting both original points into the standard form.
The vertical line exception
Point-slope form needs a slope. A vertical line, such as the line through (2, 1) and (2, 5), has run 0. The slope formula divides by 0, so the slope is undefined. There is no number m to put in the formula, so point-slope form cannot describe it.
The code above raises a ValueError for this case. A vertical line is written x = 2 instead, because every point on it has the same x-coordinate. A later chapter covers horizontal and vertical lines in detail. For now, remember the check: if the two x-values are equal, stop and write x = that value.
A horizontal line causes no trouble. Its slope is 0, so y - y₁ = 0(x - x₁), which simplifies to y = y₁.
Common errors
| Error | Example | Correct version |
|---|---|---|
| Wrong sign on a negative coordinate | Point (-2, 5), written y - 5 = m(x - 2) | y - 5 = m(x + 2) |
| Swapping the roles of x₁ and y₁ | Point (3, 7), written x - 7 = m(y - 3) | y - 7 = m(x - 3) |
| Putting the slope on the wrong side of the subtraction | y - 7 = 2x - 3 | y - 7 = 2(x - 3) |
| Distributing the slope to only one term | y - 7 = 2x - 3 after expanding 2(x - 3) | y - 7 = 2x - 6 |
| Subtracting the points in different orders | m = (9 - 3)/(1 - 4) | m = (9 - 3)/(4 - 1) |
The last row matters for two-point problems. Use the same order in the numerator and the denominator. Reversing both gives the same slope, but reversing only one flips its sign.
Checking by substitution
You can test any equation by substituting known points.
- Substitute the given point. Both sides must be equal. In point-slope form this is automatic, which makes it a check on your arithmetic rather than on your thinking.
- If you have a second point, substitute it too. For y - 3 = 2(x - 1) and the point (4, 9): 9 - 3 = 6, and 2(4 - 1) = 6. The two sides match.
- Compare the slope. Rewrite the equation as y = mx + b and confirm that m is what you expected.
A wrong sign on the point usually fails the second test, so a second point catches more errors than the first.
Where this leads
Point-slope form is a construction tool. It is quick to write down, but it is awkward for reading intercepts and for comparing lines. Standard form, Ax + By = C, comes next, and it handles those tasks well. The next chapters also cover converting between forms, so you can write the equation in whichever form is easiest and then change it as the problem requires.
Exercise
A line passes through (-4, 6) and (2, 0). (a) Find the slope. (b) Write the equation in point-slope form using (2, 0). (c) Write it again using (-4, 6), and explain why both answers describe the same line.
Show answer
(a) m = (0 - 6)/(2 - (-4)) = -6/6 = -1. (b) y - 0 = -1(x - 2), which is y = -(x - 2). (c) y - 6 = -1(x + 4). Expanding (b) gives y = -x + 2. Expanding (c) gives y - 6 = -x - 4, so y = -x + 2. Both reduce to y = -x + 2, so they are the same line written with different known points.
Exercise
Why can't you write the line through (5, -1) and (5, 8) in point-slope form? What is its equation?
Show answer
The two points have the same x-value, so the run is 0 and the slope (8 - (-1))/(5 - 5) is a division by zero, which is undefined. With no slope, point-slope form has no number to use for m. Every point on the line has x = 5, so the equation is x = 5.
Exercise
A student writes y + 2 = 3(x - 4) and says the line passes through (4, 2). Is the student right? If not, give the correct point and an equation through (4, 2) with the same slope.
Show answer
No. Writing y + 2 as y - (-2) shows y₁ = -2, so the point is (4, -2). The student made a sign error on y₁. A line with slope 3 through (4, 2) is y - 2 = 3(x - 4).