Functions, inverses and composites · Mathematics Class… | StemPy Lab
Course 18.3·Lesson 3 of 3
Functions, inverses and composites
A function is a rule that gives exactly one output for each input. This lesson belongs to the Extended content. You use the notation f(x), find the domain and the range, find an inverse by swapping and solving, and combine two functions into a composite function, taking care over the order.
about 25 min1 simulation1 practice question
Lesson 3 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
This lesson is in the Extended content only.
A function is a machine
The Class 11 and 12 chapter on Functions and Their Graphs goes further, with one-one and onto functions and more on composition. This lesson is the first step.
The rule f(x)=3x−5 is a function. We think of a machine. We put in an inputx, and the machine gives an outputf(x). For the input 4 the output is f(4)=3×4−5=7. We also write f:x→3x−5.
A function machine drawn as a row of boxes. The input x goes into a box marked times 3, then into a box marked minus 5, and out comes f of x. Below it, arrows run the other way through a box marked plus 5 and a box marked divide by 3, labelled f inverse. A worked example shows 4 going to 12 and then to 7, and 7 coming back to 12 and then to 4.
A function gives exactly one output for each input. A mapping diagram shows this with arrows from the inputs to the outputs. Two inputs may go to the same output, as in f(x)=x2 with f(2)=f(−2)=4. But one input may not go to two outputs.
The domain is the set of inputs that are allowed.
The range is the set of outputs that come out.
For g(x)=x−21, the domain is all x except x=2, because we cannot divide by 0. For h(x)=2x2+3, any x may be used, but x2≥0 so the outputs satisfy h(x)≥3.
The inverse function
The inverse functionf−1 undoes f. If f sends 4 to 7, then f−1 sends 7 back to 4.
To find f−1(x):
Write y=f(x).
Swap x and y.
Solve for y. The result is f−1(x).
For f(x)=3x−5: write y=3x−5, swap to get x=3y−5, and solve: y=3x+5. So f−1(x)=3x+5.
Check.f−1(7)=37+5=4. It takes 7 back to 4.
For g(x)=53(x+4): swap to get x=53(y+4). Then 5x=3y+12, so g−1(x)=35x−12.
The notation f−1 does not mean f1. It means the inverse function. The graph of y=f−1(x) is the mirror image of the graph of y=f(x) in the line y=x.
Composite functions
The composite functiongf(x) means g(f(x)). Do f first, then g. Read it from the right.
Let f(x)=2x+1 and g(x)=x2.
gf(x)=g(2x+1)=(2x+1)2.
fg(x)=f(x2)=2x2+1.
They are different, so the order matters. For x=3, gf(3)=49 and fg(3)=19.
To find where gf(x)=fg(x), solve (2x+1)2=2x2+1. This gives 2x2+4x=0, so x=0 or x=−2.
A composite of fractions needs care with the simplifying. In this syllabus you are not asked to find the domain or the range of a composite function.
Practise with new numbers
Try it in Python
The program writes f, its inverse and two composites as Python functions. It checks that the inverse takes every output back to its input, and it shows that gf and fg differ.
Common mistakes
Doing the functions in the wrong order. In gf(x), f acts first.
Taking f−1(x) as f(x)1. The inverse undoes f, which is not the reciprocal.
Forgetting to swap x and y. Write y=f(x), swap, then solve for y.
Dividing by zero. A rule such as x−21 is not allowed at x=2.
Skipping the check. Put a number through f and then f−1. You should get the number back.
Remember these
A function gives one output for each input. The domain is the inputs, and the range is the outputs.
f−1: write y=f(x), swap x and y, solve for y.
gf(x)=g(f(x)): f first, then g. In general gf=fg.
The graph of f−1 is the mirror image of the graph of f in y=x.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
f(x)=4x−7. Find f(−2).
f(x)=3x−5. Find f−1(10).
What is the domain of g(x)=x−41?
f(x)=x+3 and g(x)=2x. Find gf(1) and fg(1).
Find f−1(x) when f(x)=5x−2.
References
Cambridge International, IGCSE Mathematics 0580 syllabus (2025, 2026 and 2027), Extended section 2.13 Functions (function notation, domain and range, inverse functions and composite functions).
Enroll free in Graphs of Functions and Function Notation
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.