Sub topic 11
Checking an Inverse with Both Compositions
Prerequisites
Assume you know function notation, domain and range, and how to compose functions. You should also be able to solve a linear equation for a variable.
An inverse function reverses the action of a function. If f sends an input x to an output y, then f⁻¹ sends y back to x. To verify that a proposed function is truly an inverse, check both possible compositions:
f⁻¹(f(x)) = xfor everyxin the domain offf(f⁻¹(x)) = xfor everyxin the domain off⁻¹
The first composition applies f and then undoes it. The second applies f⁻¹ and then returns to the original value.
A worked example
Let
f(x) = 2x + 3f⁻¹(x) = (x - 3) / 2
Check the first composition by substituting f(x) into the inverse:
f⁻¹(f(x)) = ((2x + 3) - 3) / 2
f⁻¹(f(x)) = 2x / 2 = x
Now check the reverse composition by substituting f⁻¹(x) into f:
f(f⁻¹(x)) = 2((x - 3) / 2) + 3
f(f⁻¹(x)) = x - 3 + 3 = x
Both compositions return the identity function, whose output is its input. Therefore, the two functions are inverses.
def f(x):
return 2 * x + 3
def f_inv(x):
return (x - 3) / 2
for x in [-2, 0, 5]:
assert f_inv(f(x)) == x
assert f(f_inv(x)) == x
print(f_inv(f(5))) # 5.0The assert statements stop the program if either equality is false. Testing several values is useful, but algebraic verification is stronger because it checks all permitted inputs.
Why both checks matter
Checking only f⁻¹(f(x)) = x may not be enough when the functions have restricted domains or ranges. The two identities apply to different sets:
| Composition | Inputs come from |
|---|---|
| `f⁻¹(f(x))` | The domain of `f` |
| `f(f⁻¹(x))` | The domain of `f⁻¹`, which is the range of `f` |
For a valid inverse, each function must undo the other on its appropriate set. Always state these restrictions when a function is not defined for every real number.
The reversal diagram
A common error
The notation f⁻¹(x) means the inverse function, not the reciprocal 1 / f(x). For example, if f(x) = 2x + 3, then:
f⁻¹(x) = (x - 3) / 21 / f(x) = 1 / (2x + 3)
These expressions have different meanings and different compositions.
Exercise
Suppose f(x) = 5x - 4 and h(x) = (x + 4) / 5. How can you verify that h is the inverse of f?
Show answer
Simplify h(f(x)) = ((5x - 4) + 4) / 5 = x and f(h(x)) = 5((x + 4) / 5) - 4 = x. Since both compositions return the input, h = f⁻¹.