AP Precalculus · Unit 2 · Topic 2.7

    2.7 Composition of Functions

    Reviewed by P V Satish, Senior Faculty of Science and Academic Consultant · PG Life Sciences, PGD Biotechnology · 20+ years teaching NEET and AP · Special interest in biotechnology, biochemistry and the basics of physics
    Updated

    In short

    The composition f(g(x))f(g(x)), also written (f∘g)(x)(f \circ g)(x), uses the output of gg as the input of ff: work from the inside out. Order matters: f(g(x))f(g(x)) and g(f(x))g(f(x)) are usually different. The identity function I(x)=xI(x) = x leaves any function unchanged when composed with it. A complicated function can be decomposed into simpler functions composed together.

    What you need to know

    • Evaluate a composition from formulas, tables and graphs.
    • Write a formula for a composite function and explain why order matters.
    • Use the identity function in compositions.
    • Decompose a function into a composition of simpler functions.

    Inside out

    In f(g(x))f(g(x)), first apply gg to xx, then apply ff to the result. With f(x)=x2f(x) = x^2 and g(x)=x+3g(x) = x + 3:

    • f(g(2))=f(5)=25f(g(2)) = f(5) = 25
    • g(f(2))=g(4)=7g(f(2)) = g(4) = 7
    • As formulas: f(g(x))=(x+3)2f(g(x)) = (x + 3)^2 and g(f(x))=x2+3g(f(x)) = x^2 + 3.

    The two orders give different functions: squaring then adding 3 is not the same as adding 3 then squaring. In context, the order follows the story. If gg converts a temperature from Celsius to Fahrenheit and ff gives the number of ice creams sold at a Fahrenheit temperature, only f(g(c))f(g(c)) makes sense.

    From tables and graphs

    Values of f and g
    x1234
    f(x)3412
    g(x)2441

    To find f(g(1))f(g(1)): g(1)=2g(1) = 2, then f(2)=4f(2) = 4. To find g(f(3))g(f(3)): f(3)=1f(3) = 1, then g(1)=2g(1) = 2. With a graph, read the inner value off one graph and use it as the input on the other. If the inner output is not in the outer function's domain, the composition is undefined there: f(g(2))=f(4)=2f(g(2)) = f(4) = 2 works, but if gg had given 5, f(5)f(5) would not be in the table.

    The identity function and decomposition

    The identity function I(x)=xI(x) = x returns its input unchanged, so f(I(x))=f(x)f(I(x)) = f(x) and I(f(x))=f(x)I(f(x)) = f(x). Topic 2.8 uses it to define inverses: f(f−1(x))=xf(f^{-1}(x)) = x, the identity.

    Decomposing reverses composition: spot an inner expression and an outer operation. h(x)=2x−1h(x) = \sqrt{2x - 1} is f(g(x))f(g(x)) with g(x)=2x−1g(x) = 2x - 1 inside and f(x)=xf(x) = \sqrt{x} outside. k(x)=3x2k(x) = 3^{x^2} is f(g(x))f(g(x)) with g(x)=x2g(x) = x^2 and f(x)=3xf(x) = 3^x. Decomposition is the skill that makes transformations and, later, the chain rule in calculus work.

    Worked example in context. A shop converts a price in dollars to rupees with R(d)=84dR(d) = 84d and then adds a delivery charge with T(r)=r+150T(r) = r + 150. The total for a 20-dollar book is T(R(20))=T(1680)=1830T(R(20)) = T(1680) = 1830 rupees. The other order, R(T(20))R(T(20)), would add 150 to the dollar price before converting, which gives a very different and meaningless number. When a question gives a context, always check that the output of the inner function is the kind of quantity the outer function expects as its input.

    Key terms

    Composition
    (f∘g)(x)=f(g(x))(f \circ g)(x) = f(g(x)): apply g, then f.
    Inner and outer function
    In f(g(x)), g is the inner function and f the outer function.
    Identity function
    I(x) = x; composing with it leaves a function unchanged.
    Decomposition
    Writing a function as a composition of simpler functions.

    Common mistakes

    • Multiplying instead of composing: f(g(x))=f(x)⋅g(x)f(g(x)) = f(x) \cdot g(x).

      Substitute g(x) into f.

    • Working outside in.

      Evaluate the inner function first.

    • Assuming f(g(x))=g(f(x))f(g(x)) = g(f(x)).

      Order usually matters; check both.

    How this topic is tested

    • Write the intermediate value: f(g(1)) = f(2) = 4.
    • When decomposing, name both functions clearly.
    • Check the domain of a composite at the inner and outer step.

    Practice questions

    Original AP-style multiple-choice questions. Pick an answer to see the explanation.

    1. Question 1 · MP 1 · Procedural and Symbolic Fluency

      If f(x)=2x−1f(x) = 2x - 1 and g(x)=x2+1g(x) = x^2 + 1, what is f(g(3))f(g(3))?

    2. Question 2 · MP 2 · Multiple Representations

      Using the table in this lesson, what is g(f(4))g(f(4))?

    3. Question 3 · MP 1 · Procedural and Symbolic Fluency

      Which is g(f(x))g(f(x)) for f(x)=x2f(x) = x^2 and g(x)=x+3g(x) = x + 3?

    4. Question 4 · MP 2 · Multiple Representations

      h(x)=(5x+2)3h(x) = (5x + 2)^3 is written as f(g(x))f(g(x)). Which pair works?

    5. Question 5 · MP 1 · Procedural and Symbolic Fluency

      What is the domain of f(g(x))f(g(x)) for f(x)=1xf(x) = \frac{1}{x} and g(x)=x−6g(x) = x - 6?

    Free-response practice

    Write your answer first, then mark it against the scoring guide.

    Function Concepts (short) · 4 points

    The functions ff and gg are given by the table in this lesson: f(1)=3f(1) = 3, f(2)=4f(2) = 4, f(3)=1f(3) = 1, f(4)=2f(4) = 2; g(1)=2g(1) = 2, g(2)=4g(2) = 4, g(3)=4g(3) = 4, g(4)=1g(4) = 1.

    1. (a) Find f(g(3))f(g(3)) and g(f(3))g(f(3)).
    2. (b) Find all x in {1,2,3,4}\{1, 2, 3, 4\} for which f(g(x))=4f(g(x)) = 4, and explain your reasoning.

    Connected topics

    Frequently asked questions

    Is \((f \circ g)(x)\) the same as \(f(g(x))\)?

    Yes. The circle notation means 'f after g': apply g first.

    Can I compose a function with itself?

    Yes. f(f(x))f(f(x)) applies f twice; for f(x)=2xf(x) = 2x, f(f(x))=4xf(f(x)) = 4x.

    Why is decomposition useful?

    It breaks a hard function into familiar pieces, which makes transformations, inverses and (in calculus) the chain rule straightforward.

    How this shows up on the exam42 multiple-choice questions (29 without a calculator) and 4 free-response questions of 6 points. See what each one asks you to do.Full-length AP Precalculus practice examsUnit 2 is one of the 3 units on the exam. Two timed exams in the 2027 format (42 MCQ + 4 FRQ, calculator and no-calculator parts), with explanations, scoring guides and an estimated 1–5 score. $14.99 · try 5 questions free.

    Free Unit 2 cheat sheet

    Every topic in Unit 2: Exponential and Logarithmic Functions on a few printable pages: the core idea, key terms, the two traps students fall into and what the exam asks.

    We'll use your email to tell you when new AP Precalculus practice material is ready. No spam, and we'll delete it if you ask.

    Free Unit 2 practice test: 75 questions with explanations

    All topics in Unit 2: Exponential and Logarithmic Functions

    1. 2.1 Change in Arithmetic and Geometric Sequences
    2. 2.2 Change in Linear and Exponential Functions
    3. 2.3 Exponential Functions
    4. 2.4 Exponential Function Manipulation
    5. 2.5 Exponential Function Context and Data Modeling
    6. 2.6 Competing Function Model Validation
    7. 2.7 Composition of Functions
    8. 2.8 Inverse Functions
    9. 2.9 Logarithmic Expressions
    10. 2.10 Inverses of Exponential Functions
    11. 2.11 Logarithmic Functions
    12. 2.12 Logarithmic Function Manipulation
    13. 2.13 Exponential and Logarithmic Equations and Inequalities
    14. 2.14 Logarithmic Function Context and Data Modeling
    15. 2.15 Semi-log Plots

    Other units in AP Precalculus

    AP® is a trademark registered by College Board, which is not affiliated with, and does not endorse, this website.