Graphs of Inverse Functions Advanced. This lesson goes beyond core Algebra I. You can skip it.

Learning goals

  • Reflect a graph across y=xy = x by swapping the coordinates of any point you can read off
  • Trade domain for range when the axes swap
  • Turn the horizontal line test into the vertical one by reflecting
  • Restrict to a one-to-one branch before inverting y=x2y = x^2

The swap of coordinates is a reflection

Recall the one idea the whole inverse rests on: f−1f^{-1} reverses ff by swapping each input with its output. Suppose f(1)=4f(1) = 4. Then f−1(4)=1f^{-1}(4) = 1: the point (1,4)(1, 4) on the graph of ff becomes the point (4,1)(4, 1) on the graph of f−1f^{-1}, its coordinates swapped. Plot both points and something jumps out: they sit on opposite sides of the diagonal y=xy = x, the line through the origin at forty-five degrees, like mirror images.

Swapping coordinates reflects a point across y = xThe points (1, 4) and (4, 1) on opposite sides of the line y = x, joined by a segment whose midpoint lies on the line.xy1414y = x(1, 4)(4, 1)
Swapping the coordinates of a point reflects it across the dashed line y = x. The point (1, 4) and its swap (4, 1) sit the same distance from the line on opposite sides, and the segment joining them is cut in half at a right angle by y = x, which is exactly what it means for the line to be their mirror.

The diagram shows why: (1,4)(1, 4) and (4,1)(4, 1) sit exactly the same distance from the line y=xy = x, the set of points whose two coordinates are equal, on opposite sides, and the segment joining them meets the diagonal at a right angle. That is exactly what it means for y=xy = x to be the mirror between a point and its coordinate-swap.

The same swap happens at every point, not just this one. A point (a,b)(a, b) on the graph of ff records the fact that the input aa produces the output bb, that is, b=f(a)b = f(a). Applying f−1f^{-1} to both sides gives f−1(b)=af^{-1}(b) = a, which says the point (b,a)(b, a) is on the graph of f−1f^{-1}. So a point is on the graph of ff exactly when its coordinate-swap is on the graph of f−1f^{-1}.

By the same reasoning as the picture above, a line through the midpoint of a segment that meets it at a right angle is that segment’s mirror, so y=xy = x is always the mirror between (a,b)(a, b) and (b,a)(b, a). A point already on the diagonal has a=ba = b, so its swap is itself and it does not move.

The graph of an inverse is the mirror image across y = x

Put the two halves together. Every point (a,b)(a, b) on the graph of ff corresponds to the point (b,a)(b, a) on the graph of f−1f^{-1}. Moving from (a,b)(a, b) to (b,a)(b, a) is a reflection across the line y=xy = x. Apply that reflection to every point at once, and the entire graph of ff is carried onto the entire graph of f−1f^{-1}. This is the central fact of the lesson.

The graph of f−1f^{-1} is the reflection of the graph of ff across the line y=xy = x.

Nothing about the reflection depends on having a formula for ff: if you can draw ff, you can draw its reflection by hand, no algebra needed. This works whenever f−1f^{-1} already exists, that is, whenever ff is one-to-one. (A later section shows what goes wrong, and how to fix it, when ff is not one-to-one.)

A line and its inverse reflected across y = xThe line y = 2x minus 1 and its inverse y = (x plus 1) over 2, mirror images across y = x, with the point (2, 3) reflecting to (3, 2).xy24-224-2y = x(2, 3)(3, 2)y = f(x)y = f-1(x)
The line y = f(x) with slope 2 (dark) and its inverse (blue) with slope one half are mirror images across the dashed line y = x. The point (2, 3) on f reflects to (3, 2) on the inverse, and the short dashed segment joining them meets y = x at a right angle. Reading the inverse is reading f with the two coordinates swapped.

The figure shows it for a line. The function f(x)=2x−1f(x) = 2x - 1 has a steep graph of slope 22; its inverse f−1(x)=x+12f^{-1}(x) = \dfrac{x + 1}{2} has the gentle graph of slope 12\tfrac{1}{2}. The two lines are mirror images across the dashed diagonal. The point (2,3)(2, 3) sits on ff because f(2)=2(2)−1=3f(2) = 2(2) - 1 = 3, and its reflection (3,2)(3, 2) sits on f−1f^{-1} because f−1(3)=3+12=2f^{-1}(3) = \dfrac{3 + 1}{2} = 2.

Worked example 1 Sketch the inverse of a line from its graph

The graph of f(x)=2x+2f(x) = 2x + 2 is a line through (−1,0)(-1, 0), (0,2)(0, 2), and (1,4)(1, 4). Sketch the graph of f−1f^{-1} without first finding a formula for it.

By the reflection rule, each point of ff reflects across y=xy = x to a point of f−1f^{-1} with its coordinates swapped. Swap the coordinates of the three known points:

(−1,0)→(0,−1),(0,2)→(2,0),(1,4)→(4,1).(-1, 0) \to (0, -1), \qquad (0, 2) \to (2, 0), \qquad (1, 4) \to (4, 1).

Plot (0,−1)(0, -1), (2,0)(2, 0), and (4,1)(4, 1) and draw the line through them. That line is the graph of f−1f^{-1}, the mirror image of ff across the diagonal.

As a check, find the formula the algebraic way: from y=2x+2y = 2x + 2, swap to x=2y+2x = 2y + 2, and solve for y=x−22y = \dfrac{x - 2}{2}. Then

f−1(0)=−22=−1,f−1(2)=0,f−1(4)=1,f^{-1}(0) = \frac{-2}{2} = -1, \qquad f^{-1}(2) = 0, \qquad f^{-1}(4) = 1,

which are exactly the three reflected points. The graph and the formula agree.

Reading an inverse straight off a graph

The reflection rule turns graphing an inverse into a mechanical task: take points you can read off ff and swap each one’s coordinates. You never need the formula for f−1f^{-1}, and often you never even need the formula for ff. That is what makes the graphical view so useful. As long as it is one-to-one, a function given only by a curve, with no equation at all, still has an inverse you can plot point by point.

A curve given only by its graph, reflected across y = xThe curve g through (-2, -3), (0, 1), (1, 3), (3, 4) and its reflection g inverse through (-3, -2), (1, 0), (3, 1), (4, 3), mirror images across y = x.xyy = x(-2, -3)(0, 1)(1, 3)(3, 4)(-3, -2)(1, 0)(3, 1)(4, 3)y = g(x)y = g-1(x)
The curve y = g(x) (dark), given only by its graph, rises through (-2, -3), (0, 1), (1, 3), and (3, 4). It passes the horizontal line test, so reflecting it across the dashed line y = x gives the curve y = g inverse of x (blue) through the coordinate-swapped points (-3, -2), (1, 0), (3, 1), and (4, 3).

Worked example 2 Read four points of an inverse off a graph

The graph above shows a function gg given only by its curve, no formula, passing through (−2,−3)(-2, -3), (0,1)(0, 1), (1,3)(1, 3), and (3,4)(3, 4). The curve rises steadily from left to right, so it passes the horizontal line test and has an inverse. Find four points on the graph of g−1g^{-1}.

Swap the coordinates of each known point, since g−1g^{-1} is the reflection of gg across y=xy = x:

(−2,−3)→(−3,−2),(0,1)→(1,0),(1,3)→(3,1),(3,4)→(4,3).(-2, -3) \to (-3, -2), \quad (0, 1) \to (1, 0), \quad (1, 3) \to (3, 1), \quad (3, 4) \to (4, 3).

So g−1g^{-1} passes through (−3,−2)(-3, -2), (1,0)(1, 0), (3,1)(3, 1), and (4,3)(4, 3). Each new point is the mirror of an old one. For instance, g(1)=3g(1) = 3 becomes g−1(3)=1g^{-1}(3) = 1: the input and output trade roles, and no formula was needed anywhere.

Check your understanding

ff is one-to-one, and the point (−4,7)(-4, 7) lies on its graph. Which point must lie on the graph of f−1f^{-1}?

Answer choices

Domain and range trade places by swapping the axes

The reflection also explains, in a single picture, why the domain and range swap when you invert. Reflecting across y=xy = x does more than move the curve. It swaps the two axes themselves: the horizontal axis (every point (t,0)(t, 0)) reflects to the vertical axis (every point (0,t)(0, t)), and the reverse. So a horizontal extent of a graph becomes a vertical extent after the flip, and a vertical extent becomes horizontal.

Now recall how a graph shows domain and range. The domain is the horizontal spread of the curve, read along the xx-axis; the range is its vertical spread, read along the yy-axis. When the graph of ff reflects to the graph of f−1f^{-1}, its horizontal spread becomes the new curve’s vertical spread. Likewise the vertical spread of ff becomes the new curve’s horizontal spread. In other words,

This is exactly the domain-range swap you proved algebraically for inverses, now visible as the geometric fact that reflecting across y=xy = x trades the two axes.

Worked example 3 Track the domain and range through the reflection

The function f(x)=x+1f(x) = \sqrt{x} + 1 has domain x≥0x \ge 0 (the square root needs a nonnegative input) and range y≥1y \ge 1 (the smallest output is 0+1=1\sqrt{0} + 1 = 1). Find the domain and range of f−1f^{-1} from the reflection.

Reflecting across y=xy = x swaps the horizontal and vertical spreads, so the domain and range trade:

domain of f−1=range of f,range of f−1=domain of f.\text{domain of } f^{-1} = \text{range of } f, \qquad \text{range of } f^{-1} = \text{domain of } f.

The range of ff was y≥1y \ge 1, so the domain of f−1f^{-1} is x≥1x \ge 1. The domain of ff was x≥0x \ge 0, so the range of f−1f^{-1} is y≥0y \ge 0.

A check against the formula agrees: from y=x+1y = \sqrt{x} + 1, swap to x=y+1x = \sqrt{y} + 1, so y=x−1\sqrt{y} = x - 1 and y=(x−1)2y = (x - 1)^2 for x≥1x \ge 1. That inverse accepts only x≥1x \ge 1 and returns values y≥0y \ge 0, matching the swapped domain and range.

Check your understanding

A one-to-one function hh has domain 2≤x≤82 \le x \le 8 and range −1≤y≤5-1 \le y \le 5. What are the domain and range of h−1h^{-1}?

Answer choices

Fixed points stay on the mirror

A point that already lies on the line y=xy = x has equal coordinates, (c,c)(c, c), so swapping them changes nothing: its reflection is itself, a fixed point of the reflection. So if f(c)=cf(c) = c for some input cc, meaning (c,c)(c, c) is on the graph of ff, then (c,c)(c, c) stays put under the reflection and lands on the graph of f−1f^{-1} too, giving f−1(c)=cf^{-1}(c) = c: a value the function leaves unchanged is left unchanged by the inverse as well. This is a handy sketching shortcut: wherever the graph of ff meets the diagonal y=xy = x, mark that point, since it is shared with f−1f^{-1} and does not move when you reflect.

The horizontal line test becomes the vertical line test

Back in the Inverse Functions lesson you saw that a function has an inverse only when it is one-to-one. On a graph that condition is the horizontal line test: no horizontal line may cross the graph more than once. The reflection across y=xy = x shows why that is exactly the right test.

Reflecting across the diagonal turns a horizontal line into a vertical line. A horizontal line y=cy = c is the set of points at height cc; swapping coordinates sends each point (t,c)(t, c) to (c,t)(c, t), and those make up the vertical line x=cx = c. So horizontal lines and vertical lines are mirror images of each other across y=xy = x.

Now watch what that does to the two line tests. Suppose some horizontal line crosses the graph of ff twice, so ff fails the horizontal line test and is not one-to-one. Reflect the whole picture anyway. The reflected curve is the mirror image of ff‘s graph, and the offending horizontal line becomes a vertical line that crosses that reflected curve twice. A curve that some vertical line meets twice is not the graph of a function, by the vertical line test. So when ff fails the horizontal line test, its reflection fails the vertical line test and is not the graph of any function, meaning ff has no inverse function at all. The reflection is a function, namely f−1f^{-1}, exactly when ff passed the horizontal line test to begin with. The two tests are mirror images, which is why one-to-one is precisely the condition for an inverse function to exist.

The reflection of y = x squared fails the vertical line testThe upward parabola y = x squared and its reflection x = y squared across y = x; a horizontal line crosses the parabola twice and the mirror vertical line crosses the reflection twice.xy1212y = xy = 2x = 2y = x²x = y²
Why a function that fails the horizontal line test has no inverse graph. The solid curve y = x squared (dark) and its reflection across the dashed line y = x (blue) are mirror images. The horizontal line y = 2 crosses the parabola at two points, so the parabola fails the horizontal line test. Its mirror image, the vertical line x = 2, crosses the reflected curve at the two mirror points, so the reflection fails the vertical line test and is not the graph of a function.

Worked example 4 Which reflections are graphs of functions?

Compare f(x)=x3f(x) = x^3 and g(x)=x2g(x) = x^2, both reflected across y=xy = x.

The cube f(x)=x3f(x) = x^3 always rises: as xx increases, x3x^3 increases, so every horizontal line meets its graph exactly once and ff is one-to-one. Reflecting its graph across y=xy = x gives a curve that every vertical line meets exactly once. So that reflection is the graph of a genuine function, the inverse (the cube-root curve y=x3y = \sqrt[3]{x}). No restriction is needed.

The square g(x)=x2g(x) = x^2 is different. The horizontal line y=4y = 4 meets its graph twice, at (−2,4)(-2, 4) and (2,4)(2, 4), because

(−2)2=22=4.(-2)^2 = 2^2 = 4.

Reflecting, those two points become (4,−2)(4, -2) and (4,2)(4, 2), both on the reflected curve, so the vertical line x=4x = 4 meets the reflection twice. The reflected sideways parabola is not the graph of a function, which is the picture of the fact that x2x^2 on all inputs has no inverse. The next section repairs it.

Check your understanding

The graph of a function pp is reflected across the line y=xy = x. The reflection is itself the graph of a function exactly when pp...

Answer choices

Graphing the inverse of a restricted function

When a function fails the horizontal line test, you cannot reflect its whole graph and get a function. The fix from the Inverse Functions lesson was to shrink the domain until the rule is one-to-one, then invert that piece. Graphically, that means reflecting only the surviving branch.

Take f(x)=x2f(x) = x^2 again, and restrict it to x≥0x \ge 0. The graph is now just the right half of the parabola, the branch in the first quadrant. That branch passes the horizontal line test: each height is reached by a single nonnegative input. Reflect that single branch across y=xy = x. Because the branch lives in the first quadrant, its reflection also lives in the first quadrant, and it is the graph of y=xy = \sqrt{x}. Restricting first, then reflecting, produces the square-root curve, exactly the inverse you found by algebra.

The right branch of y = x squared reflects to y = square root of xThe branch of y = x squared for x at least 0 and its reflection y = square root of x across the line y = x, with (2, 4) reflecting to (4, 2).xy12341234y = x(2, 4)(4, 2)y = x²y = √x
Reflecting one branch of a parabola gives a square root. Restricting y = x squared to inputs x greater than or equal to 0 keeps only the right branch (dark), which passes the horizontal line test. Reflecting that branch across the dashed line y = x gives the solid blue curve y = square root of x, the inverse. The point (2, 4) on the parabola reflects to (4, 2) on the square root.

Worked example 5 Graph the inverse of f(x)=x2f(x) = x^2 on x≥0x \ge 0

With the domain restricted to x≥0x \ge 0, plot a few points on the branch and swap coordinates. Three easy points on y=x2y = x^2 with x≥0x \ge 0 are

(0,0),(1,1),(2,4).(0, 0), \qquad (1, 1), \qquad (2, 4).

Reflect each across y=xy = x by swapping coordinates:

(0,0)→(0,0),(1,1)→(1,1),(2,4)→(4,2).(0, 0) \to (0, 0), \qquad (1, 1) \to (1, 1), \qquad (2, 4) \to (4, 2).

The points (0,0)(0, 0) and (1,1)(1, 1) sit on the diagonal, so they are fixed and do not move, while (2,4)(2, 4) reflects to (4,2)(4, 2). These three points are anchors, but by themselves they do not pin down the curve: many different curves pass through the same three points. What determines the shape is reflecting the entire right branch, not just a few points on it. Mirror the whole branch across y=xy = x and it lands on the square-root curve, rising steeply at first and then flattening. The reflection of the restricted parabola is the square-root graph, so f−1(x)=xf^{-1}(x) = \sqrt{x}, matching the algebra where x=y2x = y^2 with y≥0y \ge 0 solves to y=xy = \sqrt{x}.

Had you tried to reflect the entire parabola instead, the left branch would have reflected to the lower half of a sideways parabola. The reflection of the whole parabola would fail the vertical line test. Restricting to one branch is what keeps the reflection a function.

Check your understanding

j(x)=x2j(x) = x^2 restricted to x≥0x \ge 0 is the right branch of the parabola, passing through (0,0)(0, 0), (1,1)(1, 1), and (3,9)(3, 9). Which curve is the graph of j−1j^{-1}?

Answer choices

Common mistakes

Practice

Multiple Choice Questions (MCQ)

Progressively harder sets of questions. Each opens on its own page.

Core practice

Practice problems at the level of the course, to be worked out on paper. Hints one at a time, then the answer or the full worked solution, with your progress kept in this browser.

Core practice Work it out on paper 10 problems Start →
More practice (optional)

Extra sets, as hard as the Challenge set. Each one opens on its own page.

More resources (optional)

Other explanations of this lesson, if you want a second take.

Go deeper (optional)

You can skip this and keep going. Read it if you want to know more.

Why swapping coordinates is a reflection across y = x

Swapping coordinates reflects a point across y=xy = x#

Take a point P=(a,b)P = (a, b) with a≠ba \ne b, so PP is not on the diagonal, and let Q=(b,a)Q = (b, a) be its coordinate-swap. To show the line y=xy = x is the mirror that sends PP to QQ, it is enough to show that line is the perpendicular bisector of the segment PQPQ. The perpendicular bisector is the line that meets PQPQ at a right angle through its midpoint.

First, the midpoint of PQPQ is

(a+b2, a+b2),\left( \frac{a + b}{2},\ \frac{a + b}{2} \right),

whose two coordinates are equal, so the midpoint lies on y=xy = x.

Second, the segment PQPQ runs from (a,b)(a, b) to (b,a)(b, a), so its slope is

a−bb−a=−1,\frac{a - b}{b - a} = -1,

while the line y=xy = x has slope 11. Two slopes whose product is −1-1 mark perpendicular lines, and (1)(−1)=−1(1)(-1) = -1, so PQPQ crosses y=xy = x at a right angle.

The diagonal passes through the midpoint of PQPQ and is perpendicular to it, so it is the perpendicular bisector of PQPQ. Reflecting PP across y=xy = x therefore lands exactly on QQ. A point already on the diagonal has a=ba = b, so its swap (b,a)=(a,b)(b, a) = (a, b) is itself and it does not move. Either way, switching the coordinates of a point is the same as reflecting it across y=xy = x.

A bit of history (optional)

A secret message is worth nothing if the person waiting for it cannot get the message back out again. Every code has to carry its own undoing.

Around 1467 Leon Battista Alberti, an Italian architect and scholar, built a tidy device for the job. He cut two metal disks, one slightly smaller, and pinned them together at the center. The outer ring carried the plain letters and the inner ring carried the code letters. Set the rings once, and each plain letter sits against exactly one code letter.

Now watch what the receiver does. No second device is needed. The same pairing is simply read from the inner ring outward, rather than from the outer ring inward. One object, two directions of reading. The disk also shows why no two plain letters may ever share a code letter. A reader who arrived at that letter would have no way to choose between them.

Both of those facts are this lesson in other clothing. Swapping the two coordinates of every point reads one pairing from the opposite side, and that swap is exactly the reflection across y=xy = x. A curve that some horizontal line meets twice is a disk with two letters stamped on one mark. Reflect it and the vertical line test fails, which is why only a one-to-one function earns an inverse.