Finding an inverse function
An inverse function undoes what a function did. If f sends 3 to 11, its inverse sends 11 back to 3. The method is the same each time: set y equal to f(x), exchange the two letters, isolate y, then confirm by composing. It works only for a one-to-one function, where each answer has a single source input and no two inputs share an answer. Test for that with the horizontal line test on a graph, or with the algebraic test that f(a) = f(b) forces a = b.
For students and parents planning test prep or coursework: one hour with George Li, one to one by video, is $180, $200 or $160, by subject. You leave with a written plan within one working day.
Book your first sessionFind the inverse of g(x) = (2x + 1) / (x - 3), where x is not 3, then check it by composing.
- Replace g(x) with y: y = (2x + 1) / (x - 3).
- Swap x and y: x = (2y + 1) / (y - 3).
- Clear the fraction: x(y - 3) = 2y + 1, so xy - 3x = 2y + 1.
- Collect the y terms on one side: xy - 2y = 3x + 1, so y(x - 2) = 3x + 1.
- Solve for y: y = (3x + 1) / (x - 2). So the inverse is h(x) = (3x + 1) / (x - 2), with x not 2.
- Check by composing: g(h(x)) = (2(3x + 1)/(x - 2) + 1) / ((3x + 1)/(x - 2) - 3). Multiply the top and bottom by x - 2 to get (6x + 2 + x - 2) / (3x + 1 - 3x + 6), which is 7x / 7, which is x.
Answer g inverse is h(x) = (3x + 1) / (x - 2). The domain of g is all x except 3 and its range is all y except 2, and the inverse swaps those two sets.
Original problem by George Li Tutoring; steps as in OpenStax, Precalculus 2e
What does an inverse function do?
Picture a function as a recipe and its inverse as the same recipe run backwards. Take f(x) = 3x - 6. It multiplies by 3 and then subtracts 6. To reverse that, undo the last step first and the first step last: add 6, then divide by 3. The inverse is f inverse of x = (x + 6) / 3. Like unpacking a suitcase in the opposite order from how you packed it, the order of the undoing is reversed.
Three facts follow from that picture:
- Whatever pair (a, b) belongs to f is a pair (b, a) for the inverse, so what was an input becomes an output, and the reverse.
- The inputs f allows turn into the outputs of the inverse, and the outputs of f turn into the inverse's inputs.
- The little -1 in the inverse's name does not mean a power. The inverse is not the reciprocal, so for f(x) = 2x the inverse is x / 2, while the reciprocal is 1 / (2x).
What is a one-to-one function?
Different inputs never share an output. As a rule: whenever f(a) = f(b), the two inputs must match, so a = b.
A line such as f(x) = 3x - 7 is one-to-one, because 3a - 7 = 3b - 7 can only happen when a = b. A parabola such as f(x) = x^2 is not, because f(2) and f(-2) are both 4. The word "function" already promises one output for each input. "One-to-one" adds the reverse promise: one input for each output.
What are the horizontal line test and the algebraic test?
The horizontal line test is a picture check. Draw any horizontal line across the graph. If some horizontal line hits the graph twice or more, two inputs share an output and the function fails. If every horizontal line hits it at most once, the function passes.
The algebraic test is for when you have a formula and no graph. Assume f(a) = f(b) and try to prove a = b. Here is the test run on a restricted parabola, f(x) = x^2 + 4x with x at least -2:
- Set a^2 + 4a = b^2 + 4b and move everything to one side: a^2 - b^2 + 4a - 4b = 0.
- Factor: (a - b)(a + b + 4) = 0, so either a = b or a + b = -4.
- Because both a and b are at least -2, a + b is at least -4, and it equals -4 only when a = b = -2. So a = b is the only possibility.
That proves the restricted function is one-to-one. The same formula without the restriction fails, because a = 0 and b = -4 both give 0.
| Function | One-to-one? | Reason |
|---|---|---|
| f(x) = 3x - 7 | Yes | Every line that is not horizontal passes the test |
| f(x) = x^2 | No | f(2) = f(-2) = 4 |
| f(x) = x^3 | Yes | Cubes never repeat an output |
| f(x) = x^2 + 4x, x at least -2 | Yes | Restricting the domain removes the repeats |
| f(x) = 1 / x, x not 0 | Yes | Different inputs give different reciprocals |
Why must a function repeat no outputs to have an inverse?
The inverse takes an output and returns the input that produced it. If two inputs produced the same output, the inverse would have to return both, and a function may return only one value.
Take f(x) = x^2. The output 4 came from 2 and from -2, so there is no single answer for "what input gave 4?" The fix is to cut the domain down to a piece that does pass the test. Restrict to x at least 0 and the inverse is the square root. Restrict to x at most 0 and the inverse is the negative square root. The choice of piece is part of the answer, and the inverse always inherits the restriction.
Draw the inverse by reflecting the original graph in the diagonal y = x: a point (a, b) lands on (b, a). That symmetry is a quick way to sanity-check a sketch. A line with slope 2 reflects to a line with slope one half, and a curve that rises steeply reflects to one that levels off. Swapping coordinates is exactly the algebraic swap of x and y, which is why the method works.
How do you find an inverse step by step?
Follow the same five steps every time: write y, exchange x with y, isolate y, rename it, then adjust for any domain restriction. The worked example above runs them on a rational function. Different families need different solving moves once the letters are swapped.
| Kind of function | Example | Key move after swapping | Inverse |
|---|---|---|---|
| Linear | 3x + 7 | Subtract the constant, then divide | (x - 7) / 3 |
| Rational | (2x + 1) / (x - 3) | Clear the fraction, gather the y terms, factor out y | (3x + 1) / (x - 2) |
| Cube root | cube root of (x - 4) | Cube both sides | x^3 + 4 |
| Square root | square root of (x - 4) | Square both sides | x^2 + 4, for x at least 0 |
| Restricted quadratic | x^2, x at least 0 | Take the positive root | square root of x |
| Exponential | 2^x | Take a base 2 logarithm | log base 2 of x |
| Logarithmic | ln(x - 1) | Raise e to both sides | e^x + 1 |
Exponentials and logarithms are the main inverse pair to know. Take f(x) = 4 times 3^(x - 2) + 1. Swap to get x = 4 times 3^(y - 2) + 1, then subtract 1 and divide by 4 to isolate the power: (x - 1) / 4 = 3^(y - 2). A base 3 logarithm of both sides gives y - 2 = log base 3 of ((x - 1) / 4), so y = 2 + log base 3 of ((x - 1) / 4). The range of f is y above 1, so the inverse is defined for x above 1.
Here are the five steps on the restricted parabola. Start with y = x^2 + 4x and complete the square: y = (x + 2)^2 - 4. Swap: x = (y + 2)^2 - 4. Solve: (y + 2)^2 = x + 4. Because the original domain was x at least -2, the inverse's outputs must also be at least -2, so y + 2 is the positive square root and y = -2 + the square root of (x + 4). The inverse's domain is x at least -4, which is the range of the original.
A few functions are their own inverse. The function 1 / x is one, and so is any f for which swapping x and y returns the same equation. Their graphs match their own mirror image in the diagonal y = x.
How do you verify an inverse?
Compose in both orders. When f(h(x)) and h(f(x)) both simplify to x, on domains that fit each function, the check is finished. Checking both orders also catches a domain restriction you forgot to carry over.
The reason for both orders shows up with f(x) = x^2 and h(x) = the square root of x on all real numbers. Then f(h(x)) = x for x at least 0, which looks fine, but h(f(x)) = the square root of x^2, which is |x| and not x for negative inputs. One order passing is not enough.
Worked example: Find and verify an inverse that comes from reversing operations. Let f(x) = 4x + 3.
- Write y = 4x + 3, then swap: x = 4y + 3.
- Subtract 3 from both sides, then divide by 4. That isolates y as (x - 3) / 4, so the inverse is (x - 3) / 4.
- Compose one way: f of (x - 3)/4 is 4 times (x - 3)/4, plus 3, which is x.
- Compose the other way: the inverse of 4x + 3 is (4x + 3 - 3) / 4, which is x.
Answer: the inverse is (x - 3) / 4, confirmed in both orders.
Method: swap-and-solve with composition; the function is an original example.
How do you differentiate an inverse?
In calculus you often need the slope of an inverse without solving for it. Take a function that never repeats an output, with f(a) = b. Its inverse has slope 1 divided by the slope of f at a, written (f inverse)'(b) = 1 / f'(a). The slopes are reciprocals because the reflection across y = x flips rise and run.
Take f(x) = 2x^3 + x. Since f(2) = 16 + 2 = 18, the point (2, 18) is on the graph, so the inverse sends 18 back to 2. The slope of f is f'(x) = 6x^2 + 1, which is 25 at x = 2. Then (f inverse)'(18) = 1/25. Notice that you never solved a cubic for x. You only had to find an input that gives 18, and a short guess and check finds it. The same rule gives the derivative of ln x from the derivative of e^x, and the derivatives of inverse trigonometric functions from their trigonometric partners.
Which mistakes come up most?
| Mistake | Why it happens | Fix |
|---|---|---|
| Reading f inverse of x as 1 / f(x) | The -1 looks like an exponent | The notation names the inverse function; the reciprocal is written 1 / f(x) |
| Swapping only one occurrence of x | In long formulas an x gets missed | Replace every x with y and every y with x |
| Skipping the domain | The formula stays defined where the inverse should not | State the range of f and use it as the domain of the inverse |
| Checking one composition | The first check passes and feels enough | Compose in both orders |
| Inverting a function that repeats outputs | The formula looks invertible | Restrict the domain first |
Practice, all original to George Li Tutoring:
- Invert f(x) = 5 - 2x.
- Is f(x) = |x - 1| one-to-one? If not, restrict it to a piece that is and find that piece's inverse.
- Invert f(x) = (x + 4) / (3x - 1).
- Invert f(x) = cube root of (2x + 1), and state its domain.
- If f(x) = x^3 + 3x, find the slope of the inverse at x = 4.
Answers: 1) f inverse is (5 - x) / 2. 2) No, since f(0) = f(2) = 1. On x at least 1, f(x) = x - 1 and the inverse is x + 1 for x at least 0. 3) Swapping and solving returns the same formula, (x + 4) / (3x - 1), so this function undoes itself. 4) Swap to get x = cube root of (2y + 1), cube both sides to get x^3 = 2y + 1, and solve: the inverse is (x^3 - 1) / 2, defined for all real x. 5) f(1) = 4, so a = 1. f'(x) = 3x^2 + 3, which is 6 at x = 1, so the inverse's slope at 4 is 1/6.
Inverses also feed into the next topic in this strand, slant asymptotes, and into average rate of change. If you want help with this in a course, see college calculus tutoring. If you are weighing it for exam prep, the math tutoring page shows how sessions work, and the study planner turns weeks and weekly hours into a schedule. We teach the method and do not complete graded work.
Common questions
Which one-to-one check is fastest?
On a graph, slide a horizontal ruler up and down. If it never touches the curve twice, no output repeats. With only a formula, assume f(a) = f(b) and see whether a = b is forced.
Is every strictly increasing function one-to-one?
Yes. If a function only goes up, or only goes down, with no flat stretches, it never repeats an output, so it passes the test. The reverse is not true: 1 / x is one-to-one, yet it is not decreasing across its whole domain, because the break at 0 separates two pieces.
Why does the inverse of a function have to be restricted sometimes?
Because a function that repeats outputs cannot be undone. Cutting the domain to a piece with no repeats makes the inverse a function, and the inverse's own domain is the range of that piece.
Is the inverse the same as the reciprocal?
No. The inverse function undoes the function, so f inverse of f(x) is x. The reciprocal is 1 divided by f(x). They share the exponent -1 in notation, and that is the only link.
How do you find the inverse of a function from its graph?
Mirror the curve in the diagonal y = x. Each point (a, b) lands on (b, a), and the mirrored curve is the inverse's graph as long as the original never repeats an output.
Sources
- OpenStax, Precalculus 2e, read
- OpenStax, Calculus Volume 1, read