# Composition of Functions

> AP Precalculus · AP Precalculus CED Unit 2
> Source: https://www.owlsprep.com/study/ap-precalculus-u2-composition-of-functions/

This guide covers core composition of functions concepts aligned to AP Precalculus Unit 2, including notation, evaluation, finding rules and domains, and inverse composition properties for exponential-logarithmic pairs, with worked examples and exam tips.

**Prerequisites:** Domain and range of basic functions (polynomials, exponentials, logarithms); Evaluating functions at numerical and algebraic inputs; [Inverse function definitions for exponential-logarithmic pairs](https://www.owlsprep.com/study/ap-precalculus-u2-inverse-functions/)

## Learning objectives

- Understand composition notation and order of evaluation
- Evaluate composite functions at numerical and algebraic inputs
- Find the algebraic rule and domain of composite functions
- Apply inverse composition identities to exponential-logarithmic pairs
- Avoid common exam pitfalls related to composition

## Introduction to Composition of Functions

Composition of functions is the process of using the output of one function as the input of a second function, combining multiple functions into a single new function. Per AP Precalculus CED, this is a core skill in Unit 2, appearing in 8-12% of Unit 2 exam questions on both multiple-choice and free-response sections.

**Composite Function** — A new function formed by chaining two functions: the output of the inner function $g$ becomes the input of the outer function $f$, so $(f \circ g)(x) = f(g(x))$. Composition is not commutative, meaning $f \circ g$ is almost never equal to $g \circ f$.

*Notation:* $(f \circ g)(x)$

*Example:* For exponential and logarithmic pairs, composition is used to simplify expressions using inverse properties.

In AP Precalculus Unit 2, composition most frequently pairs exponentials or logarithms with polynomials, or pairs exponential and logarithmic functions with each other, especially when working with inverse functions.

## Evaluating Composite Functions

Evaluating a composite function for a given input $x$ follows one core rule: always work from the inside out. First evaluate the inner function (the function closest to $x$ in notation), then substitute that output into the outer function as the new input.

**Worked example:** Given $f(x) = e^{2x} + 1$ and $g(x) = \ln x$, find $(f \circ g)(3)$.

1. Recognize that $(f \circ g)(3) = f(g(3))$, so evaluate the inner function $g$ first, per the order of composition.
2. Calculate the inner function output:

   $$g(3) = \ln 3$$
3. Substitute this output into the outer function $f$:

   $$f(g(3)) = f(\ln 3) = e^{2(\ln 3)} + 1$$
4. Simplify using logarithm rules and the inverse identity $e^{\ln k} = k$:

   $$2 \ln 3 = \ln 3^2 = \ln 9 \implies e^{\ln 9} = 9$$
5. Add 1 to get the final result:

   $$9 + 1 = 10$$

> **tip**
>
> On multiple-choice questions, a common distractor is the result of swapping the order of composition (in this example, $g(f(3)) \approx 6.01$). Always mark which function is inner before starting calculations.

> **Exam tip:** Always explicitly confirm the order of composition before starting calculations to avoid falling for common distractors.

## Finding Composite Rules and Domains

To find the general algebraic rule for $(f \circ g)(x)$, substitute the entire expression for $g(x)$ into the outer function $f$ in place of $x$. A frequently tested skill is finding the domain of the new composite function, which must satisfy two conditions: 1) $x$ is in the domain of the inner function $g$, and 2) the output $g(x)$ is in the domain of the outer function $f$.

> **warning**
>
> A common mistake is simplifying the composite expression first, then finding the domain of the simplified function. This can incorrectly include disallowed inputs that were restricted by the inner function.

**Worked example:** Given $f(x) = \ln(x + 2)$ and $g(x) = x^2 - 5$, find $(f \circ g)(x)$ and state its domain.

1. Write the composition by substituting $g(x)$ into $f$:

   $$(f \circ g)(x) = f(g(x)) = \ln\left((x^2 - 5) + 2\right) = \ln(x^2 - 3)$$
2. Check the domain of the inner function $g(x)$: $g(x)$ is a polynomial, so its domain is all real numbers with no restrictions here.
3. Apply the domain restriction of the outer function $f$: the argument of a logarithm must be positive, so solve:

   $$x^2 - 3 > 0$$
4. Factor and solve the inequality:

   $$(x - \sqrt{3})(x + \sqrt{3}) > 0 \implies x < -\sqrt{3} \text{ or } x > \sqrt{3}$$
5. Rule: $(f \circ g)(x) = \ln(x^2 - 3)$, domain: $(-\infty, -\sqrt{3}) \cup (\sqrt{3}, \infty)$

> **tip**
>
> Always find the domain before simplifying the composite expression, even if simplification removes a term that caused the original restriction. For example, $\ln\left(\frac{(x-2)(x+1)}{x-2}\right)$ still excludes $x=2$ from the domain, even after canceling the $(x-2)$ term.

## Composition of a Function and Its Inverse

A key property of inverse functions is that composing a function with its inverse gives the identity function, which outputs the original input. For any one-to-one function $f$ with inverse $f^{-1}$, two core identities hold:

$$(f \circ f^{-1})(x) = f(f^{-1}(x)) = x$$

$$(f^{-1} \circ f)(x) = f^{-1}(f(x)) = x$$

For Unit 2, this property is most commonly applied to inverse pairs of exponential and logarithmic functions: for $b>0, b \neq 1$, $f(x) = b^x$ and $f^{-1}(x) = \log_b x$. This gives the identities $b^{\log_b x} = x$ (for $x>0$) and $\log_b(b^x) = x$ (for all real $x$), which are used constantly to simplify expressions and solve equations.

**Worked example:** Simplify the composite expression $(\ln \circ f)(x)$ where $f(x) = 5e^{3x-2}$, and state any domain restrictions.

1. Write the composition explicitly:

   $$(\ln \circ f)(x) = \ln\left(f(x)\right) = \ln\left(5e^{3x-2}\right)$$
2. Split the product using the logarithm product rule:

   $$\ln 5 + \ln\left(e^{3x-2}\right)$$
3. Apply the inverse composition identity $\ln(e^u) = u$ for all real $u$:

   $$\ln\left(e^{3x-2}\right) = 3x - 2$$
4. Check domain restrictions: The input to $\ln$ is $5e^{3x-2}$, which is always positive for all real $x$. The inner function $f(x)$ is also defined for all real $x$, so there are no additional restrictions.
5. Final result:

   $$(\ln \circ f)(x) = 3x - 2 + \ln 5, \text{ domain: all real numbers}$$

> **tip**
>
> When simplifying $e^{\ln x^2}$, the result is $|x|$, not just $x$. $\ln x^2$ is defined for all non-zero $x$, so the simplified form must retain the correct domain for negative inputs.

## AP-Style Concept Check

**Check your understanding**

Test your understanding with these AP-style practice questions:

1. If $f(x) = 2^x$ and $g(x) = \log_2(x - 3)$, what is the value of $(f \circ g)(11)$?

   - A) 3
   - B) 8
   - C) 11
   - D) 16

   *Why:* Correct: You worked inside out: $g(11) = \log_2(8) = 3$, so $f(3) = 2^3 = 8$. Swapping the order of composition gives ~11, a common distractor.

**Worked example:** In a microbiology experiment, the number of bacteria is $N(d) = 1000e^{0.2d}$, where $d$ is growing days. Time is measured in hours, so $d(t) = \frac{t}{24}$. Write the composite function for number of bacteria as a function of timer hours $t$, then find the number of bacteria after 72 hours, rounded to the nearest whole number.

1. We need $N$ as a function of $t$, so we compose $N$ with $d$ to get $(N \circ d)(t) = N(d(t))$.
2. Substitute $d(t)$ into $N$:

   $$(N \circ d)(t) = 1000e^{0.2\left(\frac{t}{24}\right)} = 1000e^{\frac{t}{120}}$$
3. Substitute $t=72$ and calculate:

   $$(N \circ d)(72) = 1000e^{\frac{72}{120}} = 1000e^{0.6} \approx 1822$$
4. Final result: After 72 hours, the culture has approximately 1822 bacteria.

## Common pitfalls

- **Wrong:** Swapping the order of composition to compute $g(f(x))$ instead of $f(g(x))$ when asked for $(f \circ g)(x)$.
  - Why it fails: Students confuse the order of notation, forgetting the function closest to $x$ is the inner function evaluated first.
  - Correct: Always translate $(f \circ g)(x)$ explicitly to $f(g(x))$ before starting any calculation, and mark $g$ as the inner function.
- **Wrong:** Simplifying the composite function first, then finding the domain from the simplified expression, ignoring restrictions from the inner function.
  - Why it fails: Simplification can cancel terms that introduced domain restrictions, leading to incorrectly including disallowed inputs.
  - Correct: Find the domain step-by-step: first find all $x$ allowed in the inner function, then filter that set to only $x$ where the inner output is allowed in the outer function.
- **Wrong:** Applying the inverse composition identity $e^{\ln x} = x$ to negative inputs of $\ln x$.
  - Why it fails: Students memorize the identity without remembering the domain restriction on the logarithm.
  - Correct: Before applying $b^{\log_b x} = x$, confirm the input to the logarithm is positive, and exclude any negative inputs from your result.
- **Wrong:** Claiming composition is commutative, so $(f \circ g)(x) = (g \circ f)(x)$ for all functions $f, g$.
  - Why it fails: Students confuse composition with multiplication of functions, which is commutative.
  - Correct: Always assume $f \circ g \neq g \circ f$ unless you prove it for the specific functions given.
- **Wrong:** When simplifying $e^{2 \ln x}$, writing the result as $2x$ instead of $x^2$.
  - Why it fails: Students reverse the power rule $\ln x^a = a \ln x$, misapplying the coefficient as a multiplicative factor instead of an exponent.
  - Correct: Move the coefficient inside the logarithm as an exponent first: $a \ln x = \ln x^a$, then apply the inverse identity, so $e^{a \ln x} = x^a$.
- **Wrong:** For a composite $f(g(x))$ where $g(x)$ is a logarithm, forgetting that the argument of the inner logarithm must be positive in addition to any restrictions on the output of $g$ for the outer function.
  - Why it fails: Students only check the outer function's restrictions, forgetting the inner function already has a domain restriction.
  - Correct: Always check the domain of the inner function first before checking outer function restrictions.

## Cheatsheet

| Category | Formula/Rule | Notes |
| --- | --- | --- |
| Composition Notation | $(f \circ g)(x) = f(g(x))$ | $g$ is inner (evaluate first); $f$ is outer. Usually $f \circ g \neq g \circ f$ |
| Evaluating Composite | Work inside out | Evaluate inner $g(x)$ first, substitute result into outer $f$ |
| Domain of Composite | Domain = $\{x \in \text{dom}(g) \mid g(x) \in \text{dom}(f)\}$ | Check inner domain first, then outer; do not simplify before finding domain |
| Inverse Composition 1 | $(f \circ f^{-1})(x) = x$ | Only valid for $x$ in the domain of $f^{-1}$ |
| Inverse Composition 2 | $(f^{-1} \circ f)(x) = x$ | Only valid for $x$ in the domain of $f$ |
| Exponential-Log Inverse 1 | $b^{\log_b x} = x$ | Only for $x>0$, $b>0, b \neq 1$ |
| Exponential-Log Inverse 2 | $\log_b(b^x) = x$ | Valid for all real $x$ |
| Simplifying Composites | $e^{a \ln x} = x^a$ | Coefficient becomes an exponent, not a multiplicative factor |

## What's next

Mastering composition of functions is a critical prerequisite for all remaining topics in AP Precalculus Unit 2, and for the entire course. You will apply the composition skills and inverse identities covered here to solve exponential and logarithmic equations, where simplifying composite expressions is required to isolate the target variable. You will also use composition regularly when building real-world models that involve multiple chained transformations, such as unit conversions or multi-step growth problems. Beyond AP Precalculus, composition is the foundational concept for the chain rule in differential calculus, a core topic in AP Calculus AB and BC. Without mastering the order of composition and domain rules here, you will struggle with these more advanced topics.

- [Inverse Functions](https://www.owlsprep.com/study/ap-precalculus-u2-inverse-functions/)
- [Logarithmic expressions](https://www.owlsprep.com/study/ap-precalculus-u2-logarithmic-expressions/)
- [Inverses of exponential functions](https://www.owlsprep.com/study/ap-precalculus-u2-inverses-of-exponential-functions/)

---

From [OwlsPrep](https://www.owlsprep.com) — free study guides for A-Level, IB, AP and IGCSE, written against the official syllabus. Canonical page: https://www.owlsprep.com/study/ap-precalculus-u2-composition-of-functions/
