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
- What the number m means
- Increasing, decreasing, constant
- The equation from two points
- Intercepts with the axes
- Common mistakes
- Summary
- Try it yourself
- Practice
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.
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
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.
- From A to B, x goes 3 − 1 = 2 to the right and y goes 5 − 1 = 4 up.
- Slope: m = 4 ÷ 2 = 2.
- Put point A into y = 2x + b: 1 = 2 · 1 + b, so b = −1.
- Equation: y = 2x − 1.
Check with B: 2 · 3 − 1 = 5 ✓.
In general, for the points (x₁, y₁) and (x₂, y₂):