Sub topic 13
Restricting the Domain to Create an Inverse
This chapter assumes you can do the following:
- Use function notation.
- Read the domain and range of a function.
- Solve simple equations, including ones with squares and square roots.
- Recognize the graph of a parabola.
- Apply the horizontal line test.
- Find an inverse algebraically.
- Verify an inverse with both compositions.
Why some functions need a restriction
A function has an inverse only if it is one-to-one. That means each output comes from exactly one input. The function f(x) = x² fails this test on all real numbers. Both 3 and -3 map to 9. If an inverse existed, it would have to send 9 back to two different values, and a function cannot do that.
The fix is to throw away part of the domain until each output has only one input left. The rule stays the same, but the domain is smaller. Strictly speaking, the result is a new function. It has the same formula as the original but a different domain.
The procedure
- Graph the function or find its turning points.
- Choose an interval where the function is always increasing or always decreasing. Such a piece passes the horizontal line test.
- Write the restricted function with its domain, for example f(x) = x², x ≥ 0.
- Find the inverse algebraically, using the restriction to choose the correct sign.
- State the inverse's domain, which is the range of the restricted function.
- Verify with both compositions.
Example 1: the square function
Take f(x) = x² with the domain restricted to x ≥ 0. On this domain the function is increasing, so it is one-to-one. Its range is y ≥ 0.
Solve y = x² for x. This gives x = ±√y. Because the domain is x ≥ 0, the inputs are never negative, so we keep the positive root:
f⁻¹(x) = √x, with domain x ≥ 0 and range y ≥ 0.
If we had chosen x ≤ 0 instead, the inputs would be non-positive and we would keep the negative root. Then f⁻¹(x) = -√x, with domain x ≥ 0 and range y ≤ 0. Both restrictions are valid. They produce different inverses, so you must always state which restriction you used.
Example 2: a shifted parabola
Let f(x) = (x - 2)² + 1. The vertex is at (2, 1), and the graph turns there. Restrict the domain to x ≥ 2, the right branch. On this branch f is increasing, and its range is y ≥ 1.
Solve y = (x - 2)² + 1:
- Subtract 1: y - 1 = (x - 2)².
- Take roots: x - 2 = ±√(y - 1).
- The restriction says x ≥ 2, so x - 2 ≥ 0. Choose the plus sign: x = 2 + √(y - 1).
- Rename the variables: f⁻¹(x) = 2 + √(x - 1).
The inverse has domain x ≥ 1, which is the range of the restricted f. Its range is y ≥ 2, which is the restricted f's domain. If you had restricted to x ≤ 2, the inverse would be 2 - √(x - 1), with range y ≤ 2.
Choosing a restriction
Look for a turning point and cut there. Any interval that does not contain a turning point in its interior works.
| Function | Turning point | Common restriction | Inverse | Column | Column |
|---|---|---|---|---|---|
| x² | x = 0 | x ≥ 0 | √x | ||
| (x - h)² + k | x = h | x ≥ h | h + √(x - k) | ||
| (x - h)² + k | x = h | x ≤ h | h - √(x - k) | ||
| \ | x\ | x = 0 | x ≥ 0 | x | |
| x⁴ | x = 0 | x ≥ 0 | x^(1/4) |
By convention, the restriction that keeps the right-hand branch (x ≥ turning point) is the "default" choice. If a problem does not tell you which one to use, state your choice clearly. Trigonometric functions follow the same idea. The sine function is restricted to [-π/2, π/2] to define arcsine. Many different restrictions would work, but one is picked by convention.
Not every function needs only one cut. A function such as x³ - 3x has two turning points, so it needs a restriction to an interval between or beyond them, such as x ≥ 1.
Verifying in code
The code below implements the restricted function from Example 2 and raises an error for inputs outside its domain. It checks both compositions on sample values. It also shows what goes wrong if you apply the inverse to an input from the discarded part of the domain.
import math
def f(x):
if x < 2:
raise ValueError("f is restricted to x >= 2")
return (x - 2) ** 2 + 1
def f_inv(y):
if y < 1:
raise ValueError("f_inv is defined only for y >= 1")
return 2 + math.sqrt(y - 1)
for x in [2, 3, 5.5]:
assert math.isclose(f_inv(f(x)), x)
for y in [1, 2, 10]:
assert math.isclose(f(f_inv(y)), y)
print(f_inv(f(3))) # 3.0
# x = 0 is outside the restricted domain. Using the same formula anyway:
unrestricted = (0 - 2) ** 2 + 1 # 5
print(2 + math.sqrt(unrestricted - 1)) # 4.0, not 0.0The last line shows the failure mode. The formula gives 4.0 instead of 0, because 0 and 4 are mirror images across the vertex and both map to 5. The inverse can only return the input from the branch you kept.
Domain and range swap
For the restricted function f and its inverse:
- domain of f⁻¹ = range of f
- range of f⁻¹ = domain of f
Always compute the range of the restricted function before stating the inverse's domain. For f(x) = (x - 2)² + 1 with x ≥ 2, the range is y ≥ 1. Reading the range from the formula for the inverse, √(x - 1) requires x ≥ 1, which agrees. If the two disagree, you have made an algebra error.
On a graph, the restricted f is half of the parabola. Its inverse is that half reflected across the line y = x, which gives a sideways half-parabola opening to the right.
Common mistakes
- Writing √(x²) = x. The square root returns a non-negative number, so √(x²) = |x|. This equals x only when x ≥ 0. That is why the restriction matters: for x ≥ 0 the composition returns x, and for x < 0 it returns -x.
- Keeping ± in the inverse. An inverse is a function, so it must give one output per input. Use the restriction to pick one sign.
- Picking the sign without checking. The sign comes from the restricted domain. For x ≤ 2 you need x - 2 ≤ 0, so you take the negative root.
- Forgetting to state the restriction. Without it, "the inverse of x²" is ambiguous.
- Verifying outside the domain. Check f⁻¹(f(x)) = x only for x in the restricted domain, and f(f⁻¹(x)) = x only for x in the inverse's domain.
Exercises
Exercise
Let g(x) = (x + 1)² - 4, restricted to x ≤ -1. Find g⁻¹(x), and state its domain and range.
Show answer
Let y = (x + 1)² - 4, so y + 4 = (x + 1)². Since x ≤ -1, we have x + 1 ≤ 0, so x + 1 = -√(y + 4). Then x = -1 - √(y + 4). Rename variables: g⁻¹(x) = -1 - √(x + 4). The range of g on x ≤ -1 is y ≥ -4, so the domain of g⁻¹ is x ≥ -4. The range of g⁻¹ is y ≤ -1, the domain of g.
Exercise
Let h(x) = x² restricted to x ≤ 0. What is h⁻¹(25), and why is √(h(-5)) not the right way to get -5 back?
Show answer
On x ≤ 0 the inverse is h⁻¹(x) = -√x, so h⁻¹(25) = -5. The expression √(h(-5)) = √25 = 5, because the square root returns the non-negative root. It undoes the x ≥ 0 restriction, not the x ≤ 0 restriction. You need the negative root, -√x.