A clothing store takes 20 percent off a jacket, and then you use a 10 dollar coupon. Does it matter which happens first? A factory converts raw material into parts, and then parts into finished products. Each of these is a chain of processes in which the output of one step becomes the input of the next. In math, chaining functions this way is called composition, and it is a powerful way to build complex relationships from simple ones.
This article covers Topic 24.3: Composition of Functions in Unit 24, Algebra 2: Functions. The topic asks you to evaluate and write composite functions, determine their domains, and decompose functions into simpler parts.
By the end, you should be able to:
- Read and interpret composite function notation.
- Evaluate composite functions numerically, from tables, and from graphs.
- Write a composite function as a single expression.
- Determine the domain of a composite function and decompose functions.
Composition Notation
The composition of \(f\) and \(g\), written \((f\circ g)(x)\), means \(f(g(x))\): apply \(g\) first, then apply \(f\) to the result. Read it as “\(f\) of \(g\) of \(x\).” The function written closest to \(x\) acts first.

Evaluating Composite Functions
Work from the inside out.
Worked example 1: Let \(f(x)=2x+1\) and \(g(x)=x^{2}-3\). Find \(f(g(2))\) and \(g(f(2))\).
- \(g(2)=4-3=1\), so \(f(g(2))=f(1)=2(1)+1=3\).
- \(f(2)=5\), so \(g(f(2))=g(5)=25-3=22\).
The results differ, which shows that composition is generally not commutative: \(f\circ g\) and \(g\circ f\) are usually different functions.
Composition from Tables and Graphs
The same inside-out process works with tables and graphs. If a table shows \(g(4)=-1\) and a graph shows \(f(-1)=6\), then \(f(g(4))=6\). Find the inner value first, then use it as the input for the outer function.

Writing a Composite Expression
To write \(f(g(x))\) as a single expression, substitute the entire expression for \(g(x)\) wherever \(x\) appears in \(f\).
Worked example 2: With \(f(x)=2x+1\) and \(g(x)=x^{2}-3\), find \(f(g(x))\) and \(g(f(x))\).
- \(f(g(x))=2(x^{2}-3)+1=2x^{2}-5\).
- \(g(f(x))=(2x+1)^{2}-3=4x^{2}+4x+1-3=4x^{2}+4x-2\).
Check with \(x=2\): \(2(4)-5=3\) and \(4(4)+8-2=22\). Both match worked example 1.
Why does this matter? Using parentheses when substituting is essential. Writing \(2x^{2}-3+1\) instead of \(2(x^{2}-3)+1\) is a common error that changes the answer.
A Real-World Example
Worked example 3: A jacket costs \(x\) dollars. Let \(d(x)=0.8x\) represent a 20 percent discount and \(c(x)=x-10\) represent a 10 dollar coupon. Compare \(c(d(x))\) and \(d(c(x))\) for a 100 dollar jacket.
- \(c(d(100))=c(80)=70\) dollars (discount first, then coupon).
- \(d(c(100))=d(90)=72\) dollars (coupon first, then discount).
- Applying the discount first saves 2 more dollars.
Domain of a Composite Function
The domain of \(f(g(x))\) includes only inputs \(x\) that are in the domain of \(g\) and whose outputs \(g(x)\) are in the domain of \(f\).
For example, let \(f(x)=\sqrt{x}\) and \(g(x)=x-5\). Then \(f(g(x))=\sqrt{x-5}\). Because the square root requires a nonnegative input, \(x-5\ge 0\), so the domain is \(x\ge 5\).
With \(f(x)=\frac{1}{x}\) and \(g(x)=x+2\), \(f(g(x))=\frac{1}{x+2}\), so \(x\neq-2\).
Why does this matter? Simplifying a composite expression can hide restrictions. Always check what the inner function produces and whether the outer function can accept it.
Decomposing Functions
Sometimes you need to work backward and express a function as a composition. For \(h(x)=(3x-1)^{4}\), let the inner function be \(g(x)=3x-1\) and the outer function be \(f(x)=x^{4}\). Then \(h(x)=f(g(x))\). Decomposition is a key skill in calculus, where it is used with the chain rule.
Composition and Inverses
When \(f\) and \(g\) are inverses, composing them in either order returns the original input: \(f(g(x))=x\) and \(g(f(x))=x\). This property is the standard test for whether two functions are inverses.

Composing a Function with Itself
A function can be composed with itself. If \(f(x)=2x+1\), then \(f(f(x))=2(2x+1)+1=4x+3\). Repeated composition models processes that repeat, such as a population that grows by the same rule each year or an account that receives the same treatment each month. Evaluating \(f(f(f(1)))\) step by step gives \(f(1)=3\), \(f(3)=7\), and \(f(7)=15\). Patterns like this are the basis of sequences defined by recursion, which you will see later in the course.
Composition in Context
Composite functions are common whenever one quantity depends on another that itself depends on a third. For example, the area of a circular oil spill depends on its radius, \(A(r)=\pi r^{2}\), and the radius depends on time, \(r(t)=3t\). The composite \(A(r(t))=\pi(3t)^{2}=9\pi t^{2}\) gives the area directly as a function of time. Building composite functions like this lets you answer questions such as “How large is the spill after 4 hours?” in one step: \(9\pi(16)=144\pi\) square units. Describing what each function’s input and output represent, including units, keeps the composition meaningful and helps you avoid mixing up the order.
Test-Taking Strategies
Mnemonic Devices and Memory Shortcuts
“Inside first.” In \(f(g(x))\), the function closest to \(x\) goes first.
Cross-Topic Connections
- Function evaluation is reviewed in ACT Math Topic 3.1: Function Notation and Evaluation.
- Domain restrictions are covered in ACT Math Topic 3.2: Domain and Range.
- Function notation basics are explained in Algebra 1 Topic 4.2: Function Notation.
- Piecewise rules can be composed too, as shown in Topic 24.2: Piecewise Functions.
Common Question Formats
- Evaluate a composite function at a number.
- Write a composite function as one expression.
- Evaluate a composition using a table or graph.
- Find the domain of a composite function.
Frequent Student Mistakes
- Applying the functions in the wrong order.
- Forgetting parentheses when substituting an expression.
- Ignoring domain restrictions from the inner function.
Test-Day Shortcuts
To check a composite expression, plug a simple number into both the expression and the step-by-step composition. The results must match.
Time Management Tips
Composition skills appear on Algebra 2 unit tests and standardized tests such as the SAT and ACT. Numerical composition questions are quick; expression questions need careful algebra.