Functions

A function is a machine: one input goes in, exactly one output comes out. The rule is the machine.

A currency booth posts one rate: £1 = $1.25. No haggling, no commission.

Hand over £20 and you get $25. Hand over £40 and you get $50.

a currency booth with one fixed rate £1 = $1.25 no commission, no haggling £20 $25 £40 $50 £60 $75 hand over the same amount tomorrow and you get the same back

Come back tomorrow with £20 and you get $25 again. The booth is reliable — that is the whole point of posting a rate.

One amount in, one amount out, the same every time. Put it in a table and each input appears once.

And the rule is easy to write: dollars = 1.25 × pounds.

That reliability is the definition of a function. A booth that sometimes gave $25 for £20 and sometimes $18 would be useless — and it would not be a function either.

A function machine multiplying by three then adding two 4 input x ×3, then +2 f(x) = 3x + 2 the rule 14 output y one input in, exactly one output out — that is what makes it a function

The function machine

Picture a machine with a rule written on it, say "multiply by 3, then add 2". Feed in 4, out comes 14.

The rule in symbols is y = 3x + 2, or in function notation f(x) = 3x + 2, so f(4) = 14.

The defining condition: the same input must always give the same output. One in, exactly one out.

The test

If any input produces two different outputs, it is not a function. On a graph, that means a vertical line crossing the curve twice.

Four ways to show the same function

Rule: y = 3x + 2.

Table: x = 0, 1, 2, 3 giving y = 2, 5, 8, 11.

Graph: the points (0,2), (1,5), (2,8) lie on a straight line.

Words: "a $2 booking fee plus $3 per ticket".

Being able to move between all four is most of this unit.

Slope and intercept, read from anywhere

In y = mx + b, m is the slope and b is the y-intercept.

From a table: the constant jump in y per step of 1 in x is m; the value at x = 0 is b.

From a graph: m = riserun between any two points; b is where it crosses the y-axis.

From two points: m = y2 - y1x2 - x1, then substitute one point to find b.

What the slope means in a story

Slope is a rate: dollars per ticket, miles per hour, cm of growth per week.

Positive slope rises, negative slope falls, and zero slope is flat — no change.

The y-intercept is the starting amount, before anything happens: a joining fee, a head start, a tank already part full.

Name them in words first

Before touching the algebra, say aloud: "the slope is ___ per ___, and the starting value is ___." Then write y = mx + b. The equation almost writes itself.

Linear or not?

A function is linear exactly when equal steps in x give equal steps in y.

x = 1, 2, 3 giving y = 5, 8, 11 is linear — the jump is always +3.

y = 1, 4, 9 is not — the jumps are +3 then +5. That one is y = x2.

And a proportional relationship is just a linear function with b = 0.

Worked examples

Rule from a table

A table gives x = 0, 1, 2, 3 and y = 7, 11, 15, 19. Write the rule and find y when x = 10.

  1. Check the jumps: 11 - 7 = 4, 15 - 11 = 4, 19 - 15 = 4 Constant, so it is linear with slope 4.
  2. At x = 0, y = 7, so b = 7. The y-intercept is read straight off the table.
  3. Rule: y = 4x + 7 Check x = 2: 8 + 7 = 15 ✓
  4. y = 4(10) + 7 = 47 Substitute.

y = 4x + 7, and y = 47.

From two points

A line passes through (2, 9) and (5, 21). Find its equation.

  1. m = 21 - 95 - 2 = 123 = 4 Change in y over change in x.
  2. Substitute (2, 9) into y = 4x + b: 9 = 8 + b Use a known point to pin down b.
  3. b = 1 So the line crosses the y-axis at 1.
  4. Check with (5, 21): 4(5) + 1 = 21 ✓ Always verify with the point you did not use.

y = 4x + 1

A function in a story

A gym charges $30 to join plus $22 a month. Write the rule, and find the cost of a year.

  1. Slope is 22 dollars per month. The repeating, per-unit amount.
  2. Intercept is 30 — paid before any months pass. The value at x = 0.
  3. y = 22x + 30 Slope times months, plus the starting fee.
  4. y = 22(12) + 30 = 294 A year is 12 months.

y = 22x + 30, so $294.

Words to know

Function
A rule pairing each input with exactly one output.
Input / output
The value you put in (x) and what comes out (y).
Slope
How much y changes for each 1 that x increases.
y-intercept
The output when x = 0 — where the line crosses the vertical axis.
Linear function
One whose graph is a straight line: y = mx + b.

Mistakes to watch for

Computing slope as runrise. It is rise over run, because slope answers "how much does y change for each step in x" — which puts the x change on the bottom.

Reading b from any point instead of from x = 0. The y-intercept is the value when x is zero, so only the point on the y-axis gives it directly. Any other point needs the equation solved.

Calling a relationship linear after checking one pair of values. Two points always lie on some straight line. Test a third — and check that the x values step evenly too.

Rejecting a function because an output repeats. Two different inputs may give the same output; a vending machine can sell crisps from two buttons. Only a repeated input with different outputs breaks it.

The word function was introduced by Leibniz in 1673, and the notation f(x) by Euler in 1734.

For a long time "function" meant something you could write a formula for. Mathematicians only widened it to "any rule pairing each input with one output" in the 1800s.

That widening was forced on them by problems in physics where the rule existed but no formula did.

Browse all courses