Affine function y = mx + b: gradient and y-intercept
Machine translation
Learn
An affine function is a function of the form f(x) = mx + b. Its graph is a straight line. Two numbers describe it: m and b. Think of a taxi that charges £3 to start the meter and £2 for each km. The price of x km is f(x) = 2x + 3.
The number b is the value of f(0): what you have before you start moving. On the graph it is the point where the line crosses the vertical axis, (0, b). It is called the y-intercept. For the taxi, b = 3. The number m is the gradient: how much y goes up for every 1 you move to the right. For the taxi, m = 2. If m is negative, the line goes down. If m = 0, the line is horizontal and f(x) = b.
f(x) = 2x + 3: crosses the vertical axis at (0, 3) and goes up 2 for every 1 to the right To write the function of a line, read b at the point where it crosses the vertical axis and count how much it goes up for every 1 to the right. With a table it is the same: b is the y when x = 0 and m is how much y changes each time x goes up by 1. To draw the line, mark (0, b), move 1 to the right, go up or down by m and draw the line through the two points.
x 0 1 2 3 4 y 3 5 7 9 11 The taxi table: y starts at 3 and goes up 2 each time You work it out as with other functions. The image of 4 is f(4) = 2 × 4 + 3 = 11. To find the pre-image of 15, solve 2x + 3 = 15: 2x = 12 and x = 6. The line crosses the horizontal axis where f(x) = 0. For f(x) = 2x − 6, solve 2x − 6 = 0, which gives x = 3, and the line passes through the point (3, 0).
If b = 0, the line passes through the origin and it is a linear function, a direct proportion. If b is not 0, it is not a proportion: the quotient y ÷ x is not always the same. In an affine function with b ≠ 0, when x doubles, y does not double. If you only change b, the line goes up or down without turning. If you only change m, the line turns about the point (0, b).
Three affine functions: the green one, with b = 0, is linear; the blue and orange ones are not
Worked examples
Example 1
Tony has £10 in his money box and puts in £5 every week. Write the function, work out how much he will have after 6 weeks and when he will have £60.
- At the start he has £10: b = 10. Each week he adds £5: m = 5. The function is f(x) = 5x + 10.
- After 6 weeks: f(6) = 5 × 6 + 10 = £40.
- For £60, set up 5x + 10 = 60. Subtract 10: 5x = 50. Share between 5: x = 10 weeks.
f(x) = 5x + 10; after 6 weeks he has £40 and he reaches £60 after 10 weeks.
Watch out! Here many people write f(x) = 10x + 5: they swap the gradient and the y-intercept.
Example 2
Read the graph and write the affine function of the line.
- The line crosses the vertical axis at 4: b = 4.
- From (0, 4), moving 1 to the right it goes down 2: it reaches (1, 2). The gradient is m = −2.
- The function is f(x) = −2x + 4.
f(x) = −2x + 4.
Watch out! Here many people write f(x) = 2x + 4: they forget that the line goes down and the gradient is negative.
Example 3
Mara looks at the table and says it is from an affine function. What are m and b? Is it a direct proportion?
| x | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| y | 5 | 7 | 9 | 11 |
- The y when x = 0 is 5: b = 5.
- Each time x goes up by 1, y goes up by 2: m = 2. The function is f(x) = 2x + 5.
- It is not proportional: 7 ÷ 1 = 7 and 9 ÷ 2 = 4.5. The quotients are not equal.
m = 2 and b = 5; it is not a direct proportion.
Watch out! Here many people say it is proportional because y always goes up by 2. Going up by the same amount is not enough: the quotient y ÷ x has to be the same every time.
A challenge to think about
Think of a tariff with a fixed charge and a price per unit: a taxi, a gym, a phone card. Write its function f(x) = mx + b, make a table with five values and draw the line. Explain what m and b mean in your tariff.
Practise
Rounds of 10 questions. Choose a level:
Your grade in this topic:No grade yetDo a round at the Basic level to get a grade.