Functions are machines

intro 11 minalgebra-basics

Builds on:Linear equations stay balanced

The idea

A function turns each allowed input into exactly one output. Think of f(x)f(x) as a named machine: something goes in, a fixed rule is applied, and exactly one result comes out every time.

Composition chains machines together: (g∘f)(x)(g \circ f)(x) means run ff first, then feed its output into gg.

An inverse function runs a reversible machine backward. To find f−1f^{-1}, write y=f(x)y=f(x) and solve for xx. For f(x)=3x−2f(x)=3x-2, y=3x−2y=3x-2 gives x=(y+2)/3x=(y+2)/3, so f−1(y)=(y+2)/3f^{-1}(y)=(y+2)/3. An inverse exists on a domain only when each output identifies one input; otherwise the domain must be restricted.

Real-world: a ride-fare calculator

A taxi app charges a $3 booking fee plus $2 per kilometre; distance goes in and total fare comes out, so the rule is f(x)=2x+3f(x) = 2x + 3. A 6 km trip gives f(6)=2(6)+3=15f(6) = 2(6) + 3 = 15, i.e. $15 — one distance always produces one fare.

x = 3
× 2
+ 1
7

Move the input; the same rule always produces one output.

Worked example

  1. Input x=3x = 3
  2. Multiply by 2: 66
  3. Add 1: 77
  4. So f(3)=7f(3) = 7

Cheat sheet

f(x)=2x+1f(x) = 2x + 1