Grade by Grade
D. Characteristics of Functions · Combining Functions and Modelling

Composing 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.

5f: × 3, then + 7f(x) = 3x + 722f⁻¹: − 7, then ÷ 3f⁻¹(x) = (x − 7)/35f⁻¹(f(5)) = f⁻¹(22) = (22 − 7)/3 = 5: the inverse undoes the last step first.
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.

-2-1123456-2-1123456xy(2, 4)(4, 2)y = xf(x) = 2ˣf⁻¹(x) = log₂ xInput 2 into f: output 4.Input 4 into f⁻¹: output 2.So f⁻¹(f(2)) = 2.(2, 4) and (4, 2) are mirrorimages in the line y = x.
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 example

Example 1: Verify inverses by composing

Show that f(x) = 3x − 5 and g(x) = (x + 5)/3 are inverses of each other.

  1. Compose one way: f(g(x)) = 3((x + 5)/3) − 5 = (x + 5) − 5 = x.
  2. Compose the other way: g(f(x)) = ((3x − 5) + 5)/3 = 3x/3 = x.
  3. 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 example

Example 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.

  1. f(g(x)) = [ (2x + 1)/(1 − x) − 1 ] ÷ [ (2x + 1)/(1 − x) + 2 ].
  2. Numerator: (2x + 1 − (1 − x))/(1 − x) = 3x/(1 − x). Denominator: (2x + 1 + 2(1 − x))/(1 − x) = 3/(1 − x).
  3. So f(g(x)) = (3x/(1 − x)) ÷ (3/(1 − x)) = x, for x ≠ 1.
  4. g(f(x)) = [ 2(x − 1)/(x + 2) + 1 ] ÷ [ 1 − (x − 1)/(x + 2) ] = [ (3x)/(x + 2) ] ÷ [ 3/(x + 2) ] = x, for x ≠ −2.
  5. 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 example

Example 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.

  1. (a) 10^(log 7) = 7.
  2. (b) log(10^(3.2)) = 3.2.
  3. (c) 2^(log₂ 9) = 9.
  4. (d) 81 = 3⁴, so log₃(3⁴) = 4.
  5. (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.

−3π/2−π/2π/23π/2−π/2π/2xy(5π/6, π/6)y = x
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 example

Example 4: Restricted domains in action

Evaluate (a) √((−3)²) (b) (√5)² (c) sin⁻¹(sin(π/3)) (d) sin⁻¹(sin(2π/3)) (e) cos⁻¹(cos(−π/4)).

  1. (a) √9 = 3 (not −3, because the square root is never negative).
  2. (b) 5 (√5 exists, and squaring undoes it).
  3. (c) π/3 is in [−π/2, π/2], so the answer is π/3.
  4. (d) sin(2π/3) = √3/2, and the angle in [−π/2, π/2] with that sine is π/3, not 2π/3.
  5. (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 fun

What 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 activity

Code and decode with a partner

You need: a partner, paper, a pencil and a calculator.

  1. Number the letters A = 1, B = 2, ..., Z = 26.
  2. Encode a short word (for example MAPLE: 13, 1, 16, 12, 5) with f(x) = 5x − 2. Send your partner only the coded numbers.
  3. 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).
  4. Now try a code that fails: g(x) = (x − 13)². Encode B (2) and X (24). What goes wrong when you decode?
  5. 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

1

Verify by composition that f(x) = 4x + 1 and g(x) = (x − 1)/4 are inverses.

2

f(x) = x³ − 2. Find f⁻¹(x) and check f(f⁻¹(x)) = x.

3

Simplify log(10^(x + 1)) and 10^(log(x + 1)), with restrictions.

4

If f(3) = 11, find f⁻¹(f(3)) and f(f⁻¹(11)).

5

Are f(x) = 2x + 6 and g(x) = x/2 − 6 inverses? Use composition.

6

Evaluate sin⁻¹(sin(7π/6)).

More practice: warm-up

1

f⁻¹(f(12)) = ?

2

Simplify 10^(log 25).

3

Simplify log(10⁻⁴).

4

Simplify 5^(log₅ 2).

5

Is √(x²) always equal to x?

More practice: on your own

1

Verify that f(x) = 1/(x − 3) and g(x) = 1/x + 3 are inverses, and state each domain.

2

A point (2, 9) is on the graph of a one-to-one function h. Name a point on h⁻¹ and find h(h⁻¹(9)).

3

Simplify 3^(2 log₃ x) for x > 0.

4

°F to °C: C(F) = (5/9)(F − 32). °C to °F: F(C) = 1.8C + 32. Verify F(C(F)) = F.

5

Evaluate cos⁻¹(cos(5π/3)).

Challenge

1

Find the inverse of f(x) = (2x + 3)/(x − 1) and show that f is its own inverse or not.

2

Show that f(x) = (x + 2)/(x − 1) is its own inverse by computing f(f(x)).

3

Explain why f(x) = x² + 4x has no inverse function on ℝ, choose a domain on which it does, and find the inverse there.

Check your understanding

Quiz

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))?

5.

What is √((−6)²)?

6.

Where is 10^(log x) = x true?

For parents and teachers

Big 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, π].