- Foundation
- About 15 min
- 5 practice questions
Composition of functions and inverse functions
Compose two functions in the right order, find a composite from tables or formulas, and find the inverse of a bijective function by solving y = f(x).
If something looks wrong, please tell us.
Functions can be chained: the output of one becomes the input of the next. This is called composition, and it is how complicated formulas are built from simple ones. Reversing a function, so that outputs lead back to inputs, gives the inverse. This lesson covers both, and shows why only bijective functions have inverses.
Composition
Let f : A → B and g : B → C. The composition g ∘ f is the function from A to C given by (g ∘ f)(x) = g(f(x)). Read it from the right: first apply f, then apply g to the result. For g ∘ f to make sense, every output of f must lie in the domain of g. The order matters: in general g ∘ f and f ∘ g are different functions, and sometimes only one of them is defined.
Worked example 1: order matters
Let f(x) = x + 2 and g(x) = x² on R. Then (g ∘ f)(x) = g(x + 2) = (x + 2)², while (f ∘ g)(x) = f(x²) = x² + 2. At x = 1 these give (1 + 2)² = 9 and 1² + 2 = 3, so the two composites are different. A reliable method is to write the outer function's formula and replace its x by the whole inner formula in brackets.
Worked example 2: composition from tables
Let A = {1, 2, 3}, f = {(1, 3), (2, 1), (3, 2)} from A to A, and g = {(1, a), (2, b), (3, c)} from A to {a, b, c}. To find g ∘ f, follow each element through f and then g: 1 → 3 → c, 2 → 1 → a and 3 → 2 → b. So g ∘ f = {(1, c), (2, a), (3, b)}. Here f ∘ g is not even defined, because the outputs a, b, c of g are not in the domain of f.
Inverse functions
If f : A → B is bijective, each y in B comes from exactly one x in A. Sending y back to that x gives a function from B to A called the inverse of f, written f⁻¹. So f⁻¹(y) = x exactly when f(x) = y. If f is not one-one, some y would have to go back to two values; if f is not onto, some y would have nowhere to go. That is why a function has an inverse if and only if it is bijective. Note that f⁻¹ does not mean 1/f.
The inverse undoes the function: f⁻¹(f(x)) = x for every x in A and f(f⁻¹(y)) = y for every y in B. To find the inverse of a formula, write y = f(x), solve for x in terms of y, and then rename the variable.
Worked example 3: finding an inverse
Find the inverse of f : R → R, f(x) = 3x − 4. It is bijective because it is a linear function with non-zero slope. Write y = 3x − 4. Then 3x = y + 4 and x = (y + 4)/3. So f⁻¹(x) = (x + 4)/3. Check: f(f⁻¹(x)) = 3 × (x + 4)/3 − 4 = x + 4 − 4 = x. Always check the inverse by composing; a slip in sign shows up at once.
Worked example 4: using an inverse without a formula
If f is a bijection with f(3) = 7, then f⁻¹(7) = 3, because the inverse simply reverses each pair. For a table such as f = {(1, 4), (2, 6), (3, 5)}, reversing every pair gives f⁻¹ = {(4, 1), (6, 2), (5, 3)}.
(g ∘ f)(x) = g(f(x)): apply f first. A function has an inverse exactly when it is bijective; find it by solving y = f(x) for x, and check that f(f⁻¹(x)) = x.
Key takeaways
In g ∘ f the inner function f acts first. Replace the outer function's variable by the whole inner formula in brackets. f ∘ g and g ∘ f are usually different. Only bijective functions have inverses; reverse the pairs for a table, or solve y = f(x) for a formula, and check by composing.
Check your understanding
-
1. f(x) = 2x and g(x) = x + 3. What is (f ∘ g)(2)?
- 7
- 10
- 8
- 12
Show answer
Answer: B. g acts first: g(2) = 5. Then f(5) = 10. (The value 7 is (g ∘ f)(2) = g(4).)
-
2. f(x) = x² and g(x) = x − 1. What is (g ∘ f)(x)?
- (x − 1)²
- x² − x
- x² − 1
- x − 1
Show answer
Answer: C. f acts first, giving x², then g subtracts 1: g(x²) = x² − 1. (x − 1)² is f ∘ g.
-
3. What is the inverse of f : R → R, f(x) = (x − 5)/2?
- f⁻¹(x) = 2x + 5
- f⁻¹(x) = 2x − 5
- f⁻¹(x) = (x + 5)/2
- f⁻¹(x) = 2/(x − 5)
Show answer
Answer: A. y = (x − 5)/2 gives 2y = x − 5, so x = 2y + 5. Check: f(2x + 5) = (2x + 5 − 5)/2 = x.
-
4. f is a bijection with f(3) = 7. What is f⁻¹(7)?
- 7
- 3
- 1/7
- 1/3
Show answer
Answer: B. The inverse reverses each pair: f(3) = 7 means f⁻¹(7) = 3.
-
5. f : {1, 2, 3} → {1, 2, 3} is f = {(1, 2), (2, 3), (3, 1)}. What is (f ∘ f)(1)?
- 2
- 1
- 4
- 3
Show answer
Answer: D. f(1) = 2, and then f(2) = 3. So (f ∘ f)(1) = 3.
Sign in to keep track of the lessons you finish.