Sub topic 3
Checking an inverse with both compositions
This chapter assumes you know function notation, how to compose functions as (f∘g)(x) = f(g(x)), domain and range, and how to solve an equation for a variable.
Checking an inverse with both compositions
A function g is the inverse of f when both (f∘g)(x) = x and (g∘f)(x) = x hold across the relevant domain. Checking only one composition is not enough.
def f(x):
return 2 * x + 3
def f_inv(y):
return (y - 3) / 2
for x in [-2, 0, 5]:
assert f_inv(f(x)) == x
assert f(f_inv(x)) == x
print("Both compositions return x.")The graph of an inverse: reflection across y = x
Swapping x and y turns a point (a, b) on f into the point (b, a) on f⁻¹. The graph of f⁻¹ is therefore the graph of f reflected across the line y = x.
Restricting the domain to create an inverse
A function has an inverse only if it is one-to-one. The function f(x) = x² maps both 3 and −3 to 9, so it has no inverse on all real numbers. Restricting the domain to x ≥ 0 makes it one-to-one, and its inverse is √x.
The inverse of a composite: undo in reverse order
For a composite, the inverse reverses the order: (f∘g)⁻¹ = g⁻¹∘f⁻¹. To undo f(g(x)), first undo f, then undo g.
Common mistakes with inverse notation
- f⁻¹(x) means the inverse function, not 1/f(x).
- Forgetting to reverse the order when inverting a composite.
- Inverting a function that is not one-to-one without restricting its domain.
Exercise
If f(x) = 3x − 1, what is f⁻¹(x)?
Show answer
Solve y = 3x − 1 for x to get x = (y + 1)/3, so f⁻¹(x) = (x + 1)/3. Check: f(f⁻¹(x)) = 3·(x + 1)/3 − 1 = x.