Functions can be chained together, so that the output of one becomes the input of the next: this is a composite function. A function can also be run backwards, turning outputs back into inputs: this is an inverse function. Converting Celsius to Fahrenheit and back, encrypting and decrypting a message, and logarithms undoing powers are all examples. This lesson builds on functions and relations and is part of HSC Higher Mathematics.
In this lesson you will learn
- Forming composite functions f∘g and g∘f
- Why the order of composition matters
- One-to-one functions and the horizontal line test
- Finding an inverse function algebraically
- The graph of an inverse as a reflection in y = x
You should know functions and relations, including domain and range.
Composite Functions
Definition
(f∘g)(x) = f(g(x)): apply g first, then f to the result.
f(x) = 2x + 3 g(x) = x²
(f∘g)(x) = f(x²) = 2x² + 3
(g∘f)(x) = g(2x + 3) = (2x + 3)² = 4x² + 12x + 9
f(g(2)) = f(4) = 11
g(f(2)) = g(7) = 49
In general f∘g ≠ g∘f, so the order matters. For f(g(x)) to exist, the output of g must lie in the domain of f. For example, with f(x) = √x and g(x) = x − 5, f(g(x)) = √(x − 5) is defined only for x ≥ 5.
One-to-One Functions
A function is one-to-one (injective) if different inputs always give different outputs. Only one-to-one functions have inverses, because otherwise one output would have to go back to two inputs.
- Horizontal line test: if any horizontal line cuts the graph more than once, the function is not one-to-one.
- f(x) = 2x + 3 passes the test. f(x) = x² fails, since f(2) = f(−2) = 4.
- Restricting the domain can fix this: x² for x ≥ 0 is one-to-one, and its inverse is √x.
Finding an Inverse
- Write y = f(x).
- Rearrange to make x the subject.
- Swap the letters: replace y with x, and x with f⁻¹(x).
- State the domain of the inverse (it is the range of f).
f(x) = 2x + 3
y = 2x + 3 → x = (y − 3)/2 → f⁻¹(x) = (x − 3)/2
Check: f⁻¹(f(5)) = f⁻¹(13) = (13 − 3)/2 = 5 ✓
f(x) = (x + 1)/(x − 2), x ≠ 2
y(x − 2) = x + 1
xy − 2y = x + 1
x(y − 1) = 2y + 1
x = (2y + 1)/(y − 1) → f⁻¹(x) = (2x + 1)/(x − 1), x ≠ 1
A function and its inverse undo each other: f(f⁻¹(x)) = x and f⁻¹(f(x)) = x. Note that f⁻¹(x) means the inverse function, not 1/f(x).
Graphs of Inverses
Swapping x and y reflects a graph in the line y = x. So the graph of f⁻¹ is the mirror image of the graph of f in that line, and every point (a, b) on f becomes (b, a) on f⁻¹.
| Function | Inverse |
|---|---|
| f(x) = x + 5 | f⁻¹(x) = x − 5 |
| f(x) = 3x | f⁻¹(x) = x/3 |
| f(x) = x³ | f⁻¹(x) = ∛x |
| f(x) = 10ˣ | f⁻¹(x) = log₁₀ x |
| f(x) = eˣ | f⁻¹(x) = ln x |
Common Mistakes
- Applying functions in the wrong order: in f(g(x)), g acts first.
- Reading f⁻¹(x) as 1/f(x).
- Finding an “inverse” of a function that is not one-to-one without restricting the domain.
- Forgetting the domain of the inverse, such as x ≠ 1 above.
Practice Exercises
Exercise 1. If f(x) = 3x − 1 and g(x) = x + 4, find (f∘g)(x) and (g∘f)(x).
Show answer
f(g(x)) = 3(x + 4) − 1 = 3x + 11. g(f(x)) = 3x − 1 + 4 = 3x + 3.
Exercise 2. Find f⁻¹(x) for f(x) = 3x − 1, then solve f(x) = f⁻¹(x).
Show answer
f⁻¹(x) = (x + 1)/3. 3x − 1 = (x + 1)/3 gives 9x − 3 = x + 1, so x = 1/2. (A function and its inverse meet on the line y = x.)
Exercise 3. Convert Celsius to Fahrenheit with F(c) = 9c/5 + 32. Find the inverse and use it for 98.6 °F.
Show answer
F⁻¹(f) = 5(f − 32)/9. For 98.6: 5 × 66.6 ÷ 9 = 37 °C.
Frequently Asked Questions
Is (f∘g)⁻¹ equal to f⁻¹∘g⁻¹?
No, the order reverses: (f∘g)⁻¹ = g⁻¹∘f⁻¹. Think of putting on socks then shoes; to undo it you remove the shoes first, then the socks.
Can a function be its own inverse?
Yes. f(x) = 1/x and f(x) = −x are examples: applying them twice returns the original input. Their graphs are symmetric about y = x.
Summary
- (f∘g)(x) = f(g(x)); usually f∘g ≠ g∘f.
- Only one-to-one functions have inverses; use the horizontal line test.
- To find f⁻¹, make x the subject of y = f(x), then swap the variables.
- The graph of f⁻¹ is the reflection of f in y = x.
Next: Limits and Continuity.
