Start by rewriting f(x) = mx + b as y = mx + b, swap x and y, then solve for y. That gives y = (x − b) / m, and the only condition is m ≠ 0. A horizontal line at y = 3 has no inverse because dividing by its slope of zero is undefined.

The swap-and-solve routine takes about 90 seconds on paper. Most mistakes don't come from the algebra, though. They come from skipping the m ≠ 0 check, mangling signs when b is negative, or forgetting that an inverse of a function and the reciprocal 1/f(x) are completely different things. Each of those shows up in a later section with the exact spot where it happens.

Why Swap X and Y: The Two Rules Every Inverse Must Pass

An invertible function is one where every output traces back to exactly one input. Testing that means composing the function with its inverse both ways: f(g(x)) = x and g(f(x)) = x, for every x in the domain. Both checks must pass, and they check different things. For f(x) = 3x − 7, undoing the operation gives g(x) = (x + 7)/3. Run x = 4 through f and you get 5; run 5 through g and you're back at 4. Reverse the order with x = 2 and the same round trip holds.

The swap step is not a trick. In the equation y = mx + b, the input is x and the output is y. An inverse function exchanges those roles, so x becomes the output and y becomes the input. Swapping the letters in the equation is literally rewriting the same relationship from the inverse's point of view. That's why the algebra works without any deeper theorem.

Geometrically, swapping x and y reflects the graph across the line y = x. A line of slope m and y-intercept b maps to a line of slope 1/m and x-intercept b. The stiffness reverses: a steep line has a shallow inverse. That reflection is also why the inverse of an increasing line is always increasing.

The two-rule test matters in later math. A function that passes both checks is a true inverse on its stated domain, which is what makes logarithms, arcsine, and square-root inverses usable. For a line, the only failure mode is a slope of zero. Every other line passes both checks on its natural domain, all real numbers.

Read the Graph First: Slope and Intercept Predict the Inverse

You can write the inverse before doing any algebra by reading two numbers off the original line. The inverse of f(x) = mx + b has slope 1/m and x-intercept at x = b. Take f(x) = 2x + 6. Its inverse should have slope 1/2, and it should cross the x-axis where x = 6. Solving confirms it: y = (x − 6)/2. Every point on the line satisfies y = (x − 6)/2, and at x = 6, y = 0. If you're skeptical, check a point from the original. Pick x = 1 → f(1) = 8, so (1, 8) lies on the inverse, and plugging gives (8 − 6)/2 = 1.

That prediction is a free error check after solving. If your derived formula gives a slope that isn't 1/m, or an x-intercept that isn't b, you've made an arithmetic slip somewhere. The slope is the giveaway because it's the easiest to misread. A line with slope 3/2 is steeper than the identity line y = x, so its inverse must have slope 2/3 and be shallower. You can see the reflection across y = x immediately.

Negative slopes work the same way. For f(x) = −4x + 1, the inverse has slope −1/4 and x-intercept at x = 1: y = (1 − x)/4. Note the difference between the original's y-intercept of 1 and the inverse's x-intercept of 1. Confusing the two is a common slip. The rule generalizes to any linear function written in slope-intercept form.

Vertical lines are the edge case. A vertical line x = 3 fails the vertical line test as a function, so it can't have an inverse. Its reflection is y = 3, a horizontal line, which has no inverse either because it fails the horizontal line test. Use slope-intercept form before reaching for the shortcut.

Step-by-Step: 5 Steps With a Worked Example and a Net-Zero Check

The most reliable method is swap-and-solve, done in a fixed order. Follow those steps on f(x) = (4/3)x − 2, reading the data out of a table before solving. The function is in slope-intercept form, so the slope is 4/3 and the y-intercept is −2. There are no domain restrictions. The inverse should have slope 3/4, an x-intercept at −2, and pass both composition checks. Keep that table in mind as you work.

1: Write the function as y = (4/3)x − 2. 2: Swap x and y to get x = (4/3)y − 2. 3: Add 2 to both sides: x + 2 = (4/3)y. 4: Multiply both sides by 3/4: y = (3/4)(x + 2). This simplifies to (3x + 6)/4. 5: Verify: plug x = 3 into the original (4/3)(3) − 2 = 4 − 2 = 2. Then plug 2 into the inverse: (3(2) + 6)/4 = 12/4 = 3. Back to the starting value.

Step 4 is where fractional slopes trip people up. Multiplying by the reciprocal is faster than dividing by the fraction, and it keeps the arithmetic in whole numbers. For a negative slope, distribute the reciprocal carefully. For f(x) = −(2/5)x + 1, the inverse is y = −(5/2)(x − 1), and the sign carries through both terms.

The net-zero check is the fastest failure handler. Pick any easy input like 0 or 1, run it through the original, then run the output through your candidate inverse. If you don't land back on the starting input, redo step 3 before checking anything else. Sign errors from steps 3 and 4 account for nearly every wrong answer, and they show up in this test immediately.

Negative Slopes, Fractions, and the Sign Errors That Break Them

Negative and fractional slopes fail for the same reason: the sign of m must attach to the numerator, and students quietly move it to the denominator. That flips the slope and breaks the composition check. For f(x) = −2x + 4, the slope is −2, so the inverse slope is −1/2. Correct solving gives y = −(x − 4)/2. Someone who writes y = (x − 4)/2 has found the inverse of f(x) = 2x + 4. The net-zero check catches it: f(0) = 4, and (4 − 4)/2 = 0, so the bad inverse accidentally passes at x = 0, but f(2) = 0 and (0 − 4)/2 = −2, not 2. The test fails there.

Fractional slopes need the reciprocal step done once, cleanly. For f(x) = (3/5)x + 1, the inverse is y = (5/3)(x − 1). Pulling the fraction out as a whole multiplier keeps the distribution tidy. For f(x) = −(3/5)x − 2, do it in two moves: add the intercept, then multiply by −5/3. Writing the intermediate step down prevents accidentally distributing the negative sign into the wrong term.

The single most common failure is dropping the sign on b when subtracting it. For f(x) = 3x − 7, students write y = (x + 7)/3 with no sign correction; sometimes they write y = (x − 7)/3. The correct inverse is y = (x + 7)/3 because subtracting −7 is adding 7. This specific slip appears on published step-by-step solutions, which is why checking against a point from the original line is worth the extra 20 seconds. A good rule: if b is negative, the numerator has x plus |b|.

When the Inverse Doesn't Exist: Slope Zero and the Horizontal Line Trap

A linear function has an inverse only when its slope is nonzero. The slope of a horizontal line is exactly 0, so the inverse would require dividing by zero, which is undefined. That is not a formality. Horizontal lines map every input to the same output, so two different inputs share an output. An inverse would have to answer "which input produced this output?" and the only honest answer is "one of infinitely many." Change the domain so that only one input remains, and an inverse exists. In practice, teachers test this with f(x) = 5; the correct answer is "no inverse function," not a formula.

The horizontal line test is the visual check for this failure. Any horizontal line you draw must hit the graph of the function at most once for an inverse to exist. A nonhorizontal line passes that test on its whole domain. A horizontal line at y = 5 is hit infinitely many times by f(x) = 5, but a line of slope 2 is hit exactly once no matter which horizontal line you draw.

Students sometimes say f(x) = x has no inverse "because it's the same function." That's a misconception; x maps to x, and the identity is its own inverse — f(f(x)) = x holds trivially. Others say f(x) = −x has no inverse because its slope is negative. Also wrong: the inverse is y = −x. Both of these functions pass the composition check, so the sign of the slope has nothing to do with invertibility.

Inverse vs. Reciprocal: The Mix-Up That Costs Points

The inverse of a linear function is not its reciprocal. For f(x) = 2x + 4, the inverse is y = (x − 4)/2. The reciprocal is 1/(2x + 4), which is not even linear. They behave differently at every test point. Take x = 2: the inverse gives (2 − 4)/2 = −1, and the reciprocal gives 1/8. Those are not close, and they diverge everywhere except where f(x) = ±1.

Exponents expose the same confusion. f(x) = 2x has inverse x/2, and only a reciprocal habit makes someone write 1/(2x). The notation f⁻¹(x) is the inverse function. The reciprocal is 1/f(x) or [f(x)]⁻¹. The superscript −1 is a notational quirk. Reading f⁻¹ as "one over f" is the single most common reason students produce inverse formulas with variables in the denominator.

The composition check settles it instantly. If your candidate answer puts x in a denominator, it is not an inverse of a linear function. Try f(0) through both and see which one returns 0. For f(x) = 2x + 4, the inverse sends 0 to −2, and the reciprocal sends 0 to 1/4. Only the first lands back at the original input if you continue the loop. Reciprocal answers usually come from misreading the question rather than bad algebra, so check what the question asked before solving.

Verify in Two Directions With a Composition Table

A worked verification table catches errors the original formula hides. Use f(x) = 3x − 6 and its inverse y = (x + 6)/3. Run three inputs through f, then push each output through the inverse. The table below shows the round trip.

Input x f(x) = 3x − 6 Inverse output (y + 6)/3 Back to x?
0 −6 0 Yes
2 0 2 Yes
5 9 5 Yes

The f(g(x)) direction tests your inverse. The g(f(x)) direction tests whether the original and candidate are truly paired. Both directions must agree. A table with three rows and one failure is a big clue: a single mismatch usually means a constant term error rather than a slope error.

Time the check. Filling in three rows takes about 60 seconds once you've written both formulas. Compare that to redoing the whole solve, which takes about 90 seconds — worth knowing when a test has a time limit. If you have under a minute, use one input and pick a number that's easy to compute: 0 if b is friendly, 1 or 2 otherwise.

The table also exposes a specific failure mode on the original line. For f(x) = (1/2)x + 1, the inverse is y = 2(x − 1). Run x = 2 and the original gives 2, so the inverse must return 2: 2(2 − 1) = 2, and it does. If you accidentally write y = 2x − 1, the same input returns 3, which is the original's value at x = 4, not x = 2. The table makes that visible in under a minute.

Domain Restrictions From Real Models: What Texts Often Skip

Textbook problems usually ignore domain restrictions, which is fine for pure algebra. Applied models often have them, and inverse formulas erase that information. A taxi driver shares that fares are billed in whole-dollar increments with no negative trips, so the inverse of a fare formula maps fare back to distance and must return values that only make sense within the real domain. The algebra gives y = (F − b)/m, and the model gives 0 ≤ D ≤ 20 (or whatever the limits are). Reporting a negative distance from that inverse is a failure of interpretation, not algebra.

Percent equations are a second case. A conversion from Celsius to Fahrenheit is genuinely linear (not the proportional kind), and the inverse is another linear function. That's why the conversion is reversible by the same formula family. Interest calculations on a fixed principal over a short period can also be modeled approximately as linear, and their inverses recover the time needed to reach a stated balance. The linear fit rarely holds beyond a few periods, though, so the inverse is only valid inside the modeled range.

Students often quote a formula like C = 5(F − 32)/9 and its inverse F = (9/5)C + 32 from memory. For composition checks, plug C = 0 → F = 32; then plug 32 back into the first formula → 0. That pair is a good practice example because the numbers are small and stay exact. Check the maker's or authority's published conversion table if you need to be sure of the current definition of temperature scales.

Domain reasoning also explains why slope-zero lines fail even when the algebra looks fine. A horizontal model like a fixed fee of $3 per ride with no distance charge returns $3 for any distance. Its inverse could say any distance corresponds to a $3 fare, but the model's purpose is to compute fare, not distance. That ambiguity is exactly why invertibility requires a one-to-one mapping over the model's domain.

Practice Set: Four Functions to Invert, Plus an FAQ Guide

Work through four functions to fix the method. Each looks simple, and each exposes a specific failure that shows up on tests.

1: f(x) = 5x + 10. Inverse: y = (x − 10)/5. Slope is 5, inverse slope 1/5. Net-zero check: f(0) = 10, inverse gives 0. Round trip passes. 2: f(x) = −3x + 6. Inverse: y = −(x − 6)/3. Slope is −3, inverse slope −1/3. x-intercept of inverse is x = 6. Check f(2) = 0, and the inverse sends 0 to −(0 − 6)/3 = 2, so the check passes. 3: f(x) = (2/3)x − 4. Inverse: y = (3/2)(x + 4). Fractional slopes: multiply by the reciprocal 3/2 and add the intercept. Check f(3) = −2, and (3/2)(−2 + 4) = 3. Passes. 4: f(x) = 7. No inverse. Slope zero. The correct answer is "none," not y = (x − 7)/0.

Solutions should agree point-for-point with the graph. If you plot the original and the inverse in a graphing app and they are not reflections across y = x, the algebra is wrong. A shortcut: when in doubt, add a row to the verification table for whichever input the failure seems to come from.

What is the inverse of f(x) = x?

The inverse of the identity function is itself. For any x, f(f(x)) = x, and the function passes both composition checks and the horizontal line test on the whole real line. This is the simplest case and a good sanity check for the swap-and-solve habit. If someone tells you x "has no inverse because it equals itself," they are mixing up equal functions with function pairs.

Does every linear function have an inverse?

No. Exactly one class of linear functions does not: those with slope zero, that is, horizontal lines of the form y = c. Every nonzero-slope line passes the horizontal line test on the whole real domain, so an inverse exists and is also linear. A vertical line is not a function, so the question of its inverse doesn't apply in the standard setting; its reflection is horizontal and has no inverse either.

What happens if I solve the wrong way and divide by zero?

Dividing by zero in step 4 produces an undefined expression, and the correct response is to stop and note the slope condition. A common mistake is a horizontal line where a student writes y = (x − b)/0 and then simplifies it to x = b. That is not an inverse; it's a vertical line, and it fails the vertical line test. If your formula collapses to x = a constant, your original must have had m = 0.

How can I check my inverse with a calculator?

Use the table feature or a graphing app to compute f(g(x)) and g(f(x)) at three inputs each. A CAS-style tool will show x for every row if the pair is correct. As a manual shortcut, verify that the inverse's x-intercept equals the original's y-intercept (b). This single figure is the fastest signal of a constant-term error. The slope check is the other half: the inverse's slope should be 1/m.

Is f⁻¹(x) the same as 1/f(x)?

No — they're different functions and the confusion is one of the most common test errors. For f(x) = 2x + 4, f⁻¹(x) = (x − 4)/2 while 1/f(x) = 1/(2x + 4). The first is linear and passes composition checks; the second is a rational function and fails them. A quick test: put a value in and compare outputs. If your candidate puts x in a denominator, it's a reciprocal, not an inverse.

Does the y-intercept of the original become the x-intercept of the inverse?

Yes. That's the reflection-across-y = x rule in intercept form. For f(x) = 2x + 6, the y-intercept is 6 and the inverse crosses the x-axis at x = 6. The slope transforms to its reciprocal, not its negative. A held rule of thumb: slope flips by reciprocal, intercepts swap axes but keep the same numeric value. Both parts together give a fast prediction to test your derived formula against.