Sub topic 12
The graph of an inverse: reflection across y = x
This chapter assumes you can read graphs of lines, parabolas, cubics and square roots. It also assumes you know the definition of an inverse function and can find an inverse algebraically. Here the focus is geometric: what the graph of f⁻¹ looks like, why it looks that way, and how to sketch it.
Why the graph of an inverse is a mirror image
A point (a, b) lies on the graph of f exactly when f(a) = b. The inverse undoes f, so f⁻¹(b) = a. That means (b, a) lies on the graph of f⁻¹.
So every point of f's graph has a partner on f⁻¹'s graph with the coordinates swapped. This is the whole idea. The rest of the chapter works out what it implies.
Why swapping coordinates is a reflection
The line y = x runs through every point whose two coordinates are equal. Reflecting a point across this line exchanges its horizontal and vertical roles.
- The segment joining (a, b) and (b, a) has slope (a − b)/(b − a) = −1. It is perpendicular to y = x, which has slope 1.
- The midpoint of that segment is ((a + b)/2, (a + b)/2). Its coordinates are equal, so the midpoint lies on y = x.
A segment that is perpendicular to a line and bisected by it connects a point to its mirror image. So the graph of f⁻¹ is the graph of f reflected across y = x.
What changes and what stays
Swapping coordinates also swaps the roles of domain and range. The table summarizes the correspondence.
| Feature | Graph of f | Graph of f⁻¹ |
|---|---|---|
| Point | (a, b) | (b, a) |
| Domain | D | Range of f |
| Range | R | Domain of f |
| x-intercept | (c, 0) | becomes the y-intercept (0, c) |
| y-intercept | (0, d) | becomes the x-intercept (d, 0) |
| Slope of a line | m | 1/m |
| Horizontal asymptote y = k | y = k | becomes the vertical asymptote x = k |
The last row follows from the swap as well. If f levels off at y = k, then f⁻¹ shoots up or down near x = k.
For a line, the slope rule is easy to check. With f(x) = 2x + 3, the inverse is f⁻¹(x) = (x − 3)/2, which has slope 1/2. The reciprocal slope is what you get when you swap rise and run.
A worked sketch: f(x) = x³ + 1
The function f(x) = x³ + 1 is one-to-one, so it has an inverse: f⁻¹(x) = ∛(x − 1). Follow these steps to sketch f⁻¹ from f.
- Draw the line y = x lightly as a guide.
- Pick easy points on f: (−1, 0), (0, 1), (1, 2), (2, 9).
- Swap each pair: (0, −1), (1, 0), (2, 1), (9, 2).
- Plot the swapped points and connect them with a smooth curve. Keep the same overall shape as f, but turned on its side.
The graph of f rises steeply to the right. The graph of f⁻¹ rises quickly at first and then flattens, which is the shape of a cube root. The code below checks the swapped points numerically.
import math
def f(x):
return x ** 3 + 1
def f_inv(y):
t = y - 1
# real cube root that also works for negative t
return math.copysign(abs(t) ** (1 / 3), t)
for a in [-1, 0, 1, 2]:
b = f(a) # (a, b) is on the graph of f
back = round(f_inv(b), 10) # (b, back) should be on the graph of f_inv
print((a, b), "->", (b, back))
assert back == aEach printed line shows a point of f and its swapped partner, and the assertions confirm that the partner lies on f⁻¹.
Points on the mirror line
A point that lies on y = x is its own reflection. If the graph of f meets the line y = x at (c, c), then f(c) = c, and f⁻¹(c) = c as well. So the graphs of f and f⁻¹ cross at that point.
For f(x) = 2x + 3, solve 2x + 3 = x to get x = −3. Both f and f⁻¹ pass through (−3, −3). You can check the inverse: f⁻¹(−3) = (−3 − 3)/2 = −3.
The graphs of f and f⁻¹ can also meet away from the line y = x, for example when f is a decreasing function. If f is increasing, any intersection of the two graphs lies on y = x. Do not assume this rule for decreasing functions.
Why the horizontal line test matters here
The horizontal line test says a function is one-to-one if no horizontal line meets its graph twice. Reflection explains why this test is the right one.
A horizontal line y = k reflects to the vertical line x = k. If a horizontal line hits the graph of f twice, then the reflected graph is hit twice by a vertical line. The reflected curve then fails the vertical line test, so it is not the graph of a function.
The next snippet shows this for f(x) = x² on the points x = −2, …, 2.
pts = [(x, x ** 2) for x in range(-2, 3)]
reflected = [(y, x) for x, y in pts]
print(reflected)
# [(4, -2), (1, -1), (0, 0), (1, 1), (4, 2)]The reflected list contains (4, −2) and (4, 2). The input 4 would need two different outputs, so the reflection is not a function.
Restricting the domain and what it does to the picture
The fix is to keep only one half of the original graph. For f(x) = x² with x ≥ 0, the graph is the right half of the parabola. It is one-to-one, with domain [0, ∞) and range [0, ∞).
Reflecting it across y = x gives the graph of √x. The two graphs are mirror images, each lying in the first quadrant.
If you restrict to x ≤ 0 instead, the left half of the parabola is one-to-one. Its inverse is −√x, with domain [0, ∞) and range (−∞, 0]. The reflection lands in the fourth quadrant. Different restrictions give different inverses, so state which restriction you chose.
Sketching an inverse from a graph: a checklist
When you are given the graph of f and asked to sketch f⁻¹, work in this order.
- Confirm that f is one-to-one by applying the horizontal line test. If it fails, restrict the domain and say how.
- Draw the line y = x.
- Mark key points: intercepts, endpoints, turning points that remain after the restriction, and any points on y = x.
- Swap the coordinates of each key point.
- Transfer asymptotes: a horizontal asymptote becomes vertical, and a vertical one becomes horizontal.
- Connect the points, keeping the curve's direction. An increasing f gives an increasing f⁻¹. A decreasing f gives a decreasing f⁻¹.
- Check that your sketch looks like a mirror image: each point and its partner should be the same distance from the line y = x.
Endpoints deserve extra care. If f has a closed endpoint at (1, 0), the inverse has a closed endpoint at (0, 1). An open endpoint stays open.
Common errors
- Reflecting across the wrong axis. Reflecting across the x-axis or y-axis gives −f(x) or f(−x). Those are not inverses.
- Mislabeling axes. After reflecting, the horizontal axis of the new graph is still labeled x. Do not relabel it. The input of f⁻¹ is the old output of f.
- Ignoring the domain. The graph of f⁻¹ covers only the range of f. A sketch that extends beyond it is wrong.
- Treating the reflection as a rotation. Rotating the picture by 90° does not give the inverse. A rotation does not swap coordinates, and rotating by 90° instead gives (−y, x).
Exercises
Exercise
The function f(x) = √(x − 1) has domain x ≥ 1. The points (1, 0), (2, 1) and (5, 2) lie on its graph. Give the corresponding points on the graph of f⁻¹, then find f⁻¹(x) and its domain.
Show answer
Swap each pair: (0, 1), (1, 2) and (2, 5). To find the formula, set y = √(x − 1), swap to x = √(y − 1), square both sides to get x² = y − 1, so f⁻¹(x) = x² + 1. The domain of f⁻¹ is the range of f, which is x ≥ 0. Check: f⁻¹(0) = 1, f⁻¹(1) = 2, f⁻¹(2) = 5, which matches the swapped points.
Exercise
The graph of a one-to-one function f passes through (3, 7), and the graph of f⁻¹ passes through (−2, 4). What are f(3) and f(4)? What are the coordinates of the matching point on f⁻¹ for (3, 7)?
Show answer
From (3, 7) on f, f(3) = 7, and the matching point on f⁻¹ is (7, 3). From (−2, 4) on f⁻¹, the swapped point (4, −2) lies on f, so f(4) = −2.
Exercise
Find where the graphs of f(x) = 2x + 3 and f⁻¹(x) = (x − 3)/2 intersect, and explain why the point lies on y = x.
Show answer
Solve 2x + 3 = x to get x = −3, so the point is (−3, −3). Because f(−3) = −3, the point (−3, −3) equals its own swap, which means it lies on y = x. It therefore belongs to both graphs.