Linear Functions — Equation, Slope m and y-Intercept b

Linear Functions — Equation, Slope m and y-Intercept b

A taxi charges a fixed fee of 3 € plus 1 € for every kilometre. For 5 km you pay 3 + 5 · 1 = 8 €, for 10 km 13 €. The price y depends on the distance x by the rule y = x + 3. Every extra kilometre adds the same amount — and that is exactly what a linear function is.

A linear function has the equation

y = mx + b, where m and b are real numbers.

Its graph is a straight line. For example, y = 2x − 3 has m = 2 and b = −3. (In the UK the same equation is often written y = mx + c.)


Contents


What the number b means

Put x = 0: y = m · 0 + b = b. So the graph passes through the point (0, b) — that is where it crosses the y-axis. That is why b is called the y-intercept.

  • y = 2x + 1 crosses the y-axis at (0, 1).
  • y = −x + 4 crosses the y-axis at (0, 4).
  • y = 3x crosses the y-axis at (0, 0) — the line goes through the origin.

In the taxi example b = 3: the fixed fee you pay before the taxi has moved at all (x = 0).


What the number m means

The number m is called the slope (or gradient). It tells you how much y changes when x grows by 1.

The line y = 2x + 1: from the point (0, 1) go 1 to the right and 2 up to reach (1, 3)

For y = 2x + 1 we start at (0, 1). We move 1 to the right and 2 up — and we are at (1, 3). This "step" works everywhere on the line: x = 2 gives y = 5, x = 3 gives y = 7.

When m is a fraction, use a bigger step. For y = ⅔x − 2 it is easiest to go 3 to the right: y changes by ⅔ · 3 = 2. From (0, −2) you get to (3, 0).

💡 You can read the slope from any two points on the line: "how far up" divided by "how far to the right" (rise over run).


Increasing, decreasing, constant

Three lines through (0, 1): increasing y = x + 1, decreasing y = −2x + 1 and horizontal y = 1

All three lines in the picture have b = 1; they differ in slope:

  • m > 0: the function is increasing (y = x + 1). From left to right the graph goes up.
  • m < 0: the function is decreasing (y = −2x + 1). From left to right the graph goes down.
  • m = 0: the function is constant (y = 1). The graph is a horizontal line.

The bigger |m| is, the steeper the line. y = −2x + 1 is steeper than y = x + 1.


The equation from two points

Two points fix a line. From them we work out m and b.

Worked example 1

A line passes through A(1, 1) and B(3, 5). Find its equation.

  1. From A to B, x goes 3 − 1 = 2 to the right and y goes 5 − 1 = 4 up.
  2. Slope: m = 4 ÷ 2 = 2.
  3. Put point A into y = 2x + b: 1 = 2 · 1 + b, so b = −1.
  4. Equation: y = 2x − 1.

Check with B: 2 · 3 − 1 = 5 ✓.

In general, for the points (x₁, y₁) and (x₂, y₂):

Worked example 2

A(−2, 7), B(2, −1).

  1. m = (−1 − 7) ÷ (2 − (−2)) = −8 ÷ 4 = −2.
  2. b = 7 − (−2) · (−2) = 7 − 4 = 3.
  3. Equation: y = −2x + 3. The function is decreasing because m < 0.

Check with B: −2 · 2 + 3 = −1 ✓.


Intercepts with the axes

The line y = ⅔x − 2 with the intercepts (3, 0) and (0, −2)
  • y-intercept: put x = 0. You get y = b, so the point is (0, b).
  • x-intercept: look for the x with y = 0, that is, solve mx + b = 0.

Worked example 3

y = ⅔x − 2.

  1. y-axis: x = 0 gives y = −2. Intercept (0, −2).
  2. x-axis: ⅔x − 2 = 0, so ⅔x = 2 and x = 2 · 3/2 = 3. Intercept (3, 0).
  3. m = ⅔ > 0, so the function is increasing.

⚠️ The constant function y = b (m = 0) never crosses the x-axis if b ≠ 0. The equation 0 · x + b = 0 has no solution.


Common mistakes

  • Swapping m and b. In y = 3x − 5 the slope is 3 and the y-intercept is (0, −5), not (0, 3).
  • Sign slips when subtracting. For (−2, 7) and (2, −1) the difference of the x-values is 2 − (−2) = 4, not 0.
  • Upside-down fraction. The slope is "change in y ÷ change in x", not the other way round.
  • Judging the direction by b. Only m decides whether the function increases. y = −x + 100 is decreasing even though b is large.

Summary

  • y = mx + b, and the graph is a straight line.
  • b: the y-intercept is (0, b).
  • m: how much y changes when x grows by 1. m > 0 increasing, m < 0 decreasing, m = 0 constant.
  • From two points: m = (y₂ − y₁) ÷ (x₂ − x₁), then b = y₁ − m · x₁.
  • x-intercept: the solution of mx + b = 0.

Try it yourself

  1. A line passes through (0, 4) and (2, 0). Find its equation.
  2. Find where the graph of y = −3x + 6 crosses the axes. Is the function increasing or decreasing?
  3. Is the function y = −½x + 1 increasing or decreasing?
Answers:
  1. m = (0 − 4) ÷ (2 − 0) = −2, b = 4 (point (0, 4)). Equation y = −2x + 4.
  2. y-axis: (0, 6). x-axis: −3x + 6 = 0, x = 2, point (2, 0). Decreasing, because m = −3 < 0.
  3. Decreasing, because m = −½ < 0.

Practice

👉 Next article: Quadratic Functions and Their Graphs