What is a function?
A function is a rule. You give it a number (the input). It gives back one number (the output). We write f(x), read "f of x".
One input must never give two outputs. Two inputs may give the same output. That is fine.
A function can be shown in four ways: a rule (f(x) = 2x + 1), a table of values, a graph, or arrows between two sets. On a graph, use the vertical line test: if any up-down line cuts the graph twice, it is not a function.
Domain and range
The domain is the set of inputs that are allowed. The range is the set of outputs you can get.
- f(x) = 1/x: x cannot be 0. Domain: all real numbers except 0.
- f(x) = √x: x cannot be negative. Domain: x ≥ 0. Range: y ≥ 0.
- f(x) = x²: any x works. Range: y ≥ 0.
Two rules to find the domain: never divide by zero, never take the square root of a negative number.
Standard functions and their graphs
Learn these shapes. Most questions use them.
- Linear y = mx + c: a straight line. m is the slope.
- Quadratic y = x²: a U-shaped curve (parabola).
- Cubic y = x³: an S-shaped curve through the origin.
- Reciprocal y = 1/x: two separate branches. It never touches the axes. The axes are its asymptotes (lines the curve gets close to but never meets). It is decreasing on each branch.
- Square root y = √x: starts at (0, 0) and rises slowly.
- Exponential y = 2ˣ: grows faster and faster; always above 0.
A family of functions is a group with the same shape. y = x² + c moves the U up or down. y = (x − a)² moves it right by a. y = k·x² makes it narrower or wider.
From a graph you can read: where the function is increasing or decreasing, its maximum or minimum, and its zeros (where it cuts the x-axis).
Composite functions
A composite function joins two machines. g(f(x)), also written (g∘f)(x), means: do f first, then g.
Example: f(x) = 2x, g(x) = x + 3.
- g(f(x)) = g(2x) = 2x + 3
- f(g(x)) = f(x + 3) = 2(x + 3) = 2x + 6
They are different! Order matters. Also, the output of f must be in the domain of g, or g(f(x)) is not defined.
Inverse functions
The inverse f⁻¹ undoes f. If f(3) = 6, then f⁻¹(6) = 3. So f⁻¹(f(x)) = x.
How to find it:
- Write y = f(x).
- Swap x and y.
- Make y the subject.
Example: y = 2x + 3 → x = 2y + 3 → y = (x − 3)/2. So f⁻¹(x) = (x − 3)/2.
Only a one-to-one function has an inverse (each output comes from just one input). Use the horizontal line test. y = x² fails it, so we restrict the domain to x ≥ 0; then its inverse is √x.
The graph of f⁻¹ is the reflection of the graph of f in the line y = x. The domain of f becomes the range of f⁻¹, and the other way round.
Note: f⁻¹(x) is not 1/f(x). The reciprocal 1/x happens to be its own inverse, but that is special.
Modelling with functions
Functions describe real situations. A phone plan: cost C(n) = 199 + 2n for n extra GB. A company's cost function C(q) = fixed cost + cost per item × q. Its revenue R(q) = price × q. Profit P(q) = R(q) − C(q). The break-even point is where P(q) = 0.
Steps: name the input and output, write the rule, state a sensible domain (you cannot make −5 items), then use the graph to answer questions.
Try it
In the 3D, choose f = x + 3 and g = 2x. Set x = 1. Predict g(f(1)) and f(g(1)) first, then check. At home: write your own "think of a number" trick (double it, add 5...). Then write the inverse steps that get back the starting number.
Key formulas and definitions
- (g∘f)(x) = g(f(x)) — do f first
- f⁻¹(f(x)) = x and f(f⁻¹(x)) = x
- To find f⁻¹: y = f(x) → swap x and y → solve for y
- Domain of f = range of f⁻¹
- Graph of f⁻¹ = reflection of graph of f in y = x
- Inverse of a composite: (g∘f)⁻¹ = f⁻¹∘g⁻¹
Worked examples
1. f(x) = 3x − 1. Find f(4) and f(−2).
f(4) = 3 × 4 − 1 = 11. f(−2) = 3 × (−2) − 1 = −7.
2. Find the domain of f(x) = 1/(x − 5).
The bottom cannot be 0, so x − 5 ≠ 0, so x ≠ 5. Domain: all real numbers except 5.
3. f(x) = x², g(x) = x + 1. Find g(f(2)) and f(g(2)).
f(2) = 4, so g(f(2)) = 4 + 1 = 5. g(2) = 3, so f(g(2)) = 3² = 9. Different answers: order matters.
4. Find the inverse of f(x) = (x + 4)/3.
y = (x + 4)/3. Swap: x = (y + 4)/3. Multiply by 3: 3x = y + 4. So y = 3x − 4. f⁻¹(x) = 3x − 4. Check: f(2) = 2, and f⁻¹(2) = 2. ✓
5. f(x) = 2x + 1, g(x) = x². Find an expression for f(g(x)) and solve f(g(x)) = 19.
f(g(x)) = 2x² + 1. Set 2x² + 1 = 19, so 2x² = 18, x² = 9, x = 3 or x = −3.
6. A bakery has fixed cost ₹2000 a day and each cake costs ₹150 to make. Cakes sell for ₹250. Find the profit function and the break-even number.
C(q) = 2000 + 150q. R(q) = 250q. P(q) = 250q − (2000 + 150q) = 100q − 2000. Break-even: 100q − 2000 = 0, q = 20 cakes.
Common mistakes
- Doing g(f(x)) in the wrong order. The inside function (f) is done first.
- Thinking f⁻¹(x) means 1/f(x). It means the undoing function.
- Forgetting to restrict the domain: y = x² has no inverse unless x ≥ 0 (or x ≤ 0).
- Leaving 0 or negative numbers in the domain of 1/x or √x.