Skip to content

The slope and the equation of a line through two points

The slope and the equation of a line through two points

The slope of a straight road

On the city map, a straight road passes through the junction A(1,3)\displaystyle A(1,3) and the junction B(5,11)\displaystyle B(5,11).
One unit on each axis is 100 metres.

y=2x+1\displaystyle y=2x+1
A=(1,3)\displaystyle A=(1,3)
B=(5,11)\displaystyle B=(5,11)
  • From A\displaystyle A to B\displaystyle B the road goes 5−1=4\displaystyle {5-1}={4} units east and 11−3=8\displaystyle {11-3}={8} units north.
  • For every unit east the road climbs 84=2\displaystyle {\frac{8}{4}}={2} units north: that is its slope.

The slope of a line through (x1,y1)\displaystyle (x_1,y_1) and (x2,y2)\displaystyle (x_2,y_2) is the difference between the y\displaystyle y-coordinates divided by the difference between the x\displaystyle x-coordinates:

m=y2−y1x2−x1\displaystyle m=\frac{y_2-y_1}{x_2-x_1}
  • A positive slope: the line rises from left to right.
  • A negative slope: the line falls from left to right.
The equation of a line through two points
A check at the second point: 2⋅5+1=11\displaystyle {2\cdot5+1}={11}, so the point B(5,11)\displaystyle B(5,11) is on the line.

The equation of a line is y=mx+b\displaystyle {y}={mx+b}: you find m\displaystyle m from the two points, and b\displaystyle b by substituting one of them.

The solution below finds the equation of the road through A(1,3)\displaystyle A(1,3) and B(5,11)\displaystyle B(5,11):

  • The slope: m=11−35−1=84=2\displaystyle {m}={\frac{11-3}{5-1}}={\frac{8}{4}}={2}, so y=2x+b\displaystyle {y}={2x+b}.
  • We substitute A(1,3)\displaystyle A(1,3): 3=2⋅1+b\displaystyle {3}={2\cdot1+b}, so b=1\displaystyle {b}={1}.
  • The road’s equation: y=2x+1\displaystyle {y}={2x+1}.

The formula of a line with slope m\displaystyle m through (x1,y1)\displaystyle (x_1,y_1) gives the same equation:

y−y1=m(x−x1)\displaystyle y-y_1=m(x-x_1)

Here: y−3=2(x−1)\displaystyle {y-3}={2(x-1)}, that is y=2x−2+3=2x+1\displaystyle {y}={2x-2+3}={2x+1}.

A point on the line

A point is on the line when its coordinates satisfy the line’s equation.
Are the stops C(4,9)\displaystyle C(4,9) and D(6,12)\displaystyle D(6,12) on the road y=2x+1\displaystyle {y}={2x+1}?

  • C\displaystyle C: 2⋅4+1=9\displaystyle {2\cdot4+1}={9}, which is the y\displaystyle y-coordinate of C\displaystyle C: the stop is on the road.
  • D\displaystyle D: 2⋅6+1=13\displaystyle {2\cdot6+1}={13}, not 12: the stop is not on the road, it is one unit south of it.
A price as a line through two points

A price made of a fixed cost and a cost per unit is a line too, as in grade 10.
A removals company charged 700 ₪ for a move of 20 km, and 1,000 ₪ for a move of 50 km.

  • The points on the line: (20,700)\displaystyle (20,700) and (50,1000)\displaystyle (50,1000), where x\displaystyle x is the distance in km and y\displaystyle y the price in shekels.
  • The slope – the price per km: m=1000−70050−20=30030=10\displaystyle {m}={\frac{1000-700}{50-20}}={\frac{300}{30}}={10} ₪.
  • We substitute (20,700)\displaystyle (20,700): 700=10⋅20+b\displaystyle {700}={10\cdot20+b}, so b=500\displaystyle {b}={500} ₪ – the fixed cost of a move.
  • The equation: y=10x+500\displaystyle {y}={10x+500}.
Exercise 1

A bus route runs in a straight line through the stop A(0,2)\displaystyle A(0,2) and the stop B(4,10)\displaystyle B(4,10).

a

Work out the slope of the route.

    / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

    / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power

    b

    Write the route’s equation on the graph board.

    A=(0,2)\displaystyle A=(0,2)
    B=(4,10)\displaystyle B=(4,10)

    c

    Is the stop C(6,14)\displaystyle C(6,14) on the route?
    Substitute its coordinates and explain.

    Exercise 2

    A straight road passes through the points P(−2,7)\displaystyle P(-2,7) and Q(4,−5)\displaystyle Q(4,-5).
    Work out the slope, and find b\displaystyle b.
    Write the road’s equation on the graph board.

    P=(−2,7)\displaystyle P=(-2,7)
    Q=(4,−5)\displaystyle Q=(4,-5)

    Exercise 3

    The price of a taxi ride is made of a fixed cost and a cost for every kilometre.
    A ride of 6 km cost 40 ₪, and a ride of 10 km cost 60 ₪.
    x\displaystyle x is the length of the ride in kilometres, and y\displaystyle y the price in shekels.

    a

    Write the equation of the price on the graph board.

    (6,40)\displaystyle (6,40)
    (10,60)\displaystyle (10,60)

    b

    How much will a ride of 15 km cost?

      / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – check and a new line · * – times · ^ – power, ↓ – end of the power

      / – fraction bar · Tab or the arrows – between numerator and denominator, then a note above or below · Enter – a new line · * – times · ^ – power, ↓ – end of the power

      c

      What do the slope and b\displaystyle b say about the price of the ride?

      Exercise 4

      A straight water pipe passes through the points A\displaystyle A and B\displaystyle B on the graph board.
      Write the pipe’s equation on the graph board.

      y= ?\displaystyle y=\,?
      A=(−2,0)\displaystyle A=(-2,0)
      B=(4,3)\displaystyle B=(4,3)