Worked examples
The question
Question: find the equation of the line through (0, 1) and (2, 5).
(0, 1) and (2, 5)
Every line that is not straight up and down is y = mx + b.
m is the slope.
b is where the line crosses the y-axis: where we start.
So we need m and b.
y = mx + b
m = slope
b = start
1 Find the slope
We call the slope m.
m = rise over run.
m = riserun
The top is the change in y: second y minus first y.
The bottom is the change in x: second x minus first x.
m = y2 โ y1x2 โ x1
Put the numbers in.
The second point is (2, 5).
The first point is (0, 1).
m = 5 โ 12 โ 0
5 minus 1 is 4.
2 minus 0 is 2.
m = 42
4 divided by 2 is 2.
So m = 2.
m = 2
2 Find b
In y = mx + b, put m = 2.
Then use the point (0, 1): put x = 0 and y = 1 in.
1 = 2 ร 0 + b
2 times 0 is 0.
So b = 1.
1 = b
3 Write the equation
Put m = 2 and b = 1 into y = mx + b.
So the line is y = 2x + 1.
y = 2x + 1
4 Check
Let's check: put x = 0 in.
We get 1, the y of (0, 1).
y = 2(0) + 1 = 0 + 1 = 1
Now x = 2 in.
We get 5, the y of (2, 5).
y = 2(2) + 1 = 4 + 1 = 5
Let's see it.
Both points are on the line y = 2x + 1.
And it crosses the y-axis at 1, just like b says.
Let's look back.
First: find the slope.
Then: find b.
Then: write the equation.
Last: check.
โถ Watch it solved
The question
Question: find the equation of the line through (1, 2) and (3, 8).
(1, 2) and (3, 8)
Every line that is not straight up and down is y = mx + b.
m is the slope.
b is where the line crosses the y-axis: where we start.
So we need m and b.
y = mx + b
m = slope
b = start
1 Find the slope
We call the slope m.
m = rise over run.
m = riserun
The top is the change in y: second y minus first y.
The bottom is the change in x: second x minus first x.
m = y2 โ y1x2 โ x1
Put the numbers in.
The second point is (3, 8).
The first point is (1, 2).
m = 8 โ 23 โ 1
8 minus 2 is 6.
3 minus 1 is 2.
m = 62
6 divided by 2 is 3.
So m = 3.
m = 3
2 Find b
In y = mx + b, put m = 3.
Then use the point (1, 2): put x = 1 and y = 2 in.
2 = 3 ร 1 + b
3 times 1 is 3.
2 = 3 + b
We want b by itself.
The 3 is in the way.
To remove 3, we take away 3.
We do it on both sides, so they stay equal.
2 โ 3 = 3 + b โ 3
3 and โ 3 make zero.
Cross them out.
2 minus 3 is โ1.
So b = โ1.
โ1 = b
3 Write the equation
Put m = 3 and b = โ1 into y = mx + b.
So the line is y = 3x โ 1.
y = 3x โ 1
4 Check
Let's check: put x = 1 in.
We get 2, the y of (1, 2).
y = 3(1) โ 1 = 3 โ 1 = 2
Now x = 3 in.
We get 8, the y of (3, 8).
y = 3(3) โ 1 = 9 โ 1 = 8
Let's see it.
Both points are on the line y = 3x โ 1.
And it crosses the y-axis at โ1, just like b says.
Let's look back.
First: find the slope.
Then: find b.
Then: write the equation.
Last: check.
โถ Watch it solved
The question
Question: find the equation of the line through (โ2, 3) and (2, 1).
(โ2, 3) and (2, 1)
Every line that is not straight up and down is y = mx + b.
m is the slope.
b is where the line crosses the y-axis: where we start.
So we need m and b.
y = mx + b
m = slope
b = start
1 Find the slope
We call the slope m.
m = rise over run.
m = riserun
The top is the change in y: second y minus first y.
The bottom is the change in x: second x minus first x.
m = y2 โ y1x2 โ x1
Put the numbers in.
The second point is (2, 1).
The first point is (โ2, 3).
m = 1 โ 32 โ (โ2)
Taking away a negative is the same as adding.
โ (โ) = +
So it becomes (1 โ 3)/(2 + 2).
m = 1 โ 32 + 2
1 minus 3 is โ2.
2 plus 2 is 4.
m = โ24
We can make 2/4 simpler: divide top and bottom by 2.
The minus stays.
So m = โ1/2.
m = โ12
2 Find b
In y = mx + b, put m = โ1/2.
Then use the point (โ2, 3): put x = โ2 and y = 3 in.
3 = โ12 ร (โ2) + b
Minus times minus is plus.
โ1/2 times โ2 is 1.
3 = 1 + b
We want b by itself.
The 1 is in the way.
To remove 1, we take away 1.
We do it on both sides, so they stay equal.
3 โ 1 = 1 + b โ 1
1 and โ 1 make zero.
Cross them out.
3 minus 1 is 2.
So b = 2.
2 = b
3 Write the equation
Put m = โ1/2 and b = 2 into y = mx + b.
So the line is y = โ(1/2)x + 2.
y = โ12x + 2
4 Check
Let's check: put x = โ2 in.
We get 3, the y of (โ2, 3).
y = โ12(โ2) + 2 = 1 + 2 = 3
Now x = 2 in.
We get 1, the y of (2, 1).
y = โ12(2) + 2 = โ1 + 2 = 1
Let's see it.
Both points are on the line y = โ(1/2)x + 2.
And it crosses the y-axis at 2, just like b says.
Let's look back.
First: find the slope.
Then: find b.
Then: write the equation.
Last: check.
โถ Watch it solved