Skip to main content

2.7 Composition of Functions

add to ChatGPT
Verified for the 2027 examUpdated October 2026Fiveable Content Team
Fiveable

📈AP Precalculus Unit 2 Review

QR code for AP Precalculus practice questions

2.7 Composition of Functions

A composite function combines two functions so that the output of one becomes the input of the other, written as f(g(x))f(g(x)) or (f∘g)(x)(f \circ g)(x). You work the inside function first, then feed that result into the outside function.

Composition lets you connect two quantities that have no single direct formula, and the exam also asks you to break a complicated function into simpler inside and outside pieces. It sets up the inverse and logarithm work later in this unit, since a function and its inverse compose to give the identity function.

Applying Inside Functions First and Checking Domains

  • (f∘g)(x)=f(g(x))(f \circ g)(x) = f(g(x)) means apply gg first, then use that output as the input for ff.
  • The domain of f∘gf \circ g is limited to inputs of gg whose outputs are valid inputs for ff.
  • Composition is not commutative: f(g(x))f(g(x)) and g(f(x))g(f(x)) are usually different.
  • The identity function f(x)=xf(x) = x leaves any function unchanged: g(f(x))=f(g(x))=g(x)g(f(x)) = f(g(x)) = g(x).
  • To build f(g(x))f(g(x)) analytically, substitute g(x)g(x) for every xx in ff.
  • You can also build f∘gf \circ g from tables or graphs by reading outputs of gg as inputs of ff.

What Composition of Functions Means

A composite function is built from two or more simpler functions chained together. The notation f(g(x))f(g(x)), also written (f∘g)(x)(f \circ g)(x), tells you to apply gg to xx first, then use that result as the input to ff.

The key idea is that the output of the inside function becomes the input of the outside function. So in f(g(x))f(g(x)), you find g(x)g(x) first, then plug that value into ff.

For example, with f(x)=x2f(x) = x^2 and g(x)=2x+1g(x) = 2x + 1:

f(g(x))=(2x+1)2f(g(x)) = (2x + 1)^2

Here g(x)=2x+1g(x) = 2x + 1 replaces the xx inside ff, and then the whole thing is squared.

Domain of a Composite Function

The domain of f∘gf \circ g is restricted to the input values of gg whose outputs are valid inputs for ff. In other words, an xx has to be allowed in gg, and then g(x)g(x) has to be allowed in ff. Watch for inside functions that create restrictions, such as a square root that needs a nonnegative input, a denominator that cannot be zero, or a logarithm that needs a positive input.

Notation and Properties

Order Matters

The composition of functions is not commutative, so f(g(x))f(g(x)) and g(f(x))g(f(x)) are typically different functions.

Take f(x)=x2f(x) = x^2 and g(x)=2x+1g(x) = 2x + 1:

  • f(g(x))=(2x+1)2f(g(x)) = (2x + 1)^2
  • g(f(x))=2x2+1g(f(x)) = 2x^2 + 1

These are different functions with different outputs, so you cannot just swap the order.

The Identity Function

The identity function f(x)=xf(x) = x returns its input unchanged. When you compose it with any function gg, you get gg back:

g(f(x))=f(g(x))=g(x)g(f(x)) = f(g(x)) = g(x)

This works because f(x)=xf(x) = x does nothing to the input. It behaves like 00 for addition and 11 for multiplication: an identity that leaves the other function alone. For example, composing f(x)=xf(x) = x with g(x)=2x+1g(x) = 2x + 1 just gives 2x+12x + 1 back.

Working with Composite Functions

Building f(g(x)) Analytically

When you have equations for ff and gg, build f(g(x))f(g(x)) by substituting g(x)g(x) for every instance of xx in ff.

For example, with f(x)=x2+3f(x) = x^2 + 3 and g(x)=x2g(x) = x^2:

f(g(x))=(x2)2+3=x4+3f(g(x)) = (x^2)^2 + 3 = x^4 + 3

Every xx in ff became g(x)=x2g(x) = x^2.

Building f(g(x)) from Tables or Graphs

You can also construct f∘gf \circ g numerically or graphically by finding values for (x,f(g(x)))(x, f(g(x))).

  • Numerical: Use a table of values. Read g(x)g(x) from the table, then use that output as an input in the table for ff.
  • Graphical: Read g(x)g(x) off the graph of gg, then go to the graph of ff and read the output at that input value.

This is handy when you only have data or pictures, not equations.

Decomposing a Function

Decomposition is the reverse process: breaking a complicated function into simpler inside and outside pieces. When you decompose correctly, the variable in the inside function should replace each instance of that inside function in the outside function.

For example, h(x)=(2x+1)2h(x) = (2x + 1)^2 can be decomposed as:

  • inside: g(x)=2x+1g(x) = 2x + 1
  • outside: f(x)=x2f(x) = x^2

so that f(g(x))=(2x+1)2=h(x)f(g(x)) = (2x + 1)^2 = h(x). Picking a clean inside function is the key to decomposing well.

Composition and Transformations

Transformations can be viewed as compositions, which connects this topic to function shifts and stretches.

  • An additive transformation that produces translations can be seen as composing g(x)=x+kg(x) = x + k with ff. This shifts the graph horizontally or vertically by a constant amount.
  • A multiplicative transformation that produces dilations can be seen as composing g(x)=kxg(x) = kx with ff. When g(x)=kxg(x) = kx is the inside function, it stretches or shrinks the graph horizontally by a factor of 1/∣k∣1/|k|.

Seeing transformations as compositions helps you predict how the graph of a function changes when you build a new function from it.

Evaluating Composites From the Inside Out

Problem Solving:

  • Read the composition carefully and identify which function is inside. In f(g(x))f(g(x)), gg is the inside function and runs first.
  • To evaluate at a number like f(g(2))f(g(2)), find g(2)g(2) first, then plug that result into ff.
  • For analytic compositions, substitute the entire inside function for every xx in the outside function. Use parentheses so you do not lose exponents or signs.

From Tables and Graphs:

  • With tables, locate the input in the gg column, read its output, then use that output as the input for ff.
  • With graphs, find g(x)g(x) first on the graph of gg, then read ff at that value on the graph of ff.

Common Trap:

  • Do not assume f(g(x))=g(f(x))f(g(x)) = g(f(x)). Order changes the result almost every time.
  • Watch domain restrictions created by the inside function, like negative inputs under a square root or a zero denominator.

Calculator Note: Some multiple-choice and free-response questions allow a graphing calculator and some do not. When work is required, write each substitution step clearly. Clean notation is important for clear exam work and helps you catch algebra mistakes.

Common Misconceptions

  • Misconception: Thinking order does not matter.
    Actually: f(g(x))f(g(x)) and g(f(x))g(f(x)) are usually different functions. Always check which function is on the inside.
  • Misconception: The domain of the composite can be ignored.
    Actually: An input must be valid for gg first, and then g(x)g(x) must be valid for ff. Restrictions from the inside function still apply even if the final formula looks fine.
  • Misconception: Only the first occurrence of xx needs to be substituted.
    Actually: When building f(g(x))f(g(x)), replace every xx in ff with the inside function, not just the first one.
  • Misconception: Parentheses are unnecessary when substituting an inside function before squaring.
    Actually: Writing 2x+12x + 1 without parentheses before squaring leads to wrong results. Keep the inside function grouped.
  • Misconception: Composition is multiplication.
    Actually: f(g(x))f(g(x)) is not f(x)⋅g(x)f(x) \cdot g(x). Composition feeds one output into the next function, it does not multiply the two functions.

Practice Questions for 2.7

1 of 10

The discrete points plotted above represent the terms of a sequence A(n)A(n) for n=1,2,3,4,5n = 1, 2, 3, 4, 5.

The sequence can be modeled by a function A(n)=f(g(n))A(n) = f(g(n)), where f(x)=2xf(x) = 2^x. Which of the following could be an expression for g(n)g(n)?

A.

g(n)=2ng(n) = 2n

B.

g(n)=n2g(n) = n^2

C.

g(n)=n+1g(n) = n + 1

D.

g(n)=n−1g(n) = n - 1

Vocabulary

The following words are mentioned explicitly in the AP® course framework for this topic.

Term

Definition

additive transformation

A transformation of a function involving addition or subtraction, resulting in vertical and horizontal translations.

analytic representation

An algebraic formula or equation that explicitly defines a function.

commutative

A property where the order of operations does not affect the result; composition of functions is not commutative, meaning f ∘ g typically produces a different result than g ∘ f.

composite function

A function formed by combining two or more functions, where the output of one function becomes the input of another function, denoted as f ∘ g or f(g(x)).

composition of functions

A function operation where one function is applied to the output of another function, written as (f ∘ g)(x) = f(g(x)).

decomposed

The process of breaking down a complex function into simpler component functions that can be composed together.

domain

The set of all possible input values for which a function is defined.

function composition

The process of combining two or more functions where the output of one function becomes the input of another function.

graphical representation

A visual representation of a function displayed on a coordinate plane.

horizontal dilation

A transformation that stretches or compresses the graph of a function horizontally by multiplying the input by a constant factor b, written as g(x) = f(bx).

horizontal translation

A transformation that shifts the graph of a function left or right by adding a constant to the input, written as g(x) = f(x + h).

identity function

The function h(x) = x, which serves as the line of reflection between inverse exponential and logarithmic functions.

input value

The x-values or independent variable values used as inputs to a function.

multiplicative transformation

A transformation of a function involving multiplication, resulting in vertical and horizontal dilations.

numerical representation

A representation of a function using tables of values or ordered pairs (x, y).

output value

The y-values or results produced by a function for given input values.

vertical dilation

A transformation that stretches or compresses the graph of a function vertically by multiplying the function by a constant factor a, written as g(x) = af(x).

vertical translation

A transformation that shifts the graph of a function up or down by adding a constant k to the function, written as g(x) = f(x) + k.

See Fiveable more often in Google

Mark Fiveable as a preferred source and Google is more likely to show you our guides in Top Stories, with a "preferred" badge in AI Mode and AI Overviews.

Prefer us on Google