D. Characteristics of Functions · Combining Functions and ModellingComposing a Function with Its Inverse
D2.7About 70 minutes
Learning goals- I can show with function machines, graphs and equations that f⁻¹(f(x)) = x and f(f⁻¹(x)) = x.
- I can verify that two functions are inverses by composing them in both orders.
- I can simplify expressions such as 10^(log x) and log(10ˣ), stating where each simplification is valid.
- I can explain why a restricted domain is needed for f⁻¹(f(x)) = x when f is not one-to-one.
Words to know
inverse function
The function f⁻¹ that undoes f: if f(a) = b, then f⁻¹(b) = a. It exists as a function only if f is one-to-one.
identity function
The function I(x) = x, which returns every input unchanged.
one-to-one
A function in which different inputs always give different outputs. It passes the horizontal line test.
restricted domain
A smaller domain chosen so that a function becomes one-to-one and has an inverse function, such as x ≥ 0 for y = x².
A secret code that undoes itself
You send a friend a coded number: multiply by 3, then add 7. The number 5 becomes 22. Your friend decodes: subtract 7, then divide by 3, and gets 5 back. Encoding and then decoding gives you exactly what you started with.
In function language, the code is f(x) = 3x + 7 and the decoder is its inverse, f⁻¹(x) = (x − 7)/3. Decoding the encoded number is a composition:
f⁻¹(f(x)) = x.
Remember from Grade 11: in Functions and Equivalent Expressions (MCR3U) you found inverses by reversing steps, by swapping x and y, and by reflecting graphs in the line y = x. You also learned that f⁻¹(x) does not mean 1/f(x). This lesson connects inverses to composition.
Encoding with f and then decoding with f⁻¹ is a round trip: 5 goes to 22 and comes back to 5.The big fact
If f has an inverse function f⁻¹, then
- f⁻¹(f(x)) = x for every x in the domain of f, and
- f(f⁻¹(x)) = x for every x in the domain of f⁻¹ (which is the range of f).
In words: composing a function with its inverse, in either order, gives the identity function I(x) = x. Every input is mapped back onto itself.
Why? If f(a) = b, then by definition f⁻¹(b) = a. So f⁻¹(f(a)) = f⁻¹(b) = a. The same reasoning works in the other order.
On a graph
If (a, b) is on the graph of f, then (b, a) is on the graph of f⁻¹, its mirror image in the line y = x. To find f⁻¹(f(a)): go up from a to the graph of f to get b; then use b as the input of f⁻¹ and you land on a again.
f(x) = 2ˣ (solid) and its inverse log₂ x (dashed) are reflections in y = x. Since f(2) = 4 and f⁻¹(4) = 2, the round trip takes 2 back to 2.Worked exampleExample 1: Verify inverses by composing
Show that f(x) = 3x − 5 and g(x) = (x + 5)/3 are inverses of each other.
- Compose one way: f(g(x)) = 3((x + 5)/3) − 5 = (x + 5) − 5 = x.
- Compose the other way: g(f(x)) = ((3x − 5) + 5)/3 = 3x/3 = x.
- Both compositions give x for every real x, so f and g are inverses.
f(g(x)) = g(f(x)) = x, so g = f⁻¹.
Check both orders
To prove that two functions are inverses, show that both f(g(x)) = x and g(f(x)) = x, each on the right domain. One order alone is not always enough when domains are restricted (see Example 4).
Worked exampleExample 2: A rational function and its inverse
Show that f(x) = (x − 1)/(x + 2) and g(x) = (2x + 1)/(1 − x) are inverses, and state where.
- f(g(x)) = [ (2x + 1)/(1 − x) − 1 ] ÷ [ (2x + 1)/(1 − x) + 2 ].
- Numerator: (2x + 1 − (1 − x))/(1 − x) = 3x/(1 − x). Denominator: (2x + 1 + 2(1 − x))/(1 − x) = 3/(1 − x).
- So f(g(x)) = (3x/(1 − x)) ÷ (3/(1 − x)) = x, for x ≠ 1.
- g(f(x)) = [ 2(x − 1)/(x + 2) + 1 ] ÷ [ 1 − (x − 1)/(x + 2) ] = [ (3x)/(x + 2) ] ÷ [ 3/(x + 2) ] = x, for x ≠ −2.
- The domain of f is x ≠ −2 and its range is y ≠ 1 (horizontal asymptote y = 1). The domain of g is x ≠ 1 and its range is y ≠ −2. The domains and ranges swap, as they must for inverses.
f and g are inverses: f(g(x)) = x for x ≠ 1 and g(f(x)) = x for x ≠ −2.
Exponentials and logarithms
In the sibling unit Exponential and Logarithmic Functions you learned that y = 10ˣ and y = log x are inverses. So:
- log(10ˣ) = x for every real x (10ˣ is always positive, so log can take it).
- 10^(log x) = x only for x > 0 (log x needs a positive input).
The same holds for any base b > 0, b ≠ 1: log_b(bˣ) = x, and b^(log_b x) = x for x > 0. These are exactly the steps you use to solve exponential and logarithmic equations: you apply the inverse to both sides because it undoes the function.
Worked exampleExample 3: Simplify using inverse compositions
Simplify: (a) 10^(log 7) (b) log(10^(3.2)) (c) 2^(log₂ 9) (d) log₃(81) (e) 10^(log(x²)), stating any restriction.
- (a) 10^(log 7) = 7.
- (b) log(10^(3.2)) = 3.2.
- (c) 2^(log₂ 9) = 9.
- (d) 81 = 3⁴, so log₃(3⁴) = 4.
- (e) 10^(log(x²)) = x², valid when x² > 0, that is x ≠ 0.
7, 3.2, 9, 4, and x² for x ≠ 0.
When the inverse needs a restricted domain
A function that is not one-to-one has no inverse function on its whole domain. We restrict the domain first.
Squares and square roots. With f(x) = x² restricted to x ≥ 0, the inverse is f⁻¹(x) = √x. Then f(f⁻¹(x)) = (√x)² = x for x ≥ 0 ✓. But if you forget the restriction, √(x²) = |x|, which equals x only for x ≥ 0. For example √((−4)²) = √16 = 4, not −4.
Sine and inverse sine. sin x is restricted to −π/2 ≤ x ≤ π/2 to define sin⁻¹ x (the calculator's inverse sine key). So sin(sin⁻¹ x) = x for −1 ≤ x ≤ 1, but sin⁻¹(sin x) = x only for −π/2 ≤ x ≤ π/2. Outside that interval, sin⁻¹ returns the angle in [−π/2, π/2] with the same sine. For example, sin⁻¹(sin(5π/6)) = sin⁻¹(1/2) = π/6, not 5π/6.
y = sin⁻¹(sin x) (solid) matches y = x (dashed) only on the shaded interval −π/2 ≤ x ≤ π/2. Elsewhere it zigzags; for example, at x = 5π/6 it gives π/6.Worked exampleExample 4: Restricted domains in action
Evaluate (a) √((−3)²) (b) (√5)² (c) sin⁻¹(sin(π/3)) (d) sin⁻¹(sin(2π/3)) (e) cos⁻¹(cos(−π/4)).
- (a) √9 = 3 (not −3, because the square root is never negative).
- (b) 5 (√5 exists, and squaring undoes it).
- (c) π/3 is in [−π/2, π/2], so the answer is π/3.
- (d) sin(2π/3) = √3/2, and the angle in [−π/2, π/2] with that sine is π/3, not 2π/3.
- (e) cos⁻¹ returns angles in [0, π]. cos(−π/4) = √2/2, and cos⁻¹(√2/2) = π/4, not −π/4.
3, 5, π/3, π/3, π/4. The inverse undoes the function only on the restricted domain used to define it.
Just for funWhat did f⁻¹ say to f after their round trip?
"Thanks for nothing." (Composing a function with its inverse changes nothing: x comes back as x.)
Hands-on activityCode and decode with a partner
You need: a partner, paper, a pencil and a calculator.
- Number the letters A = 1, B = 2, ..., Z = 26.
- Encode a short word (for example MAPLE: 13, 1, 16, 12, 5) with f(x) = 5x − 2. Send your partner only the coded numbers.
- Your partner finds f⁻¹ and decodes. Then swap roles with a new word and a new code of your choice (it must be one-to-one).
- Now try a code that fails: g(x) = (x − 13)². Encode B (2) and X (24). What goes wrong when you decode?
- On the calculator, find √((−7)²) and (√7)². Explain the results.
What to look for: MAPLE encodes to 63, 3, 78, 58, 23, and f⁻¹(x) = (x + 2)/5 decodes it exactly. With g, both B and X give (−11)² = 121 = 11², so 121 cannot be decoded uniquely: g is not one-to-one and has no inverse function. On the calculator, √((−7)²) = 7 (not −7), while (√7)² = 7: the round trip works only for non-negative inputs.
Your turn
1Verify by composition that f(x) = 4x + 1 and g(x) = (x − 1)/4 are inverses.
f(g(x)) = 4·(x − 1)/4 + 1 = x; g(f(x)) = (4x + 1 − 1)/4 = x. Inverses ✓
2f(x) = x³ − 2. Find f⁻¹(x) and check f(f⁻¹(x)) = x.
f⁻¹(x) = ∛(x + 2). f(f⁻¹(x)) = (∛(x + 2))³ − 2 = x + 2 − 2 = x ✓
3Simplify log(10^(x + 1)) and 10^(log(x + 1)), with restrictions.
log(10^(x + 1)) = x + 1 for all x. 10^(log(x + 1)) = x + 1 for x > −1.
4If f(3) = 11, find f⁻¹(f(3)) and f(f⁻¹(11)).
Both are round trips: 3 and 11.
5Are f(x) = 2x + 6 and g(x) = x/2 − 6 inverses? Use composition.
f(g(x)) = 2(x/2 − 6) + 6 = x − 6 ≠ x. Not inverses. (The inverse is x/2 − 3.)
6Evaluate sin⁻¹(sin(7π/6)).
sin(7π/6) = −1/2, and the angle in [−π/2, π/2] with sine −1/2 is −π/6.
More practice: warm-up
5Is √(x²) always equal to x?
No. √(x²) = |x|; it equals x only for x ≥ 0.
More practice: on your own
1Verify that f(x) = 1/(x − 3) and g(x) = 1/x + 3 are inverses, and state each domain.
f(g(x)) = 1/(1/x + 3 − 3) = 1/(1/x) = x (x ≠ 0). g(f(x)) = (x − 3) + 3 = x (x ≠ 3). Domain of f: x ≠ 3; domain of g: x ≠ 0.
2A point (2, 9) is on the graph of a one-to-one function h. Name a point on h⁻¹ and find h(h⁻¹(9)).
(9, 2) is on h⁻¹. h(h⁻¹(9)) = h(2) = 9.
3Simplify 3^(2 log₃ x) for x > 0.
2 log₃ x = log₃(x²), so the expression is x².
4°F to °C: C(F) = (5/9)(F − 32). °C to °F: F(C) = 1.8C + 32. Verify F(C(F)) = F.
F(C(F)) = 1.8·(5/9)(F − 32) + 32 = (F − 32) + 32 = F ✓ (1.8 × 5/9 = 1).
5Evaluate cos⁻¹(cos(5π/3)).
cos(5π/3) = 1/2; cos⁻¹ gives angles in [0, π], so the answer is π/3.
Challenge
1Find the inverse of f(x) = (2x + 3)/(x − 1) and show that f is its own inverse or not.
Swap and solve: x = (2y + 3)/(y − 1) → xy − x = 2y + 3 → y(x − 2) = x + 3 → f⁻¹(x) = (x + 3)/(x − 2). This differs from f (for example f(0) = −3 but f⁻¹(0) = −3/2), so f is not its own inverse.
2Show that f(x) = (x + 2)/(x − 1) is its own inverse by computing f(f(x)).
f(f(x)) = [ (x + 2)/(x − 1) + 2 ] ÷ [ (x + 2)/(x − 1) − 1 ] = [ (3x)/(x − 1) ] ÷ [ 3/(x − 1) ] = x (x ≠ 1). So f⁻¹ = f: its graph is symmetric in y = x.
3Explain why f(x) = x² + 4x has no inverse function on ℝ, choose a domain on which it does, and find the inverse there.
x² + 4x = (x + 2)² − 4 takes equal values at x and −4 − x (for example f(0) = f(−4) = 0), so it is not one-to-one. Restrict to x ≥ −2. Solve x = (y + 2)² − 4: y = −2 + √(x + 4), so f⁻¹(x) = √(x + 4) − 2, x ≥ −4.
Check your understandingQuiz
1. If f has an inverse and f(6) = −2, what is f⁻¹(f(6))?
2. Which expression equals x for every real x?
3. f(x) = 2x − 8. Which g satisfies f(g(x)) = x and g(f(x)) = x?
4. What is sin⁻¹(sin(3π/4))?
6. Where is 10^(log x) = x true?
For parents and teachersBig idea: D2.7 asks students to show, with function machines, graphs and equations, that f(f⁻¹(x)) = x and f⁻¹(f(x)) = x. Composition gives a clean test: two functions are inverses exactly when both compositions give x.
How to help: use everyday round trips (°C to °F and back, encoding and decoding). Ask: "What happens if you do it and then undo it?" Then ask for a case where undoing fails (squaring a negative number and taking the square root).
Common difficulties:
- Reading f⁻¹(x) as 1/f(x).
- Checking only one order of composition.
- Forgetting restrictions: 10^(log x) = x needs x > 0, and √(x²) = |x|.
- Expecting sin⁻¹(sin x) to always give x back.
Inverse sine and cosine (sin⁻¹, cos⁻¹) are used here only as calculator keys that return angles in [−π/2, π/2] and [0, π].