Chapter 6 ยท Proportional relationships, lines, and slope
Equations from Two Points: Write, Derive, and Check
Write the equation of a line from two points and see why slope-intercept form fits every point on a non-vertical line. Then find and fix mistakes in equations.
You already know how to write the equation of a line from its graph. You read the slope (how much changes when increases by 1) and the y-intercept (the -value where the line crosses the -axis, which is where ). Then you write . This is called a linear equation because its graph is a straight line.
In this lesson you start with less: just two points. That is still enough, because exactly one straight line passes through two different points. You will write the equation from two points, see why fits every point on a line that is not vertical, and learn to find and fix mistakes in an equation.
Call the two different points and . Going from the first point to the second, changes by and changes by . When the two -values are different, the slope is the change in divided by the change in . Written as a fraction, the subtractions must go in the same order on the top and on the bottom. Either point can come first, as long as it comes first in both places.
When the two -values are equal, the line is vertical (straight up and down). The change in is , and you cannot divide by , so the slope of a vertical line is undefined. A vertical line also pairs one -value with many -values, so it is not a function , which is a rule that gives exactly one for each . It has no equation of the form , so the rest of this lesson is about lines that are not vertical.
An equation of a line must be true for the coordinates of every point on that line. That tells you how to finish once you know . Only is missing from , so replace and with the coordinates of one of your points (this is called substituting) and solve for . Then test your equation with the other point. If both points make true, its graph is a line through both of them. Only one line passes through two different points, so your equation is right.
Worked example
Two points with whole-number coordinates
Write an equation of the line through and .
The x-values 2 and 4 are different, so the line is not vertical and it has a slope. Find the change in y and the change in x, with the second point first both times.
Divide the change in y by the change in x to get the slope.
The point (2, 7) is on the line, so its coordinates must make y = mx + b true. Replace m with 2, x with 2 and y with 7, then multiply.
Subtract 4 from both sides. Doing the same thing to both sides keeps the equation true, and it leaves b by itself.
Put m = 2 and b = 3 into y = mx + b, the form that every point on the line must fit.
Test the point you did not use, (4, 11). Replace x with 4. The result is 11, which matches that point's y-value.
Answer
An equation of the line through and is .
Worked example
Negative coordinates and a fraction slope
Write an equation of the line through and .
The x-values -3 and 6 are different, so the slope exists. Subtract in the same order, with the second point first. Subtracting -3 is the same as adding 3.
Divide the top and the bottom by 3 and keep the exact fraction. A rounded decimal such as -0.67 is only an approximation, so the line it gives would not pass exactly through both points.
Substitute the slope and the point (-3, 1) into y = mx + b. A negative number times a negative number is positive.
Subtract 2 from both sides to find b, then write the equation. Adding -1 is written as subtracting 1.
Test the other point, (6, -5). Replace x with 6. The result is -5, which matches.
Answer
An equation of the line through and is .
Why does one equation fit every point on a line, not just the two you were given? The reason is that on a line that is not vertical, the slope between any two different points is the same number. You have relied on this whenever you read a slope from a graph.
Take a line through the origin, the point , with slope . Pick any other point on it. A line that is not vertical crosses the -axis only once, so this point has . The slope from to is , and it must equal . Multiply both sides of by , which keeps the equation true, to get . The origin fits too, because . So every point on the line makes true.
In the figure, the horizontal axis shows and the vertical axis shows . Line B passes through with slope : its points and give and , so Line B is .
Worked example
Why every point on Line A fits its equation
Line A in the figure is the line from the first example. It has slope and crosses the -axis at . Show that every point on Line A makes true.
Pick any point (x, y) on Line A other than (0, 3). A line that is not vertical crosses the y-axis only once, so this point is off the y-axis and its x-value is not 0.
Write the slope from (0, 3) to (x, y) as the change in y over the change in x. Dividing by x is allowed because x is not 0.
The slope between any two different points of Line A is 2, so this fraction must equal 2. For example, from (0, 3) to (2, 7) the change in y is 4 and the change in x is 2, and 4 divided by 2 is 2.
Multiply both sides by x. Doing the same thing to both sides keeps the equation true, and it clears the fraction.
Add 3 to both sides so that y is by itself.
Check the one point you set aside, (0, 3). Replace x with 0. The result is 3, so that point fits too.
Answer
Every point on Line A makes true, including the -intercept .
Key concept
One constant slope builds the equation
On a line that is not vertical, the slope between any two different points is the same number . Compare any point on the line where with the -intercept : the slope between them must equal . Multiply both sides by , then add to both sides, and you get the equation below. The point fits it too, because .
When , the line passes through the origin and the equation is . That is the form of a proportional relationship, with : the ratio is the same constant wherever . A line with misses the origin, so it is linear but not proportional. On Line A, gives but gives .
An equation of a line must be true for every point on that line, so it must be true for both points you were given. That gives you a reliable way to find a mistake: substitute each given point into the finished equation. If either point makes it false, something went wrong. Then ask:
- Were the two subtractions for the slope done in the same order?
- Was subtracting a negative number treated as adding its opposite?
- Does the sign of the slope match the points? If goes down as goes up, the slope must be negative.
- Was solved for, or just copied from a point whose -value is not ?
Be careful with a one-point test. If was solved correctly from one point, that point fits the equation even when the slope is wrong, so always test the other point too. Mateo's work in the table has a mistake in it. Try to find it before you read the example after the table.
| Step | What Mateo wrote |
|---|---|
1. Slope | |
2. Solve for using | , so and |
3. Equation |
Worked example
Find and fix the mistake
Mateo wrote for the line through and . His steps are in the table before this example. Find his error and write the correct equation.
Test both given points in Mateo's equation. Replacing x with -1 gives 6, so (-1, 6) fits. Replacing x with 3 gives 14, not -2, so (3, -2) does not fit. The equation is wrong somewhere.
Look for the cause. From (-1, 6) to (3, -2), x goes up and y goes down, so the slope must be negative, but Mateo's slope is positive. On the top he subtracted first point minus second point. On the bottom he subtracted second point minus first point. The two orders do not match, and that flips the sign of the slope.
Redo the slope with the second point first on both the top and the bottom. Subtracting -1 is the same as adding 1.
Mateo's b came from the wrong slope, so solve for b again. Put m = -2 and the point (-1, 6) into y = mx + b, then subtract 2 from both sides.
Write the corrected equation and test both points. Each point gives its own y-value, so the equation is right.
Compare the two lines in the figure after this example. Its horizontal axis shows x and its vertical axis shows y. Line C is the corrected line and Line D is Mateo's line. Both pass through (-1, 6), because each b was solved from that point. At x = 3, Line C is at (3, -2) but Line D is at (3, 14). The coordinates, not the look of the picture, are the evidence.
Answer
Mateo subtracted in different orders on the top and bottom of the slope, which flipped its sign. The correct equation is .
The big idea: a line that is not vertical has one constant slope, and everything in this lesson grows from that fact. Two points with different -values give you , and substituting one of them into gives you . The same constant slope is why every point on the line fits , or when the line passes through the origin. To catch a mistake, test both given points in the finished equation: if one fails, recheck the slope first and then .