Sub topic 9
What an inverse function is
This chapter defines the inverse of a function and explains when one exists. It assumes you are comfortable with function notation such as f(x), with domain and range, and with composing two functions. The chapters that follow cover finding, verifying and graphing inverses in detail. Here the goal is to get the definition right, because most later errors come from a loose version of it.
The idea: running a function backwards
A function takes an input and produces one output. An inverse function takes that output and returns the original input. If f turns 4 into 11, the inverse of f turns 11 back into 4.
The inverse of f is written f⁻¹. The relationship is:
- If f(a) = b, then f⁻¹(b) = a.
- If f⁻¹(b) = a, then f(a) = b.
Both statements describe the same pairing, read in opposite directions. Every ordered pair (a, b) that f contains becomes the pair (b, a) in f⁻¹.
The formal definition
Let f have domain D and range R. A function g is the inverse of f when both of these hold:
- g(f(x)) = x for every x in D.
- f(g(y)) = y for every y in R.
Each condition says that composing the two functions gives the identity function on the right set. The identity function returns its input unchanged. The first condition says that g undoes f. The second says that f undoes g. Both are required.
When such a g exists, it is unique, and we call it f⁻¹. Uniqueness follows from the definition. If two functions g and h both undo f, then for any y in R we can write y = f(x) for some x, and g(y) = x = h(y). So g and h agree everywhere.
Domain and range swap
The definition forces a swap:
- The domain of f⁻¹ is the range of f.
- The range of f⁻¹ is the domain of f.
This swap is the easiest place to check your work. A function that accepts any real number may have an inverse that accepts only some of them.
| Function f | Domain of f | Range of f | Inverse f⁻¹ | Domain of f⁻¹ |
|---|---|---|---|---|
| f(x) = 2x + 3 | all reals | all reals | (y − 3) / 2 | all reals |
| f(x) = x³ | all reals | all reals | cube root of y | all reals |
| f(x) = √x | x ≥ 0 | y ≥ 0 | y² for y ≥ 0 | y ≥ 0 |
| f(x) = 1/x | x ≠ 0 | y ≠ 0 | 1/y | y ≠ 0 |
| f(x) = eˣ | all reals | y > 0 | ln y | y > 0 |
The last row shows why the swap matters. The exponential accepts every real number but only produces positive outputs. Its inverse, the natural logarithm, accepts only positive inputs.
The function 1/x is its own inverse. Applying it twice returns the original input, so f⁻¹ = f. This is unusual but legitimate.
When does an inverse exist?
An inverse exists only when no two different inputs share an output. A function with this property is called one-to-one (or injective). The horizontal line test checks it on a graph. If any horizontal line crosses the graph twice, two inputs share an output.
The reason is simple. An inverse must be a function, so each output of f must lead back to exactly one input. If f(−3) = 9 and f(3) = 9, then f⁻¹(9) would have to be both −3 and 3. A function cannot return two values for one input, so no inverse exists.
For every function, the pairs of f reversed give a relation. That relation is a function only when f is one-to-one.
The inverse is defined only on the range of f. Values outside the range are never produced by f, so f⁻¹ has nothing to send back.
A concrete model in code
A finite function can be stored as a table. Inverting the table means swapping each pair. The code below does that and refuses to continue when two inputs share an output.
def invert(table):
inverse = {}
for x, y in table.items():
if y in inverse:
raise ValueError(f"not one-to-one: {inverse[y]} and {x} both map to {y}")
inverse[y] = x
return inverse
f = {1: 5, 2: 7, 3: 9}
f_inv = invert(f)
print(f_inv) # {5: 1, 7: 2, 9: 3}
# Both conditions of the definition
for x in f:
assert f_inv[f[x]] == x
for y in f_inv:
assert f[f_inv[y]] == y
try:
invert({-3: 9, 3: 9})
except ValueError as error:
print(error) # not one-to-one: -3 and 3 both map to 9The two loops are the two conditions of the definition. The first checks f⁻¹(f(x)) = x on the domain. The second checks f(f⁻¹(y)) = y on the range. The keys of f_inv are exactly the values of f, which is the domain and range swap in code.
Why both conditions matter
For ordinary functions on whole sets, one condition often implies the other. In practice you should still verify with the correct domain in mind, because the two conditions can fail in different places.
Consider g(x) = √x and h(y) = y². Both are defined where we need them, but they are inverses only on a restricted set:
- h(g(x)) = (√x)² = x for x ≥ 0. This works on the whole domain of g.
- g(h(y)) = √(y²) = |y|. This equals y only when y ≥ 0.
So h is the inverse of g only if we say that h accepts y ≥ 0. If h is allowed to accept negative numbers, the second condition fails at y = −3, since g(h(−3)) = 3. The domain is part of the definition of the function, not an afterthought.
Common mistakes with the definition
- Treating a formula as a function without a domain. An inverse depends on the domain you chose. The same formula can be invertible on one domain and not on another.
- Skipping the one-to-one check. Swapping x and y in a formula always produces an equation. It produces a function only when the original is one-to-one.
- Forgetting the swap of domain and range. After finding f⁻¹, state its domain as the range of f. If your inverse formula accepts values that f never produces, the domain is wrong.
- Reading f⁻¹ as a reciprocal. The −1 is not an exponent here. f⁻¹(x) means the inverse function, not 1/f(x). For f(x) = 2x + 3, the inverse is (x − 3)/2, while 1/f(x) = 1/(2x + 3). These are different functions. A later chapter returns to this notation.
- Assuming every function is its own inverse or has a simple one. Some functions, such as f(x) = x + sin x, are invertible but have no formula in elementary terms. The inverse exists even when you cannot write it down.
A quick way to decide
Use this order of questions when you meet a new function.
- State the domain you are working on.
- Ask whether two different inputs can give the same output. Use the horizontal line test, or look for a symmetry such as f(−x) = f(x).
- If the answer is yes, the function has no inverse on that domain. Restrict the domain or stop.
- If the answer is no, the inverse exists. Its domain is the range of f.
Step 2 is the real work. Everything else follows from it.
Exercise
Let f(x) = 3x − 6 on all real numbers. (a) Is f one-to-one? (b) If f(4) = 6, what is f⁻¹(6)? (c) What is the domain of f⁻¹?
Show answer
(a) Yes. f is a line with slope 3, so no horizontal line crosses it twice. (b) f⁻¹(6) = 4, because f⁻¹ undoes f and f(4) = 6. (c) The domain of f⁻¹ is the range of f, which is all real numbers.
Exercise
Let f(x) = x² on all real numbers. Explain why f has no inverse on this domain, and give a restricted domain on which it does.
Show answer
f(−2) = 4 and f(2) = 4, so two inputs share one output and f⁻¹(4) would need to be both −2 and 2. That is not allowed for a function. On the restricted domain x ≥ 0, f is one-to-one and its inverse is the square root, with domain y ≥ 0.
Exercise
For f(x) = eˣ, state the domain and range of f and of f⁻¹.
Show answer
f has domain all real numbers and range y > 0. Its inverse is f⁻¹(y) = ln y, which has domain y > 0 and range all real numbers.