Skip to content

Finding the formula of a line

Finding the formula of a line

To write the formula y=mx+b\displaystyle {y}={mx+b} of a line, you find two numbers: the slope m\displaystyle m and b\displaystyle b.

  • m\displaystyle m comes from the given slope, or from two points on the line.
  • b\displaystyle b comes from a point on the line: it satisfies the formula, so you substitute it.
Example: from the slope and a point
Check: 3⋅2−1=5\displaystyle {3\cdot2-1}={5} – the point (2,5)\displaystyle (2,5) is on the line.

A line passes through the point (2,5)\displaystyle (2,5), and its slope is 3.
Find its formula.

The solution below substitutes the point in the formula and finds b\displaystyle b:

  • The slope is 3, so y=3x+b\displaystyle {y}={3x+b}.
  • The point (2,5)\displaystyle (2,5) is on the line: we substitute x=2\displaystyle {x}={2} and y=5\displaystyle {y}={5}, and get 5=3⋅2+b\displaystyle {5}={3\cdot2+b}.
  • 5=6+b\displaystyle {5}={6+b}, so b=−1\displaystyle {b}={-1}.
  • The formula: y=3x−1\displaystyle {y}={3x-1}.
Example: from two points
Check at the other point: −2⋅(−1)+5=7\displaystyle {-2\cdot(-1)+5}={7}.

A line passes through the points (−1,7)\displaystyle (-1,7) and (2,1)\displaystyle (2,1).
Find its formula.

The solution below works out the slope first, and then finds b\displaystyle b from one of the points:

  • m=1−72−(−1)=−63=−2\displaystyle {m}={\frac{1-7}{2-(-1)}}={\frac{-6}{3}}={-2}, so y=−2x+b\displaystyle {y}={-2x+b}.
  • We substitute (2,1)\displaystyle (2,1): 1=−2⋅2+b\displaystyle {1}={-2\cdot2+b}, that is 1=−4+b\displaystyle {1}={-4+b}, so b=5\displaystyle {b}={5}.
  • The formula: y=−2x+5\displaystyle {y}={-2x+5}.
Example: from a graph

From the graph you read b\displaystyle b on the y\displaystyle y-axis, and count m\displaystyle m in squares between two points the line passes through exactly:

  • The line meets the y\displaystyle y-axis at (0,−1)\displaystyle (0,-1): b=−1\displaystyle {b}={-1}.
  • From (0,−1)\displaystyle (0,-1) to (3,1)\displaystyle (3,1): 3 right and 2 up, so m=23\displaystyle {m}={\frac{2}{3}}.
  • The formula: y=23x−1\displaystyle {y}={\frac{2}{3}x-1}.
y=23x−1\displaystyle y=\frac{2}{3}x-1
A=(0,−1)\displaystyle A=(0,-1)
B=(3,1)\displaystyle B=(3,1)
Example: a parallel line through a point

Find the formula of the line parallel to y=2x+3\displaystyle {y}={2x+3} through P(3,1)\displaystyle P(3,1).

The solution below takes the slope from the given line, and finds b\displaystyle b from P\displaystyle P:

  • Parallel lines – the same slope: m=2\displaystyle {m}={2}, so y=2x+b\displaystyle {y}={2x+b}.
  • We substitute P\displaystyle P: 1=2⋅3+b\displaystyle {1}={2\cdot3+b}, so b=−5\displaystyle {b}={-5}.
  • The formula: y=2x−5\displaystyle {y}={2x-5}.
y=2x+3\displaystyle y=2x+3
y=2x−5\displaystyle y=2x-5
P=(3,1)\displaystyle P=(3,1)
Exercise 1

Find b\displaystyle b by solving an equation, and write the formula of each line.

a
Slope −2\displaystyle -2, through P(3,4)\displaystyle P(3,4)
    b
    Slope 12\displaystyle \frac{1}{2}, through Q(4,1)\displaystyle Q(4,1)
      P=(3,4)\displaystyle P=(3,4)
      Q=(4,1)\displaystyle Q=(4,1)

      Exercise 2

      Find the formula of the line through A\displaystyle A and B\displaystyle B, and the formula of the line through C\displaystyle C and D\displaystyle D.

      A=(1,5)\displaystyle A=(1,5)
      B=(3,11)\displaystyle B=(3,11)
      C=(−2,3)\displaystyle C=(-2,3)
      D=(2,1)\displaystyle D=(2,1)

      Exercise 3

      Write the formula of each of the lines f\displaystyle f, g\displaystyle g and h\displaystyle h, from the graph.

      f(x)= ?\displaystyle f(x)=\,?
      g(x)= ?\displaystyle g(x)=\,?
      h(x)= ?\displaystyle h(x)=\,?

      Exercise 4

      Find the formula of the line parallel to y=−x+3\displaystyle {y}={-x+3} through P\displaystyle P.
      Find the formula of the line parallel to y=13x\displaystyle {y}={\frac{1}{3}x} through Q\displaystyle Q.

      y=−x+3\displaystyle y=-x+3
      y=13x\displaystyle y=\frac{1}{3}x
      P=(2,5)\displaystyle P=(2,5)
      Q=(−3,0)\displaystyle Q=(-3,0)

      Exercise 5

      Are the three points on one line? Explain with slopes.

      • (0,1)\displaystyle (0,1), (2,5)\displaystyle (2,5), (5,11)\displaystyle (5,11)
      • (−1,−2)\displaystyle (-1,-2), (1,2)\displaystyle (1,2), (3,5)\displaystyle (3,5)
      Exercise 6

      In a taxi the price grows at a constant rate with the number of kilometres.
      A 4 km ride costs 26 ₪.
      A 10 km ride costs 44 ₪.

      • Write the formula of the price y\displaystyle y by the number of kilometres x\displaystyle x.
      • How much does getting into the taxi cost, before the first kilometre?
      • How much will a 7 km ride cost?
      Getting into the taxi

        / – 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

        A 7 km ride

          / – 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