Functions

Inverse of a Linear Function

The inverse of f(x)=mx+bf(x)=mx+b is f−1(x)=x−bmf^{-1}(x)=\dfrac{x-b}{m}, and it exists whenever m≠0m\neq 0. It undoes ff by subtracting bb first and then dividing by mm.

f−1(x)=x−bm,m≠0f^{-1}(x)=\frac{x-b}{m}, \quad m\neq 0

Try it with your numbers

Show every step

Every line that is not horizontal has exactly one inverse, and that inverse is another line. The sections below show where the formula comes from, how to handle fractions and negative slopes, how to verify an answer in ten seconds, and the cases where the usual shortcuts break.

Inverse of a linear function: where the formula comes from

Step cards showing 3x + 2 applied to 4 and undone in reverse order
Multiply by 3 then add 2 takes 4 to 14, and subtracting 2 then dividing by 3 brings it back to 4.

A linear function does two things to an input: it multiplies by mm, then it adds bb. An inverse has to undo those actions in the opposite order, so the first move is to subtract bb and the second is to divide by mm. Getting that order backwards is the root of most wrong answers.

The algebra is one short chain. Start from the output equation and solve for the input:

y=mx+b⇒y−b=mx⇒x=y−bmy=mx+b \quad\Rightarrow\quad y-b=mx \quad\Rightarrow\quad x=\frac{y-b}{m}

The last line already is the inverse: give it an output yy and it returns the input xx. The only remaining step is cosmetic. By convention the input variable is called xx, so rename to get f−1(x)=x−bmf^{-1}(x)=\frac{x-b}{m}. The equivalent form f−1(x)=1mx−bmf^{-1}(x)=\frac1m x-\frac bm is in slope-intercept form, which makes the new slope and intercept easy to read.

Inputs and outputs trade jobs

The domain of f−1f^{-1} is the range of ff, and the range of f−1f^{-1} is the domain of ff. For a line with m≠0m\neq 0, both are all real numbers.

Reading f−1(x)f^{-1}(x) correctly depends on function notation: f−1(17)f^{-1}(17) means “the input that ff turns into 17.” That wording is a useful mental tool, because it turns an abstract symbol into a question you can answer by working backwards. The swap of roles also explains why the domain and range of an inverse are simply those of the original, exchanged.

Quick check

For f(x)=2x+9f(x)=2x+9, evaluate f−1(25)f^{-1}(25) by undoing the steps of ff in reverse order.

How do you find the inverse of a linear function step by step?

The standard routine has four moves, and the second one does the real work.

  1. Replace f(x)f(x) with yy.
  2. Swap xx and yy.
  3. Solve the new equation for yy.
  4. Rename yy as f−1(x)f^{-1}(x).

Example 1. Find the inverse of f(x)=−23x+4f(x)=-\frac23x+4.

y=−23x+4y=-\frac23x+4

x=−23y+4x=-\frac23y+4

x−4=−23yx-4=-\frac23y

y=−32 (x−4)=−32x+6y=-\frac32\,(x-4)=-\frac32x+6

So f−1(x)=−32x+6f^{-1}(x)=-\frac32x+6. Dividing by −23-\frac23 is the same as multiplying by −32-\frac32, and that factor must hit both terms of x−4x-4. Multiplying only the xx and leaving the 44 untouched is the single most common slip with fractional slopes.

A faster route avoids fraction division altogether: clear the denominator first. From x=−23y+4x=-\frac23y+4, multiply every term by 3 to get 3x=−2y+123x=-2y+12, so 2y=12−3x2y=12-3x and y=6−32xy=6-\frac32x. Same answer, no reciprocals to juggle. With a negative slope, the matching trap is the sign: dividing 4−x4-x by 33 gives 4−x3\frac{4-x}{3}, and the minus sign belongs on the xx, not on the whole fraction.

Why the slope flips and the intercepts trade places

Graph of y = 3x + 2 and its inverse mirrored across the line y = x
Flipping (1, 5) to (5, 1) reflects f(x) = 3x + 2 onto its inverse, and the slope 3 turns into 1/3.

Swapping xx and yy sends every point (a,b)(a,b) on the graph to (b,a)(b,a). That is a reflection across the line y=xy=x, one of the basic moves in transformations of functions. Under that reflection, rise and run exchange places, so a slope of mm becomes 1m\frac1m. The sign never changes: an increasing line stays increasing, a decreasing line stays decreasing.

The intercepts swap as well. The x-intercept of ff is (−bm,0)\left(-\frac bm,0\right), and after the flip it becomes the point (0,−bm)\left(0,-\frac bm\right), which is exactly the y-intercept in f−1(x)=1mx−bmf^{-1}(x)=\frac1mx-\frac bm. This gives a second way to find an inverse without any algebra on the equation itself.

Example 2. A line passes through (1,5)(1,5) and (3,11)(3,11). Find the inverse of the line. Flip each point to get (5,1)(5,1) and (11,3)(11,3). The slope between them is 3−111−5=13\frac{3-1}{11-5}=\frac13. Using point-slope form:

y−1=13(x−5)⇒y=13x−23y-1=\frac13(x-5) \quad\Rightarrow\quad y=\frac13x-\frac23

The original line is f(x)=3x+2f(x)=3x+2, whose inverse by formula is x−23=13x−23\frac{x-2}{3}=\frac13x-\frac23. Both routes agree. This point-flipping method also works directly on a table of values, which is how inverses are often presented.

Quick check

A line has slope −52-\frac52 and y-intercept 44. What are the slope and y-intercept of its inverse?

How to check the inverse of a linear function

A true inverse satisfies f(f−1(x))=xf\left(f^{-1}(x)\right)=x. Feed the candidate inverse into the original and the result should collapse to a bare xx. Test Example 1:

f(f−1(x))=−23(−32x+6)+4=x−4+4=xf\left(f^{-1}(x)\right)=-\frac23\left(-\frac32x+6\right)+4=x-4+4=x

That is the full check, and the composition of functions is the idea behind it. If the xx does not come out clean, an error crept in somewhere.

For a ten-second check, use a single number. Since f(0)=4f(0)=4, the inverse must send 44 back to 00: −32(4)+6=0-\frac32(4)+6=0. A one-point test cannot prove the answer is right, but it catches nearly every slip with signs and fractions, and it is quick enough to do on every problem.

Try this: Find the inverse of f(x)=7−2xf(x)=7-2x. Then send x=1x=1 through ff and send the result through your inverse. You should land back on 11. If you do not, recheck the sign when you divide.

When does a linear function have no inverse?

The formula divides by mm, so m=0m=0 breaks it. A constant function such as f(x)=5f(x)=5 sends both 11 and 22 to the same output. An inverse would have to send 55 back to both of them, and a function cannot give two answers for one input. Flip the graph and the horizontal line becomes the vertical line x=5x=5, which fails the vertical line test. The inverse relation exists, but it is not a function.

The slope decides everything

A line y=mx+by=mx+b has an inverse function exactly when m≠0m\neq 0. The intercept bb never matters.

The general requirement is that a function be one-to-one: every output comes from exactly one input. Every non-horizontal line meets that standard, so no domain restriction is ever needed for a single line.

Trouble starts when lines are joined. A piecewise function with one rising piece and one falling piece, such as the V-shape of an absolute value function, sends two different inputs to the same output, so it has no inverse on its full domain. Each straight piece alone still does.

Is the inverse the same as the reciprocal of a function?

No, and the notation causes the confusion. The small −1-1 in f−1(x)f^{-1}(x) marks an inverse function, not an exponent. The reciprocal of the output is written 1f(x)\frac{1}{f(x)}, and −f(x)-f(x) is a third, different thing. Take f(x)=2x+6f(x)=2x+6 and test each at x=4x=4:

Expression Rule Value at x=4x=4
f(x)f(x) 2x+62x+6 1414
f−1(x)f^{-1}(x) x−62\frac{x-6}{2} −1-1
1f(x)\frac{1}{f(x)} 12x+6\frac{1}{2x+6} 114\frac1{14}

The inverse is the only one of the three that sends 1414 back to 44: 14−62=4\frac{14-6}{2}=4. If an answer to an inverse problem has the variable sitting in a denominator on its own, it is probably a reciprocal by mistake. The inverse of a line is always another line, never a fraction with xx underneath.

Which linear functions are their own inverse?

A function equals its own inverse when reflecting it across y=xy=x leaves the graph unchanged. For lines, that happens in two cases:

  • f(x)=−x+bf(x)=-x+b for any bb. Its inverse is x−b−1=b−x\frac{x-b}{-1}=b-x, the same rule.
  • f(x)=xf(x)=x, the identity, where m=1m=1 and b=0b=0.

Geometrically, a line with slope −1-1 is perpendicular to y=xy=x, so the reflection maps it onto itself. A line like f(x)=x+3f(x)=x+3 is not self-inverse: its inverse x−3x-3 is a parallel line on the other side of y=xy=x.

Where a line and its inverse cross, they must cross on y=xy=x, so solve mx+b=xmx+b=x:

x=b1−m(m≠1)x=\frac{b}{1-m}\qquad(m\neq 1)

Example 3. For f(x)=3x−2f(x)=3x-2, the crossing is at x=−21−3=1x=\frac{-2}{1-3}=1, and f(1)=1f(1)=1. The inverse x+23\frac{x+2}{3} also gives 11 at x=1x=1, so both graphs pass through (1,1)(1,1). When m=1m=1 and b≠0b\neq0 the lines are parallel and never meet, which matches the formula failing there.

Quick check

Where does the graph of f(x)=2x−6f(x)=2x-6 meet the graph of its inverse?

Inverse of a linear function in real life: temperature and fares

Real formulas get inverted whenever the known quantity and the wanted quantity swap. Converting Celsius to Fahrenheit uses F=95C+32F=\frac95C+32. To go the other way, undo the +32+32, then undo the 95\frac95:

C=59 (F−32)C=\frac59\,(F-32)

Body temperature of 98.6∘F98.6^\circ\text{F} gives 59(66.6)=37∘C\frac59(66.6)=37^\circ\text{C}. The slope 95\frac95 became 59\frac59, exactly the reciprocal rule from earlier.

A taxi charging a $3 flat fee plus $2.50 per mile has cost c=2.5m+3c=2.5m+3. The inverse m=c−32.5m=\frac{c-3}{2.5} turns a fare into a distance, so a $23 fare means 88 miles. Context also trims the domain: miles cannot be negative, so the inverse only applies to fares of $3 or more.

The same idea appears in sequences. The nnth term of an arithmetic sequence, an=a1+(n−1)da_n=a_1+(n-1)d, is linear in nn. Solving for nn gives n=an−a1d+1n=\frac{a_n-a_1}{d}+1. In the sequence 5,9,13,…5, 9, 13,\dots the value 4949 sits at n=49−54+1=12n=\frac{49-5}{4}+1=12. This is the standard move behind the arithmetic series formula when the unknown is the position rather than the value.

How does this connect to inverses of other functions?

The swap-and-solve routine is universal. Lines are simply the case where solving is easy and no restriction is needed. Once the equation has a squared term, the reflection fails the horizontal line test, which is why the inverse of a quadratic function requires cutting the domain in half first.

A line also works as a building block. It is the parent function y=xy=x stretched and shifted, and its inverse reverses those two moves in the opposite order, as seen in the formula. The same reversal pattern carries into the inverse of a rational function, where isolating yy takes a few extra steps. It also reaches the inverse of an exponential function, where undoing the operation requires a logarithm.

A habit worth building now: after finding any inverse, check one point and check the graph’s symmetry across y=xy=x. For lines the checks take seconds, and the same habit pays off on every harder inverse later.

Practice problems

0 of 5 solved

  1. Find the inverse of f(x)=x+7f(x)=x+7.

  2. Find the inverse of f(x)=5x−10f(x)=5x-10.

  3. Find the inverse of f(x)=4−3xf(x)=4-3x.

  4. Find the inverse of f(x)=2x−53f(x)=\frac{2x-5}{3}.

  5. For f(x)=34x−2f(x)=\frac34x-2, find f−1(10)f^{-1}(10).

Common questions

What is the formula for the inverse of a linear function?

For f(x)=mx+bf(x)=mx+b with m≠0m\neq 0, the inverse is f−1(x)=x−bmf^{-1}(x)=\frac{x-b}{m}. It subtracts the intercept and then divides by the slope, which reverses what ff does.

Does every linear function have an inverse?

Every linear function with a nonzero slope has one. A constant function f(x)=bf(x)=b has no inverse function, because every input gives the same output and the output cannot be traced back to a single input.

Is the inverse of a linear function also linear?

Yes. The inverse of y=mx+by=mx+b is y=1mx−bmy=\frac1mx-\frac bm, a line with slope 1m\frac1m. Its graph is the original line reflected across y=xy=x.

How do you find the inverse of a linear function from a table or two points?

Swap the input and output in every pair, so (a,b)(a,b) becomes (b,a)(b,a). Then find the slope and equation of the line through the swapped points, using point-slope form if needed.

What is the difference between f−1(x)f^{-1}(x) and 1f(x)\frac{1}{f(x)}?

f−1(x)f^{-1}(x) is the inverse function, which undoes ff. 1f(x)\frac{1}{f(x)} is the reciprocal of the output. For f(x)=2x+6f(x)=2x+6 they are x−62\frac{x-6}{2} and 12x+6\frac{1}{2x+6}, which are completely different.

How do you graph the inverse of a linear function?

Plot two points of the original line, swap the coordinates of each, and draw the line through the swapped points. Equivalently, reflect the original line across the line y=xy=x.

Up next