At CSEC a function was a rule. At CAPE it is a rule together with a domain, and most of the marks in this topic come from taking the domain seriously.
Definition and notation
A functionf:A→B assigns to each element of the domainA exactly one element of the codomainB.
f:x↦2x+3orf(x)=2x+3
The range (or image) is the set of values actually produced. It is a subset of the codomain, and often a proper one.
Domain and range
When a domain is not stated, take the natural domain: every real value for which the rule makes sense. Two things break it:
Division by zero. For f(x)=x−31, the domain is all real x except x=3, written {x∈R:x=3}.
Square roots of negatives. For f(x)=x−2, we need x−2≥0, so the domain is x≥2.
The range takes more thought:
f(x)=x2 on R has range y≥0, since a square is never negative.
f(x)=x−2 has range y≥0, since the root sign denotes the non-negative root.
f(x)=x−31 has range y=0, since a fraction with numerator 1 is never zero.
One-to-one and onto
A function is one-to-one (injective) if different inputs always give different outputs — no output is hit twice.
f(x)=x2 on R is not one-to-one, because f(2)=f(−2)=4.
f(x)=2x+3is one-to-one: if 2a+3=2b+3 then a=b.
A function is onto (surjective) if every element of the codomain is actually reached — the range equals the codomain.
f:R→R with f(x)=x2 is not onto, because no real x gives −1.
A function that is both is a bijection, and bijections are exactly the functions with inverses.
Composite functions
fg(x) means apply g first, then f: work from the inside out.
With f(x)=2x+3 and g(x)=x2:
fg(x)=f(x2)=2x2+3gf(x)=g(2x+3)=(2x+3)2=4x2+12x+9
These are different functions, as they usually are.
For fg to exist, the range of g must lie inside the domain of f. If f(x)=x and g(x)=x−5, then fg(x)=x−5 only makes sense for x≥5 — the composition has narrowed the domain.
Inverse functions
f−1 undoes f: if f(a)=b then f−1(b)=a. Equivalently,
ff−1(x)=xandf−1f(x)=x
An inverse exists only if f is one-to-one. If two inputs shared an output, the inverse would not know which to return.
Find f−1 for f(x)=2x+3.
y=2x+3⇒x=2y−3⇒f−1(x)=2x−3
Check: f(5)=13 and f−1(13)=210=5 ✓
The order reverses
(fg)−1=g−1f−1
Undoing a sequence means undoing the steps in reverse: socks then shoes, but shoes off then socks off.
Domain and range swap
The domain of f−1 is the range of f, and the range of f−1 is the domain of f.
Graphs and restrictions
The graph of y=f−1(x) is the graph of y=f(x)reflected in the line y=x. Every point (a,b) on one becomes (b,a) on the other.
This is why y=ex and y=lnx are mirror images, and why one passes through (0,1) while the other passes through (1,0).
Restricting the domain
f(x)=x2 on R has no inverse. Restrict the domain to x≥0 and it becomes one-to-one, so
f−1(x)=x,x≥0
The restriction is not a technicality — it is what makes the inverse exist, and it is why the calculator's x key returns only the positive root.