What it is
A linear function is a function of the form f(x) = mx + c, where m and c are fixed numbers. Its graph is a straight line.
- m is the gradient, or slope: how much y changes when x increases by 1.
- c is the value of y when x = 0, that is, where the line crosses the y-axis.
Four examples:
- f(x) = 2x + 1. m = 2 and c = 1. f(0) = 1, f(1) = 3, f(2) = 5 and f(3) = 7: each step to the right adds 2.
- f(x) = −0.5x + 4. m = −0.5 and c = 4, so the line slopes down. f(0) = 4, f(2) = 3 and f(4) = 2.
- f(x) = 3x. c = 0, so the line passes through the origin. y is 3 times x, which is called direct proportion.
- f(x) = 5. m = 0, so the line is horizontal and y is 5 for every x.
How to recognise a linear function:
- In a graph it is a straight line, with no bends and no corners.
- In a table y changes by the same amount every time x increases by the same amount. x = 0, 1, 2, 3, 4 and y = 1, 4, 7, 10, 13 increase by 3 each time and belong to f(x) = 3x + 1.
- In an expression x appears only as a number times x, plus a fixed number.
Not linear functions:
- f(x) = x². f(1) = 1, f(2) = 4 and f(3) = 9: y grows by 3 and then by 5. The graph is a parabola.
- f(x) = 2ˣ. f(1) = 2, f(2) = 4 and f(3) = 8: y doubles instead of increasing by the same amount.
- f(x) = |x|. The graph is two straight half-lines that meet at a corner at the origin.
- x = 3. A straight line, but a vertical one. Every y belongs to x = 3, not a single one, so it is not a function.
Why it matters
Linear functions describe things that change by the same amount at each step: a starting level and a fixed change per unit. A candle is 30 cm tall and burns down 5 cm an hour, so its height after t hours is h(t) = −5t + 30. m = −5 is the change per hour and c = 30 the height at the start. After 2 hours the candle is 20 cm tall, and −5t + 30 = 0 gives t = 6: after 6 hours it is gone. The function only holds for t between 0 and 6, since a height cannot be negative.
Two points are enough to fix a linear function. The line through (1, 3) and (4, 9) has m = (9 − 3)/(4 − 1) = 2. Substituting the point (1, 3) into f(x) = 2x + c gives 3 = 2 · 1 + c, so c = 1 and f(x) = 2x + 1. The steps are on the slope from two points and equation of a straight line pages, and the two-point form does it in one expression.
The same amount per step is what makes a function linear. Something that grows by the same percentage per step is exponential growth instead: 100, 110, 121 and 133.1 increase by 10, 11 and 12.1 and are not linear. A direct proportion is the linear function with c = 0.
Drag the sliders for m and c in the graphing calculator and watch the line turn and shift.
Common misconceptions
- “Linear means the line passes through the origin.” Only when c = 0, as for f(x) = 3x. f(x) = 2x + 1 is linear and crosses the y-axis at 1.
- “Every straight line is a linear function.” Every one except the vertical lines. x = 3 is a straight line, but every y belongs to x = 3, so it is not a function.
- “Something that increases at every step is linear.” It has to increase by the same amount at every step. 100, 110, 121 and 133.1 grow by 10% per step, but the increases 10, 11 and 12.1 differ.
- “m is the number written first and c the number written last.” m is the number that multiplies x. In f(x) = 4 + 3x, m = 3 and c = 4.
- “A linear function has a zero.” Only when m ≠ 0, and then the zero is x = −c/m. f(x) = 5 has no zero.
Common questions
What is the difference between a linear function and the equation of a straight line?
It is the same expression read two ways. f(x) = mx + c is a rule that gives one y for each x. The
equation of a straight line y = mx + c
describes all the points (x, y) on the line, and that page works out m, c, x or y when three of them are known. The
equation also exists for vertical lines, x = 3, but the function does not.
How do I read m and c from a graph?
c is the value of y where the line crosses the y-axis. Then go one step to the right from a point on the line and
see how far the line has risen or fallen: that is m, with a minus sign if it fell. A line through (0, 1) and
(1, 3) has c = 1 and m = 3 − 1 = 2.
Is f(x) = 2x + 1 called linear at university too?
In linear algebra, only functions with f(x + y) = f(x) + f(y) and f(cx) = c · f(x) are called linear, and that
requires the constant term to be 0. A function mx + c is called affine there. In school, f(x) = mx + c is called
linear, and that is the meaning this page uses.