Skip to content

The formula y = mx + b

The formula y = mx + b

The formula of a linear function tells at once what its line looks like:

y=mx+b\displaystyle y=mx+b
  • m\displaystyle m – the slope of the line.
  • b\displaystyle b – where the line meets the y\displaystyle y-axis: at the point (0,b)\displaystyle (0,b).
The meaning of m\displaystyle m and b\displaystyle b
  • Substitute x=0\displaystyle {x}={0}: y=m⋅0+b=b\displaystyle {y}={m\cdot0+b}={b}. So the line passes through the point (0,b)\displaystyle (0,b), on the y\displaystyle y-axis.
  • When x\displaystyle x grows by 1, mx\displaystyle mx grows by m\displaystyle m, and b\displaystyle b does not change. So y\displaystyle y grows by m\displaystyle m – and that is the slope.
Reading m\displaystyle m and b\displaystyle b from the formula
m\displaystyle m is the number multiplying x\displaystyle x, wherever it stands in the formula. b\displaystyle b is the number standing alone.
  • y=2x−3\displaystyle {y}={2x-3}: m=2\displaystyle {m}={2}, b=−3\displaystyle {b}={-3}.
  • y=4−3x\displaystyle {y}={4-3x}: m=−3\displaystyle {m}={-3}, b=4\displaystyle {b}={4}.
  • y=x+1\displaystyle {y}={x+1}: m=1\displaystyle {m}={1}, since x=1⋅x\displaystyle {x}={1\cdot x}.
  • y=−x\displaystyle {y}={-x}: m=−1\displaystyle {m}={-1}, b=0\displaystyle {b}={0}.
  • y=x2+5\displaystyle {y}={\frac{x}{2}+5}: m=12\displaystyle {m}={\frac{1}{2}}, since x2=12x\displaystyle {\frac{x}{2}}={\frac{1}{2}x}.
Drawing a line from its formula

Two points fix a line, and the formula y=mx+b\displaystyle {y}={mx+b} gives two of them without a table.
We draw y=2x−3\displaystyle {y}={2x-3}, where m=2\displaystyle {m}={2} and b=−3\displaystyle {b}={-3}:

  • We mark (0,−3)\displaystyle (0,-3) on the y\displaystyle y-axis.
  • The slope is 2: from there one step right and two up – the point (1,−1)\displaystyle (1,-1).
  • We draw a line through the two points.
y=2x−3\displaystyle y=2x-3
A=(0,−3)\displaystyle A=(0,-3)
B=(1,−1)\displaystyle B=(1,-1)
A line whose slope is a fraction

When the slope is a fraction, it is handy to move right by the denominator.
In y=−12x+4\displaystyle {y}={-\frac{1}{2}x+4}:

  • We mark (0,4)\displaystyle (0,4).
  • The slope is −12\displaystyle -\frac{1}{2}: two steps right, and one down – the point (2,3)\displaystyle (2,3).
y=−12x+4\displaystyle y=-\frac{1}{2}x+4
A=(0,4)\displaystyle A=(0,4)
B=(2,3)\displaystyle B=(2,3)
A line through the origin and a horizontal line
  • y=3x\displaystyle {y}={3x}: b=0\displaystyle {b}={0}. The line passes through the origin, (0,0)\displaystyle (0,0).
  • y=5\displaystyle {y}={5}: m=0\displaystyle {m}={0}. The line is horizontal, and meets the y\displaystyle y-axis at (0,5)\displaystyle (0,5).
y=3x\displaystyle y=3x
y=5\displaystyle y=5
Where a line meets the x\displaystyle x-axis
A horizontal line, like y=5\displaystyle {y}={5}, does not meet the x\displaystyle x-axis at all: there is no x\displaystyle x where y=0\displaystyle {y}={0}.

On the x\displaystyle x-axis every point has y=0\displaystyle {y}={0}. So we substitute y=0\displaystyle {y}={0} in the formula and solve an equation.
In y=2x−3\displaystyle {y}={2x-3}:

  • 0=2x−3\displaystyle {0}={2x-3}.
  • 2x=3\displaystyle {2x}={3}.
  • x=1.5\displaystyle {x}={1.5}: the line meets the x\displaystyle x-axis at the point (1.5,0)\displaystyle (1.5,0).
y=2x−3\displaystyle y=2x-3
(1.5,0)\displaystyle (1.5,0)
(0,−3)\displaystyle (0,-3)
Exercise 1

For each line, write its slope and where it meets the y\displaystyle y-axis.

  • y=3x+1\displaystyle {y}={3x+1}
  • y=−2x+5\displaystyle {y}={-2x+5}
  • y=14x−2\displaystyle {y}={\frac{1}{4}x-2}
  • y=6−x\displaystyle {y}={6-x}
  • y=−7\displaystyle {y}={-7}
  • y=23x\displaystyle {y}={\frac{2}{3}x}
Exercise 2

Find where each line meets the x\displaystyle x-axis.
In part c, write the equation yourself.

a
y=3x+6\displaystyle {y}={3x+6}
    b
    y=12x−3\displaystyle {y}={\frac{1}{2}x-3}
      c
      y=5−2x\displaystyle {y}={5-2x}
        Exercise 3

        Work out where the line y=−2x+4\displaystyle {y}={-2x+4} meets each of the axes.
        Mark the points.
        Then show the line, and check that it passes through them.

        y=−2x+4\displaystyle y=-2x+4

        Exercise 4

        For each of the lines y=3x−2\displaystyle {y}={3x-2} and y=−12x+3\displaystyle {y}={-\frac{1}{2}x+3}, mark two points without a table: where it meets the y\displaystyle y-axis, and one more point by the slope.
        Then show the lines, and check.

        y=3x−2\displaystyle y=3x-2
        y=−12x+3\displaystyle y=-\frac{1}{2}x+3
        Exercise 5

        Here are some lines:

        • y=2x−5\displaystyle {y}={2x-5}
        • y=x+1\displaystyle {y}={x+1}
        • y=3+2x\displaystyle {y}={3+2x}
        • y=−2x+1\displaystyle {y}={-2x+1}
        • y=12x\displaystyle {y}={\frac{1}{2}x}

        Which of them are parallel to the line y=2x+1\displaystyle {y}={2x+1}?
        Which of them meet the y\displaystyle y-axis at the same point as y=2x+1\displaystyle {y}={2x+1}?