Steply

Line (-2, 3) (2, 1)

Step by step, with the reason for every step · Equation of a line through two points · Algebra 1

Step by step

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.

Answer
y = −12x + 2

Your turn

Try this one yourself, then check:

Find the equation of the line through (−3, 5) and (3, 1)
Show the answer
y = −23x + 3

More from Equation of a line through two points

The whole lesson: Equation of a line through two points →