Lesson 1.6 · Unit 1 · F-BF.1, F-BF.4

Chaining functions together, and undoing them

Composition feeds the output of one function into another. Almost every formula in science is built this way. An inverse function runs the chain backward, and the fact that a function has an inverse only when it passes a simple test is the reason inverse trigonometric functions later need restricted ranges.

The method
  1. \( (f \circ g)(x) = f\big(g(x)\big).\) Apply \( g \) first, then \( f \) to the result.
  2. To compose, substitute the whole of \( g(x) \) in place of each \( x \) in \( f \).
  3. Composition is not commutative: usually \( f(g(x)) \ne g(f(x)) \).
  4. The domain of \( f \circ g \) is the inputs where \( g \) is defined and where \( g(x) \) lies in the domain of \( f \).
  5. A function is one-to-one if no output is repeated, tested by the horizontal line test.
  6. Only a one-to-one function has an inverse. If it is not, restrict the domain to make it so.
  7. To find \( f^{-1} \), write \( y = f(x) \), swap \( x \) and \( y \), and solve for \( y \).
  8. Verify with \( f\big(f^{-1}(x)\big) = x \) and \( f^{-1}\big(f(x)\big) = x \). The domain and range of \( f \) become the range and domain of \( f^{-1} \).

Where students lose marks: reading \( f^{-1}(x) \) as \( \dfrac{1}{f(x)} \). The \( -1 \) is a label for the inverse function, not an exponent. For \( f(x) = 2x + 3 \), \( f^{-1}(x) = \dfrac{x - 3}{2} \), not \( \dfrac{1}{2x + 3} \).

Worked example

The problem. Let \( f(x) = 2x + 3 \) and \( g(x) = x^2 - 1 \). (a) Find \( f(g(x)) \) and \( g(f(x)) \), and evaluate \( (f \circ g)(2) \). (b) Find the domain of \( f(x) = \dfrac{1}{x} \) composed with \( g(x) = x - 2 \). (c) Find the inverse of \( p(x) = \dfrac{x + 2}{x - 3} \) and verify it. (d) Restrict \( q(x) = x^2 - 4x \) to \( x \ge 2 \) and find its inverse.

Step one: compose in both orders for (a). \( f(g(x)) = 2(x^2 - 1) + 3 = 2x^2 + 1 \). \( g(f(x)) = (2x + 3)^2 - 1 = 4x^2 + 12x + 9 - 1 = 4x^2 + 12x + 8 \). They differ, as expected.

Step two: evaluate two ways. Directly: \( g(2) = 3 \), then \( f(3) = 9 \). From the formula: \( 2(2)^2 + 1 = 9 \). They agree.

Step three: the domain for (b). The composition is \( \dfrac{1}{x - 2} \). The inner function accepts all reals, but the result must avoid making the outer denominator zero: \( x - 2 \ne 0 \). Domain: \( x \ne 2 \).

Step four: swap and solve for (c). Write \( x = \dfrac{y + 2}{y - 3} \). Multiply out: \( x(y - 3) = y + 2 \), so \( xy - 3x = y + 2 \).

Step five: collect the \( y \) terms. \( xy - y = 3x + 2 \), so \( y(x - 1) = 3x + 2 \) and \( f^{-1}(x) = \dfrac{3x + 2}{x - 1} \).

Step six: verify. \( p\big(p^{-1}(x)\big) = \dfrac{\frac{3x+2}{x-1} + 2}{\frac{3x+2}{x-1} - 3} \). Multiply top and bottom by \( x - 1 \): \( \dfrac{3x + 2 + 2(x - 1)}{3x + 2 - 3(x - 1)} = \dfrac{5x}{5} = x \). Correct. Domains swap: \( p \) excludes \( x = 3 \) and never outputs 1, and \( p^{-1} \) excludes \( x = 1 \) and never outputs 3.

Step seven: restrict for (d). \( q(x) = x^2 - 4x = (x - 2)^2 - 4 \). The vertex is at \( x = 2 \), so \( x \ge 2 \) selects the right half, which is one-to-one. The range is \( [-4, \infty) \).

Step eight: invert the restricted piece. Swap: \( x = (y - 2)^2 - 4 \), so \( (y - 2)^2 = x + 4 \) and \( y - 2 = \pm\sqrt{x + 4} \). The original had \( y \ge 2 \) as its domain, so the inverse takes the positive root: \( q^{-1}(x) = 2 + \sqrt{x + 4} \), with domain \( [-4, \infty) \). Check: \( q(3) = 9 - 12 = -3 \), and \( q^{-1}(-3) = 2 + \sqrt{1} = 3 \). Correct. Choosing the left half instead would give \( 2 - \sqrt{x + 4} \); the restriction decides which inverse is meant.

Practice · 10 problems

Problems 1 to 5 are routine. Problems 6 to 10 are multi-step or ask for reasoning.

  1. If \( f(x) = x + 5 \) and \( g(x) = 2x \), find \( (f \circ g)(3) \).
    Show the full solution

    \( g(3) = 6 \), then \( f(6) = 11 \). 11

  2. With the same functions, find \( (g \circ f)(3) \).
    Show the full solution

    \( f(3) = 8 \), then \( g(8) = 16 \). Note that it differs from the previous answer. 16

  3. If \( f(x) = x^2 \) and \( g(x) = x + 1 \), find \( f(g(x)) \).
    Show the full solution

    Substitute \( x + 1 \) for \( x \) in \( x^2 \). \( (x + 1)^2 = x^2 + 2x + 1 \)

  4. Find the inverse of \( f(x) = 4x - 8 \).
    Show the full solution

    \( x = 4y - 8 \), so \( y = \dfrac{x + 8}{4} \). Check: \( f(4) = 8 \), and \( f^{-1}(8) = \dfrac{16}{4} = 4 \). \( f^{-1}(x) = \dfrac{x + 8}{4} \)

  5. Is \( f(x) = x^2 \) one-to-one on all real numbers?
    Show the full solution

    \( f(2) = 4 = f(-2) \). Two inputs share an output, so it fails the horizontal line test. No

  6. Find the inverse of \( f(x) = x^3 - 5 \).
    Show the full solution

    \( x = y^3 - 5 \), so \( y^3 = x + 5 \) and \( y = \sqrt[3]{x + 5} \). Check: \( f(3) = 22 \), and \( \sqrt[3]{27} = 3 \) at input 22. \( f^{-1}(x) = \sqrt[3]{x + 5} \)

  7. If \( f(x) = \sqrt{x - 2} \) and \( g(x) = x^2 + 2 \), find \( f(g(x)) \) and its domain.
    Show the full solution

    \( f(g(x)) = \sqrt{x^2 + 2 - 2} = \sqrt{x^2} \). This is \( |x| \), not \( x \): the square root always returns the nonnegative root. The inside \( x^2 \ge 0 \) for every real \( x \), so the domain is all reals. Check at \( x = -3 \): \( g(-3) = 11 \), \( f(11) = \sqrt{9} = 3 = |-3| \). \( |x| \), domain all real numbers

  8. Find the inverse of \( f(x) = \dfrac{2x - 1}{x + 3} \).
    Show the full solution

    \( x = \dfrac{2y - 1}{y + 3} \), so \( xy + 3x = 2y - 1 \). Collect: \( xy - 2y = -1 - 3x \), so \( y(x - 2) = -(3x + 1) \). \( y = \dfrac{-(3x + 1)}{x - 2} = \dfrac{3x + 1}{2 - x} \). Check: \( f(1) = \dfrac{1}{4} \), and \( f^{-1}\left(\tfrac14\right) = \dfrac{\frac34 + 1}{2 - \frac14} = \dfrac{7/4}{7/4} = 1 \). \( f^{-1}(x) = \dfrac{3x + 1}{2 - x} \)

  9. Restrict \( f(x) = x^2 - 4x \) to \( x \ge 2 \) and find its inverse.
    Show the full solution

    Complete the square: \( f(x) = (x - 2)^2 - 4 \). With \( x \ge 2 \), swap: \( x = (y - 2)^2 - 4 \), so \( y - 2 = \sqrt{x + 4} \) (positive, because \( y \ge 2 \)). Check: \( f(5) = 25 - 20 = 5 \), and \( 2 + \sqrt{5 + 4} = 5 \). Correct. \( f^{-1}(x) = 2 + \sqrt{x + 4} \), domain \( [-4, \infty) \)

  10. Show that \( f(x) = x^2 \) and \( g(x) = \sqrt{x} \) satisfy \( f(g(x)) = x \) but are not inverses on all reals.
    Show the full solution

    \( f(g(x)) = (\sqrt{x})^2 = x \), valid for \( x \ge 0 \), where \( g \) is defined. But \( g(f(x)) = \sqrt{x^2} = |x| \), which equals \( x \) only for \( x \ge 0 \). At \( x = -3 \): \( g(f(-3)) = \sqrt{9} = 3 \ne -3 \). Inverses need both compositions to return the input on the whole domain, and \( x^2 \) on all reals is not one-to-one. On \( [0, \infty) \) both hold. Both compositions must give \( x \); here only one does on all reals

← 1.5 Piecewise and absolute value functions1.7 Average rate of change and the difference quotient →

Keep going in the full Precalculus course

All of U1 (Unit 1: Functions and Their Transformations) is free to everyone, with no account. The course has 75 lessons, each with worked examples and practice problems that come with full solutions. A free account can also start a free month of the whole course, with no card.

Open this lesson in the courseSee the whole course