Steply

Equation of a line through two points

Algebra 1 ยท 22 problems, easy to harder

โ–ถ Watch the first one solved

How we do it

  1. Find the slope
  2. Find b
  3. Write the equation
  4. Check

The steps for Line (0, 1) (2, 5). Every solution names its steps, so you always know what comes next.

Worked examples

Line (0, 1) (2, 5) Easy

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.

Answer
y = 2x + 1

โ–ถ Watch it solved

Line (1, 2) (3, 8) Medium

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.

Answer
y = 3x โˆ’ 1

โ–ถ Watch it solved

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

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

โ–ถ Watch it solved

Practice

Try each one, then open the answer. Stuck? Open the problem to watch every step.

Easy

  1. line (0, 1) (2, 5)
    Answer
    y = 2x + 1
  2. line (1, 2) (3, 6)
    Answer
    y = 2x
  3. line (0, -2) (1, 1)
    Answer
    y = 3x โˆ’ 2
  4. line (0, 3) (3, 0)
    Answer
    y = โˆ’x + 3
  5. line (1, 1) (2, 3)
    Answer
    y = 2x โˆ’ 1
  6. line (-1, 0) (1, 4)
    Answer
    y = 2x + 2
  7. line (2, 2) (4, 4)
    Answer
    y = x
  8. line (0, 0) (3, 6)
    Answer
    y = 2x

Medium

  1. line (1, 2) (3, 8)
    Answer
    y = 3x โˆ’ 1
  2. line (-1, 5) (1, -1)
    Answer
    y = โˆ’3x + 2
  3. line (0, 1) (2, 4)
    Answer
    y = 32x + 1
  4. line (-1, 3) (2, 3)
    Answer
    y = 3
  5. line (2, -1) (4, 5)
    Answer
    y = 3x โˆ’ 7
  6. line (-3, 4) (3, 0)
    Answer
    y = โˆ’23x + 2
  7. line (2, -1) (6, 1)
    Answer
    y = 12x โˆ’ 2
  8. line (-2, -1) (2, 7)
    Answer
    y = 2x + 3
  9. line (1, 1) (1, 4)
    Answer
    m = undefined

Harder

  1. line (-2, 3) (2, 1)
    Answer
    y = โˆ’12x + 2
  2. line (3, -2) (-3, 6)
    Answer
    y = โˆ’43x + 2
  3. line (-1, -5) (2, 1)
    Answer
    y = 2x โˆ’ 3
  4. line (2, 1) (-2, -1)
    Answer
    y = 12x
  5. line (-2, 3) (-2, -1)
    Answer
    m = undefined