Math Core

Lesson 1.4 · Functions

Inverse functions

A function turns inputs into outputs. Often you need to run it backward: given a temperature in Fahrenheit, what was it in Celsius? Given the balance in an account, how long has it been growing? The function that reverses another is its inverse. Inverses are the reason logarithms and inverse trigonometric functions exist, so it pays to understand them well now.

Undoing a function

Definition

Inverse function

Functions ff and gg are inverses of each other if

f(g(x))=x  for every x in the domain of gandg(f(x))=x  for every x in the domain of ff\big(g(x)\big) = x \ \text{ for every } x \text{ in the domain of } g \quad \text{and} \quad g\big(f(x)\big) = x \ \text{ for every } x \text{ in the domain of } f

The inverse of ff is written f−1f^{-1} (read "ff inverse").

In words: if ff sends aa to bb, then f−1f^{-1} sends bb back to aa.

f(a)=b⟺f−1(b)=af(a) = b \quad \Longleftrightarrow \quad f^{-1}(b) = a

So every point (a,b)(a, b) on the graph of ff becomes the point (b,a)(b, a) on the graph of f−1f^{-1}. Inputs and outputs trade places, which means

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

Common mistake

The −1-1 in f−1f^{-1} is not an exponent. f−1(x)f^{-1}(x) means the inverse function, not 1f(x)\dfrac{1}{f(x)}. For f(x)=2xf(x) = 2x, the inverse is f−1(x)=x2f^{-1}(x) = \dfrac{x}{2}, but 1f(x)=12x\dfrac{1}{f(x)} = \dfrac{1}{2x}.

Which functions have inverses?

Running a function backward only works if every output came from just one input. If f(3)=9f(3) = 9 and f(−3)=9f(-3) = 9, the inverse wouldn't know whether to send 99 back to 33 or to −3-3.

Definition

One-to-one

A function is one-to-one if different inputs always give different outputs: f(a)=f(b)f(a) = f(b) only when a=ba = b. A function has an inverse function exactly when it is one-to-one.

On a graph, this is the horizontal line test: ff is one-to-one if no horizontal line crosses its graph more than once. A function that is always increasing, or always decreasing, passes automatically.

The line y = 2 crosses x³ + 1 once but crosses x² − 2 twice, so only the cubic is one-to-one.Open in grapher →

Finding an inverse algebraically

Finding a formula for f⁻¹

  1. Check that ff is one-to-one.
  2. Write y=f(x)y = f(x).
  3. Swap xx and yy.
  4. Solve the new equation for yy. The result is f−1(x)f^{-1}(x).
  5. State the domain of f−1f^{-1}: it is the range of ff.

Swapping xx and yy is the algebra version of trading every (a,b)(a, b) for (b,a)(b, a).

Worked example: Inverting a rational function

Find the inverse of f(x)=2x+1x−3f(x) = \dfrac{2x + 1}{x - 3}, and verify it with one value.

Write y=2x+1x−3y = \dfrac{2x + 1}{x - 3} and swap: x=2y+1y−3x = \dfrac{2y + 1}{y - 3}. Now solve for yy. Clear the fraction, then gather the yy-terms on one side and factor out yy:

x(y−3)=2y+1xy−3x=2y+1xy−2y=3x+1y(x−2)=3x+1y=3x+1x−2\begin{aligned} 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 domain of ff is x≠3x \ne 3 and the domain of f−1f^{-1} is x≠2x \ne 2, so the range of ff is y≠2y \ne 2.

Check: f(0)=1−3=−13f(0) = \dfrac{1}{-3} = -\dfrac{1}{3}, and f−1(−13)=−1+1−13−2=0f^{-1}\left(-\dfrac{1}{3}\right) = \dfrac{-1 + 1}{-\frac{1}{3} - 2} = 0. It sends −13-\dfrac{1}{3} back to 00.

The graph of an inverse

Since (a,b)(a, b) on ff becomes (b,a)(b, a) on f−1f^{-1}, the graph of f−1f^{-1} is the reflection of the graph of ff across the line y=xy = x.

Worked example: A square root and its inverse

Find the inverse of f(x)=x−2+1f(x) = \sqrt{x - 2} + 1 and graph both.

The domain of ff is x≥2x \ge 2 and its range is y≥1y \ge 1. Write y=x−2+1y = \sqrt{x - 2} + 1 and swap:

x=y−2+1x−1=y−2(x−1)2=y−2y=(x−1)2+2\begin{aligned} x &= \sqrt{y - 2} + 1 \\ x - 1 &= \sqrt{y - 2} \\ (x - 1)^2 &= y - 2 \\ y &= (x - 1)^2 + 2 \end{aligned}

The formula (x−1)2+2(x - 1)^2 + 2 describes a whole parabola, but f−1f^{-1} must have domain equal to the range of ff. So

f−1(x)=(x−1)2+2,x≥1f^{-1}(x) = (x - 1)^2 + 2, \qquad x \ge 1

That is only the right half of the parabola.

f(x) = √(x − 2) + 1 and its inverse, the half-parabola (x − 1)² + 2 for x ≥ 1, are mirror images across y = x.Open in grapher →

The points (2,1)(2, 1) and (6,3)(6, 3) on ff reflect to (1,2)(1, 2) and (3,6)(3, 6) on f−1f^{-1}.

Restricting the domain

A function that fails the horizontal line test can still get an inverse if you restrict its domain to a piece where it is one-to-one. You'll use exactly this idea to define sin⁡−1\sin^{-1} and cos⁡−1\cos^{-1} later in the course.

Worked example: Choosing half of a parabola

The function f(x)=(x−3)2f(x) = (x - 3)^2 is not one-to-one. Restrict it to x≥3x \ge 3 and find the inverse.

On x≥3x \ge 3 the parabola is increasing, so it is one-to-one, and its range is y≥0y \ge 0. Swap and solve:

x=(y−3)2⟹y−3=±xx = (y - 3)^2 \quad \Longrightarrow \quad y - 3 = \pm\sqrt{x}

The inverse must return values y≥3y \ge 3 (the restricted domain of ff), so take the plus sign:

f−1(x)=3+x,x≥0f^{-1}(x) = 3 + \sqrt{x}, \qquad x \ge 0

If you had restricted to x≤3x \le 3 instead, the minus sign would be correct: f−1(x)=3−xf^{-1}(x) = 3 - \sqrt{x}.

Tip

To verify an inverse, compose. For f(x)=(x−3)2f(x) = (x - 3)^2 with x≥3x \ge 3 and f−1(x)=3+xf^{-1}(x) = 3 + \sqrt{x}: f(f−1(x))=(x)2=xf\big(f^{-1}(x)\big) = (\sqrt{x})^2 = x and f−1(f(x))=3+(x−3)2=3+(x−3)=xf^{-1}\big(f(x)\big) = 3 + \sqrt{(x - 3)^2} = 3 + (x - 3) = x, using x−3≥0x - 3 \ge 0.

Practice

Practice 1

The point (2,−5)(2, -5) is on the graph of a one-to-one function ff. What point must be on the graph of f−1f^{-1}?

Enter a point like (2, -3)

Practice 2

Find f−1(x)f^{-1}(x) for f(x)=5x−3f(x) = 5x - 3.

Enter an expression, e.g. 3x^2 - 2x + 1

Practice 3

Which function is one-to-one?

Practice 4

A one-to-one function ff has f(1)=4f(1) = 4 and f(4)=9f(4) = 9. Find f−1(f−1(9))f^{-1}\big(f^{-1}(9)\big).

Enter a number. Fractions like 3/4 and sqrt(2) are OK.

Practice 5

Find f−1(x)f^{-1}(x) for f(x)=2x3−1f(x) = 2x^3 - 1.

Enter an expression, e.g. 3x^2 - 2x + 1

Practice 6

Let f(x)=x+5−2f(x) = \sqrt{x + 5} - 2. What is the domain of f−1f^{-1}? Write it as an inequality in xx.

Enter an inequality, e.g. x >= 4, -2 < x <= 3, or x < 1 or x > 5

Practice 7

Find f−1(x)f^{-1}(x) for f(x)=x+4x−1f(x) = \dfrac{x + 4}{x - 1}.

Enter an expression, e.g. 3x^2 - 2x + 1

Practice 8

Let f(x)=x2+6xf(x) = x^2 + 6x with domain x≥−3x \ge -3. Find f−1(x)f^{-1}(x).

Enter an expression, e.g. 3x^2 - 2x + 1