impera Open Impera

AP Precalculus · Exponential and logarithmic functions

Composition and inverses

1Composition of functions

The composition $f \circ g$ means "do $g$ first, then $f$":

$$(f \circ g)(x) = f(g(x))$$

  • The output of $g$ becomes the input of $f$.
  • Order matters: in general $f(g(x)) \ne g(f(x))$.
  • The domain of $f \circ g$ is the set of $x$ in the domain of $g$ for which $g(x)$ is in the domain of $f$.
Worked example

$f(x) = x^2 + 1$, $g(x) = 2x - 3$.

  1. $f(g(x)) = (2x - 3)^2 + 1 = 4x^2 - 12x + 10$.
  2. $g(f(x)) = 2(x^2 + 1) - 3 = 2x^2 - 1$.
  3. $f(g(2)) = f(1) = 2$.

Worked example (from a table): if $g(4) = 7$ and $f(7) = -2$, then $f(g(4)) = -2$.

Check yourself

f(x) = √x and g(x) = x − 5. f(g(9)) =

  • −2

  • 3

  • 4

  • 2

Show the answer

2

g(9) = 4, then √4.

2Decomposing functions

It is often useful to write a complicated function as a composition of simpler ones.

  • $h(x) = (3x + 1)^5$ is $f(g(x))$ with $g(x) = 3x + 1$ (inner) and $f(x) = x^5$ (outer).
  • $h(x) = e^{x^2}$: inner $x^2$, outer $e^x$.
  • Transformations are compositions: $f(x - 2) + 3$ is $f$ composed with $x - 2$, then followed by adding 3.

The identity function $I(x) = x$ leaves inputs unchanged: $f(I(x)) = I(f(x)) = f(x)$.

Check yourself

h(x) = √(x² + 4) = f(g(x)). A suitable choice is:

  • f(x) = √x + 4, g(x) = x²

  • f(x) = x², g(x) = √x + 4

  • f(x) = √x, g(x) = x² + 4

  • f(x) = x² + 4, g(x) = √x

Show the answer

f(x) = √x, g(x) = x² + 4

Inside first.

3Inverse functions

The inverse $f^{-1}$ "undoes" $f$: if $f(a) = b$ then $f^{-1}(b) = a$.

  • $f(f^{-1}(x)) = x$ and $f^{-1}(f(x)) = x$.
  • The graph of $f^{-1}$ is the reflection of the graph of $f$ in the line $y = x$; points $(a, b)$ become $(b, a)$.
  • The domain of $f^{-1}$ is the range of $f$, and vice versa.
  • $f$ has an inverse function only if it is one-to-one (passes the horizontal line test). Otherwise, restrict its domain.

To find an inverse algebraically:

  1. Write $y = f(x)$.
  2. Swap $x$ and $y$.
  3. Solve for $y$.
Worked example

$f(x) = \frac{2x + 1}{x - 3}$.

  1. $x = \frac{2y + 1}{y - 3}$, so $x(y - 3) = 2y + 1$.
  2. $xy - 3x = 2y + 1 \Rightarrow y(x - 2) = 3x + 1$.
  3. $f^{-1}(x) = \frac{3x + 1}{x - 2}$.

A function and its inverse are reflections in y = x: (1, 2) becomes (2, 1)

Check yourself

If f(3) = 10, then f⁻¹(10) =

  • 3

  • 10

  • 1/10

  • 1/3

Show the answer

3

The inverse swaps input and output.

4Restricting domains and verifying inverses

$f(x) = x^2$ is not one-to-one on all reals ($f(2) = f(-2) = 4$). Restricting to $x \ge 0$ gives the inverse $f^{-1}(x) = \sqrt{x}$.

To verify two functions are inverses, show both compositions give $x$.

Worked example

show $f(x) = 4x - 7$ and $g(x) = \frac{x + 7}{4}$ are inverses.

  1. $f(g(x)) = 4\cdot\frac{x + 7}{4} - 7 = x$.
  2. $g(f(x)) = \frac{4x - 7 + 7}{4} = x$. ✓
Check yourself

Which function needs a domain restriction to have an inverse?

  • f(x) = (x − 1)²

  • f(x) = 2x + 5

  • f(x) = x³

  • f(x) = eˣ

Show the answer

f(x) = (x − 1)²

It fails the horizontal line test.

5Going deeper: domains of compositions, and finding and checking inverses

Composition: $(f \circ g)(x) = f(g(x))$: apply g first, then f. Order matters: usually f(g(x)) ≠ g(f(x)).

Domain of f ∘ g: all x in the domain of g for which g(x) is in the domain of f.

Worked example

$f(x) = \sqrt{x}$ and $g(x) = x - 3$.

  1. $f(g(x)) = \sqrt{x - 3}$; domain x ≥ 3.
  2. $g(f(x)) = \sqrt{x} - 3$; domain x ≥ 0.
  3. Different functions, different domains.

Worked example (from a table): f(1) = 4, f(2) = 1, f(4) = 2; g(1) = 2, g(2) = 4, g(4) = 1.

  1. f(g(1)) = f(2) = 1.
  2. g(f(1)) = g(4) = 1.
  3. f(f(4)) = f(2) = 1.

Work from the inside out.

Worked example (decomposing): write $h(x) = (2x + 1)^5$ as a composition.

  1. Inner: g(x) = 2x + 1. Outer: $f(x) = x^5$.
  2. h = f ∘ g.

Inverse functions: $f^{-1}$ undoes f: $f(f^{-1}(x)) = x$ and $f^{-1}(f(x)) = x$.

  • If f(a) = b, then $f^{-1}(b) = a$: swap inputs and outputs.
  • Domain and range swap.
  • The graphs are reflections of each other in the line y = x.
  • An inverse function exists only if f is one-to-one (each output comes from one input; the graph passes the horizontal line test).

Finding an inverse algebraically: write y = f(x); swap x and y; solve for y.

Worked example

$f(x) = \frac{2x + 1}{x - 3}$.

  1. $x = \frac{2y + 1}{y - 3}$.
  2. $xy - 3x = 2y + 1$.
  3. $y(x - 2) = 3x + 1$.
  4. $f^{-1}(x) = \frac{3x + 1}{x - 2}$.
  5. Check with a value: f(4) = 9; $f^{-1}(9) = \frac{28}{7} = 4$.
  6. f has vertical asymptote x = 3 and horizontal y = 2; the inverse has them swapped.

Worked example (restricting the domain): $f(x) = x^2$ is not one-to-one. Restricted to x ≥ 0, its inverse is $f^{-1}(x) = \sqrt{x}$. Restricted to x ≤ 0, the inverse is $-\sqrt{x}$.

Worked example (from a table): using the table above, $f^{-1}(4) = 1$ because f(1) = 4. Do not compute $\frac{1}{f(4)}$: the notation $f^{-1}$ is not a reciprocal.

Worked example (exponential and logarithm): $f(x) = 3 \cdot 2^x$.

  1. $x = 3 \cdot 2^y$.
  2. $2^y = \frac{x}{3}$.
  3. $f^{-1}(x) = \log_2\left(\frac{x}{3}\right)$.

In context: if C(t) converts hours worked into pay, the inverse converts pay into hours. Units swap too.

Verifying: compose in both orders and simplify to x.

Common mistakes

  • Applying the functions in the wrong order.
  • Ignoring the inner function's domain.
  • Reading $f^{-1}(x)$ as $\frac{1}{f(x)}$.
  • Finding an "inverse" of a function that is not one-to-one without restricting it.
  • Forgetting to swap domain and range.
Check yourself

If f(x) = 2x − 5, what is f⁻¹(7)?

  • 9

  • −6

  • 1

  • 6

Show the answer

6

Solve 2x − 5 = 7: the inverse returns the input that gives 7.

6For top marks

  • Read compositions from the inside out.
  • State the domain of an inverse, especially after restricting.
  • Verify inverses using both compositions.
  • Use reflection in $y = x$ to sketch inverses and to check points.
Example

"For $f(x) = (x - 1)^2$ with $x \ge 1$, the inverse is $f^{-1}(x) = 1 + \sqrt{x}$, with domain $x \ge 0$ and range $y \ge 1$."

Check yourself

The domain of f⁻¹ is the same as:

  • The range of f

  • The domain of f

  • The x-intercepts of f

  • All real numbers

Show the answer

The range of f

Inputs and outputs swap.

Now test yourself

This lesson has a 8-question quiz and 5 exam-style questions with mark schemes in Impera. Free, with your progress saved.

Practise in Impera