Functions

Inverse of a Rational Function

For f(x)=ax+bcx+df(x)=\dfrac{ax+b}{cx+d}, the inverse is f−1(x)=dx−b−cx+af^{-1}(x)=\dfrac{dx-b}{-cx+a}. To get it from any rational function, swap xx and yy, then collect the yy terms and factor yy out.

f−1(x)=dx−b−cx+a  for  f(x)=ax+bcx+df^{-1}(x)=\dfrac{dx-b}{-cx+a}\ \text{ for }\ f(x)=\dfrac{ax+b}{cx+d}

This works whenever ad−bc≠0ad-bc\neq 0. Below you will see where the formula comes from, how to handle shifted and negative forms, what happens to asymptotes, when no inverse exists, and how to verify an answer in under a minute.

How do you find the inverse of a rational function?

The idea is the same as in the inverse of a linear function: an inverse undoes the original, so inputs and outputs trade places. What makes rational functions different is that yy ends up buried in a denominator, so one extra move is needed.

  1. Write y=f(x)y=f(x), then swap xx and yy.
  2. Multiply both sides by the denominator to clear the fraction.
  3. Move every term containing yy to one side and everything else to the other.
  4. Factor yy out and divide by what remains.

The step that costs the most points is step 4. After clearing the fraction you often have yy in two terms, such as xyxy and 2y2y. You cannot isolate yy until it is factored out, and dividing term by term is the usual error. Also, the notation f−1(x)f^{-1}(x) is a name for the inverse, not an exponent. The function notation page explains why f−1(x)f^{-1}(x) is never 1f(x)\dfrac{1}{f(x)}.

Quick check

Find the inverse of f(x)=x−1x+2f(x)=\dfrac{x-1}{x+2}.

Where the inverse of a rational function formula comes from

Coefficient grid showing a and d swap places while b and c change sign to invert a rational function
For f(x) = (2x − 1)/(x + 3), swapping a and d and negating b and c gives (3x + 1)/(−x + 2) at once.

Run the four steps once with letters instead of numbers. Start from y=ax+bcx+dy=\dfrac{ax+b}{cx+d}, swap, and solve:

x=ay+bcy+dx(cy+d)=ay+bcxy−ay=b−dxy(cx−a)=b−dxy=−dx+bcx−a\begin{aligned} x&=\frac{ay+b}{cy+d}\\ x(cy+d)&=ay+b\\ cxy-ay&=b-dx\\ y(cx-a)&=b-dx\\ y&=\frac{-dx+b}{cx-a} \end{aligned}

Multiply the top and bottom by −1-1 and the result reads dx−b−cx+a\dfrac{dx-b}{-cx+a}. That gives a memory rule: swap aa and dd, negate bb and cc. It is a fast way to check any hand calculation.

The rule is not a coincidence. Put the coefficients in a matrix (abcd)\begin{pmatrix}a&b\\c&d\end{pmatrix}. Its inverse matrix is 1ad−bc(d−b−ca)\dfrac{1}{ad-bc}\begin{pmatrix}d&-b\\-c&a\end{pmatrix}, and the scalar in front cancels inside a fraction. The quantity ad−bcad-bc is the 2×2 determinant, and it decides whether the function is invertible at all.

The constant trap

If ad−bc=0ad-bc=0, as in 2x+4x+2\dfrac{2x+4}{x+2}, the fraction simplifies to the constant 2. A constant function has no inverse.

One more consequence: when a=−da=-d, the formula returns the original function, so ff is its own inverse. The function f(x)=1xf(x)=\dfrac{1}{x} is the simplest case, and x+1x−1\dfrac{x+1}{x-1} is another.

Finding the inverse of a rational function step by step

Take f(x)=2x−1x+3f(x)=\dfrac{2x-1}{x+3}. Replace f(x)f(x) with yy and swap the variables:

x=2y−1y+3x(y+3)=2y−1xy+3x=2y−1xy−2y=−3x−1y(x−2)=−3x−1y=−3x−1x−2\begin{aligned} x&=\frac{2y-1}{y+3}\\ x(y+3)&=2y-1\\ xy+3x&=2y-1\\ xy-2y&=-3x-1\\ y(x-2)&=-3x-1\\ y&=\frac{-3x-1}{x-2} \end{aligned}

So f−1(x)=−3x−1x−2f^{-1}(x)=\dfrac{-3x-1}{x-2}. The negatives are the usual place for slips. When 2y2y moves across the equals sign it becomes −2y-2y on the left, and when 3x3x moves it becomes −3x-3x on the right, which is how the numerator ends up as −3x−1-3x-1.

Now test the shortcut. Here a=2a=2, b=−1b=-1, c=1c=1, d=3d=3. Swapping aa and dd and negating bb and cc gives 3x+1−x+2\dfrac{3x+1}{-x+2}. Multiply top and bottom by −1-1 and it matches. Two independent routes to the same answer is a strong sign it is right.

Inverse of a rational function in shifted form

Many textbooks write rational functions as a shifted reciprocal, f(x)=kx−h+vf(x)=\dfrac{k}{x-h}+v. These are transformations of the reciprocal parent function, and for them there is a faster method than clearing fractions: undo the operations in reverse order.

Take f(x)=3x+2−1f(x)=\dfrac{3}{x+2}-1. Reading forward, ff adds 2, takes 3 divided by that, then subtracts 1. Reversing it means add 1 first, then undo the division, then subtract 2:

x=3y+2−1x+1=3y+2y+2=3x+1y=3x+1−2\begin{aligned} x&=\frac{3}{y+2}-1\\ x+1&=\frac{3}{y+2}\\ y+2&=\frac{3}{x+1}\\ y&=\frac{3}{x+1}-2 \end{aligned}

The pattern is tidy. In ff the shift inside the denominator is +2+2 and the outside shift is −1-1. In f−1f^{-1} those two shifts trade places and change sign: the inside shift is +1+1 and the outside shift is −2-2. The numerator 3 does not change.

Try this: Find the inverse of g(x)=−2x−4+5g(x)=\dfrac{-2}{x-4}+5 by undoing the operations in reverse order. (Answer: g−1(x)=−2x−5+4g^{-1}(x)=\dfrac{-2}{x-5}+4.) Then confirm that the asymptotes of gg and g−1g^{-1} swap.

Domain, range and asymptotes of the inverse

Graph of (2x−1)/(x+3) and its inverse with asymptotes x=−3, y=2 swapping to x=2, y=−3
For f(x) = (2x − 1)/(x + 3), the asymptotes x = −3 and y = 2 become y = −3 and x = 2 for the inverse.

An inverse swaps inputs and outputs, so it also swaps domain and range. For rational functions this shows up directly in the asymptotes, which makes the picture easy to read and the algebra easy to verify.

Feature f(x)=ax+bcx+df(x)=\dfrac{ax+b}{cx+d} f−1(x)f^{-1}(x)
Vertical asymptote x=−dcx=-\dfrac{d}{c} x=acx=\dfrac{a}{c}
Horizontal asymptote y=acy=\dfrac{a}{c} y=−dcy=-\dfrac{d}{c}
Domain x≠−dcx\neq -\dfrac{d}{c} x≠acx\neq \dfrac{a}{c}
Range y≠acy\neq \dfrac{a}{c} y≠−dcy\neq -\dfrac{d}{c}

This table assumes c≠0c\neq 0. Try it on the earlier example f(x)=2x−1x+3f(x)=\dfrac{2x-1}{x+3}. It has vertical asymptote x=−3x=-3 and horizontal asymptote y=2y=2. The inverse −3x−1x−2\dfrac{-3x-1}{x-2} has vertical asymptote x=2x=2 and horizontal asymptote y=−3y=-3. The two have swapped, exactly as the table predicts.

A common slip is claiming the range of ff is all real numbers. The horizontal asymptote value ac\dfrac{a}{c} is never reached, so it is missing from the range, and that missing value becomes the missing input of the inverse.

Quick check

The function f(x)=5x−3+2f(x)=\dfrac{5}{x-3}+2 has vertical asymptote x=3x=3. What is the horizontal asymptote of f−1f^{-1}?

Which rational functions have an inverse function?

A function has an inverse function only if it is one-to-one: each output comes from exactly one input. The horizontal line test checks this, and it is the sideways twin of the vertical line test. Any rational function with a linear numerator and linear denominator passes (when ad−bc≠0ad-bc\neq 0), which is why the formula above works so cleanly.

Higher powers change things. Consider f(x)=1x2+1f(x)=\dfrac{1}{x^2+1}. Both x=2x=2 and x=−2x=-2 give 15\dfrac{1}{5}, so it fails the test. As with the inverse of a quadratic function, the fix is to restrict the domain to x≥0x\geq 0. Then:

x=1y2+1y2+1=1xy2=1−xxy=1−xx\begin{aligned} x&=\frac{1}{y^2+1}\\ y^2+1&=\frac{1}{x}\\ y^2&=\frac{1-x}{x}\\ y&=\sqrt{\frac{1-x}{x}} \end{aligned}

The positive root is chosen because y≥0y\geq 0 on the restricted domain. On x≥0x\geq 0 the outputs of ff cover 0<y≤10<y\leq 1, so the inverse has domain 0<x≤10<x\leq 1. Test x=1x=1: f(1)=12f(1)=\dfrac{1}{2} and f−1 ⁣(12)=1/21/2=1f^{-1}\!\left(\dfrac{1}{2}\right)=\sqrt{\dfrac{1/2}{1/2}}=1. Notice the inverse is no longer rational. It behaves like the inverse of a square root function family, with a root in it.

Inverse of a rational function vs its reciprocal

Students often confuse f−1(x)f^{-1}(x) with 1f(x)\dfrac{1}{f(x)}. The reciprocal flips the fraction upside down. The inverse swaps what goes in with what comes out. These give different functions almost every time.

Use f(x)=2x−1x+3f(x)=\dfrac{2x-1}{x+3} again. Its reciprocal is x+32x−1\dfrac{x+3}{2x-1}. Its inverse is −3x−1x−2\dfrac{-3x-1}{x-2}. At x=0x=0 they split: f(0)=−13f(0)=-\dfrac{1}{3}, so the reciprocal of f(0)f(0) is −3-3, while f−1(0)=−1−2=12f^{-1}(0)=\dfrac{-1}{-2}=\dfrac{1}{2}.

Quick separation

f−1(2)f^{-1}(2) asks which input produces the output 2. 1f(2)\dfrac{1}{f(2)} asks for the reciprocal of the output at 2.

The only time the two ideas touch is for f(x)=1xf(x)=\dfrac{1}{x}, where the reciprocal and the inverse are the same function. That is a special coincidence, not a rule, and it is the reason the confusion survives so long.

How do you check the inverse of a rational function?

The strongest check is composition. If gg is the inverse of ff, then f(g(x))=xf(g(x))=x. This uses the idea behind composition of functions. For f(x)=2x−1x+3f(x)=\dfrac{2x-1}{x+3} and g(x)=−3x−1x−2g(x)=\dfrac{-3x-1}{x-2}, substitute gg into ff:

f(g(x))=2⋅−3x−1x−2−1−3x−1x−2+3=−6x−2−(x−2)x−2−3x−1+3(x−2)x−2=−7x−7=xf(g(x))=\frac{2\cdot\frac{-3x-1}{x-2}-1}{\frac{-3x-1}{x-2}+3} =\frac{\frac{-6x-2-(x-2)}{x-2}}{\frac{-3x-1+3(x-2)}{x-2}} =\frac{-7x}{-7}=x

The common factor 1x−2\dfrac{1}{x-2} cancels, and the constants collapse to −7-7 in the denominator, leaving xx. That is a full check, though the algebra is heavy.

Two quicker checks catch most errors. First, pick an easy input: f(1)=14f(1)=\dfrac{1}{4}, so f−1 ⁣(14)f^{-1}\!\left(\dfrac{1}{4}\right) must equal 1. Second, compare asymptotes with the table in the earlier section. If the vertical asymptote of your answer is not ac\dfrac{a}{c}, something went wrong.

Quick check

Let f(x)=2x−1f(x)=\dfrac{2}{x-1} and g(x)=2x+1g(x)=\dfrac{2}{x}+1. Compute f(g(x))f(g(x)). What does it show?

Real use: solving a mixture formula backwards

Rational inverses appear whenever a ratio is controlled by one quantity. Suppose 50 liters of a 10% salt solution receives nn liters of a 30% solution. The concentration of the mix is

C=5+0.3n50+nC=\frac{5+0.3n}{50+n}

Often the question runs the other way: how much to add for a target concentration? That is the inverse. Clear the fraction and factor out nn:

C(50+n)=5+0.3n50C+Cn=5+0.3n50C−5=0.3n−Cnn=50C−50.3−C\begin{aligned} C(50+n)&=5+0.3n\\ 50C+Cn&=5+0.3n\\ 50C-5&=0.3n-Cn\\ n&=\frac{50C-5}{0.3-C} \end{aligned}

For a 20% mix, C=0.2C=0.2 gives n=10−50.1=50n=\dfrac{10-5}{0.1}=50 liters. Check: 5+15100=0.2\dfrac{5+15}{100}=0.2.

The asymptotes now carry meaning. In the original formula, CC approaches 0.3 as nn grows but never reaches it, which is the horizontal asymptote. In the inverse, that same value 0.3 is the vertical asymptote, so no amount of the 30% solution can produce a mix at or above 30%.

Practice problems

0 of 5 solved

  1. Find the inverse of f(x)=1x−4f(x)=\dfrac{1}{x-4}.

  2. Find the inverse of f(x)=x+2xf(x)=\dfrac{x+2}{x}.

  3. Find the inverse of f(x)=3x+12x−5f(x)=\dfrac{3x+1}{2x-5}.

  4. Find the inverse of f(x)=4x−32x+1f(x)=\dfrac{4x-3}{2x+1} and state the domain of the inverse.

  5. Find the value of kk that makes f(x)=kx+3x−2f(x)=\dfrac{kx+3}{x-2} its own inverse.

Common questions

What is the inverse of a rational function?

It is the function that reverses the original, found by swapping xx and yy and solving for yy. For f(x)=ax+bcx+df(x)=\dfrac{ax+b}{cx+d} the inverse is dx−b−cx+a\dfrac{dx-b}{-cx+a}, which is another rational function of the same type.

Is the inverse of a rational function always a rational function?

Not always. When the numerator and denominator are both linear, the inverse is rational. When the original has x2x^2 or higher powers, solving for yy usually produces a root, so the inverse is no longer rational.

Does every rational function have an inverse?

Only one-to-one rational functions have an inverse function. A function that fails the horizontal line test, such as 1x2+1\dfrac{1}{x^2+1}, needs a restricted domain first.

How do you find the domain of the inverse of a rational function?

The domain of the inverse is the range of the original function. For ax+bcx+d\dfrac{ax+b}{cx+d} with c≠0c\neq 0, that means all real numbers except ac\dfrac{a}{c}.

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

No. The reciprocal is 1f(x)\dfrac{1}{f(x)}, which flips the fraction. The inverse f−1(x)f^{-1}(x) swaps inputs and outputs, and the two agree only in special cases such as f(x)=1xf(x)=\dfrac{1}{x}.

Which rational functions are their own inverse?

A function ax+bcx+d\dfrac{ax+b}{cx+d} is its own inverse when a=−da=-d (and ad−bc≠0ad-bc\neq 0). Examples are 1x\dfrac{1}{x} and x+1x−1\dfrac{x+1}{x-1}.

Up next