Linear Functions
A taxi meter starts at 3 dollars before the wheels even turn —
the flag fall — and then adds 2.50 dollars for every
kilometre you ride. A phone plan bills 15 dollars a month plus
0.10 per minute of calls. A plumber charges a
60-dollar call-out fee plus 45 an
hour. Different jobs, same skeleton: a starting amount, plus a
fixed rate times how much you use.
Every one of these is a linear function — the functions whose
graph is a
perfectly straight line. And they are special for one reason that the rest of calculus
will keep circling back to: a linear function is the only kind whose rate never
changes. The taxi's tenth kilometre costs exactly what its first did. Nothing
speeds up, nothing tapers off. Every linear function fits one tidy template:
y = mx + b
This is called slope-intercept form. Just two numbers,
m and b, completely describe the
line — change either one and the line tilts or slides. Better still, each number is
something you can point at in the real situation: m is
the rate (dollars per kilometre, cost per minute), and
b is the starting amount (the flag fall, the monthly
fee). For the taxi, y = 2.5x + 3 — and you already know what
both numbers mean. (Some books write y = mx + c; same idea,
different letter for the starting value.)
-
Every linear function can be written as
f(x) = mx + b for two constants
m and b.
-
m is the slope: the constant rate of
change. Increasing x by 1
always changes y by exactly m —
the same everywhere on the line.
-
b is the y-intercept: the starting value,
b = f(0), where the line crosses the
y-axis.
b — where the line starts
The number b is the y-intercept: the height
where the line crosses the y-axis. That makes sense — at the
crossing point x = 0, so
y = m(0) + b = b.
So the line always passes through the point (0, b). In a real
tariff, x = 0 means "before anything has happened yet" — zero
kilometres ridden, zero minutes called — so b is the amount you
owe just for showing up: the flag fall, the standing charge, the joining fee. Increasing
b lifts the whole line up; decreasing it drops the line down,
without changing its tilt at all.
m — the rate that never changes
The number m is the slope: it sets how steeply
the line rises or falls, because it is the amount y changes
every single time x steps up by
1. Read it as a "per": dollars per kilometre, litres
per minute, metres per second. A bigger m
tilts the line up more sharply; a negative m tips it downhill
(a phone battery draining, a bath emptying); m = 0 leaves it
perfectly flat — a quantity that never changes at all. (We'll measure slope precisely in
the next
lesson.)
Drive the two sliders below and watch how m and
b shape the line. The dot marks the
y-intercept (0, b). Notice the two
controls never interfere: b slides the line up and down
rigidly, while m pivots it around that dot — the
intercept is the hinge.
Worked example: from a tariff to an equation — and back
Forwards. A taxi charges 3 dollars flag fall,
then 2.50 dollars per kilometre. Build the fare function for a
trip of x kilometres:
- the starting amount is the flag fall, so b = 3;
- the rate is per-kilometre cost, so m = 2.5;
- therefore y = 2.5x + 3.
Now the function answers questions for free. An 8-kilometre
trip costs
y = 2.5(8) + 3 = 20 + 3 = 23 dollars. A
20-kilometre airport run:
2.5(20) + 3 = 53. One formula, every fare.
Backwards. Your phone bill is computed by
y = 0.10x + 15, with x in minutes.
Read the two facts straight off: the 15 sits where
b lives, so it's the standing charge — you pay it even if you
never call anyone (x = 0 gives
y = 15). The 0.10 multiplies
x, so it's the rate: each extra minute costs ten cents, the
first minute exactly as much as the thousandth. Translating both ways —
story \to equation and equation
\to story — is the whole skill.
Worked example: the line through two points
Often you aren't handed m and b —
you're handed two data points and asked for the line through them. Say a
courier charges 5 dollars for a 1-kg
parcel and 13 dollars for a 5-kg
one… but let's do the sums with the points (1, 3) and
(5, 11). The recipe is always slope first, then
intercept.
Step 1 — slope. Between the points, x ran from
1 to 5 (a run of
4) while y rose from
3 to 11 (a rise of
8). The rate is rise per unit of run:
m = \frac{\Delta y}{\Delta x} = \frac{11 - 3}{5 - 1} = \frac{8}{4} = 2.
Step 2 — intercept. Now that m = 2 is known,
feed either point into y = 2x + b and solve. Using
(1, 3):
3 = 2(1) + b, so b = 1. The line is
y = 2x + 1.
Step 3 — check. The other point must also fit:
2(5) + 1 = 11. ✓ Step through the construction:
This two-step recipe never changes: m from
\Delta y / \Delta x, then b from one
point. Two points pin down a line completely — which is exactly why two numbers
(m and b) suffice to describe it.
Three snags catch nearly everyone with lines:
-
Slope is rise over RUN — \Delta y / \Delta x, never
\Delta x / \Delta y. The change in
y goes on top. Flip the fraction and a gentle slope
of \tfrac{1}{4} masquerades as a steep 4.
A memory hook: slope answers "how much does y change per
one step of x?" — the per-thing always goes underneath,
just like "dollars per kilometre".
-
A negative slope falls left-to-right. Read a graph the way you read a
sentence: left to right. m < 0 means each step right takes
you down. A line like y = -2x + 7 is still perfectly
linear — its rate is constant, it just happens to be a constant loss.
-
"Linear" has a stricter cousin. In school maths, any
y = mx + b is called linear. But to a mathematician a truly
linear map must satisfy f(2x) = 2f(x) — double the
input, double the output — which only works when b = 0. (The
taxi fails it: an 8-km ride costs 23,
not double the 13 of a 4-km ride,
because the flag fall doesn't double.) Lines with b \neq 0
are technically called affine. Nobody will dock you marks for saying "linear" —
but when you meet linear algebra later, this fine print suddenly matters.
Drawing a line from just two numbers
Given an equation in slope-intercept form, you can draw its graph with no table of values
at all — the two numbers are the drawing instructions. The recipe:
start at b, then walk the slope. Put your
pencil on (0, b); then, from that point, go
1 right and m up (down if
m is negative), mark the new point, and rule the line through
them.
Take y = 3x - 2: the slope is m = 3
and the y-intercept is b = -2. So:
pencil on (0, -2); walk right 1, up
3, arriving at (1, 1); join and
extend. Step through the worked line below and watch the run-and-rise staircase do the
walking.
Khan Academy introduces slope-intercept form here:
Almost nothing in nature is actually linear. Populations grow in curves, planets
sweep ellipses, your phone battery drains faster when it's cold. So why does every science
course, every economics model, every engineering estimate reach for
y = mx + b first?
Because of a marvellous cheat: zoom in far enough on any smooth curve, and it
looks like a straight line. The Earth is a sphere, but your street looks flat —
you are living on a zoomed-in patch of a curve. A curve's zoomed-in stand-in line is
called its tangent line, and near the point of contact it's a superb
approximation: simple to compute with, easy to reason about, wrong by only a whisker.
That's why linear models rule the world — not because the world is linear, but because
up close, everything behaves as if it were.
Here's the punchline for this course: calculus is the machine for finding those
lines. The derivative you're heading toward is exactly "the slope
m of the line a curve pretends to be at a point." Master
m and b now, and you've already
learned the alphabet the whole rest of calculus is written in.