A composition of functions applies one function to the output of another. The composite f(g(x)), also written (f ∘ g)(x), means: find g(x) first, then put that result into f. If g(x) = x + 1 and f(x) = x2, then f(g(2)) = f(3) = 9. Order matters.
In Spanish
composición de funciones
Also called
composite function, function composition, f of g of x, f circle g
In f(g(3)) the inner function g acts first. Swapping the order gives g(f(3)) = 19 instead of 49.
Formal definition and notation
For functions f and g, the composite function f ∘ g is defined by (f ∘ g)(x) = f(g(x)). Its domain is the set of all x in the domain of g for which g(x) is in the domain of f. In general f ∘ g ≠ g ∘ f, so composition is not commutative, although it is associative: f ∘ (g ∘ h) = (f ∘ g) ∘ h.
Symbol
Read it as
Meaning
(f ∘ g)(x)
f composed with g of x, or f circle g of x
the same as f(g(x))
f(g(x))
f of g of x
g is the inner function (done first), f the outer
g(f(x))
g of f of x
the reverse order: f first, then g
Key facts
Read f(g(x)) from the inside out: the function nearest x acts first.
Usually f(g(x)) ≠ g(f(x)). With f(x) = x2 and g(x) = 2x + 1: f(g(3)) = 49 but g(f(3)) = 19.
Composition is not multiplication: f(g(x)) is different from f(x) · g(x).
The domain of f ∘ g keeps only inputs where g(x) is allowed in f.
A function and its inverse undo each other: f(f−1(x)) = x.
Work from the inside out. To find a formula, replace every x in f with the whole expression g(x), in parentheses.
Try it: g first, then f
Interactive
This machine is the composite f(g(x)) with g(x) = 2x + 1 and f(x) = x2: it multiplies by 2, adds 1, then squares. It has already run 3 (output 49). Try other inputs and check each by hand: first g, then f.
This interactive needs JavaScript. The worked examples below show the same ideas step by step.
Composition of Functions examples, step by step
Example 1: Evaluate a composite at a number
Warm-up
Let f(x) = x + 5 and g(x) = 3x. Find f(g(2)).
Inner first: g(2) = 3 · 2 = 6.
Then the outer function: f(6) = 6 + 5 = 11.
Answer: f(g(2)) = 11
Example 2: Formulas in both orders
Core
Let f(x) = x2 − 1 and g(x) = x + 3. Find f(g(x)) and g(f(x)).
A store takes 10 dollars off a price p: d(p) = p − 10. Sales tax multiplies a price by 1.08: t(p) = 1.08p. The tax is charged after the discount. What does a 60 dollar item cost?
Tax after discount means t(d(p)): d is inside.
Discount first: d(60) = 50.
Then tax: t(50) = 1.08 × 50 = 54.
Compare d(t(60)) = 64.80 − 10 = 54.80: the order changes the price.
Answer: The item costs 54 dollars.
Common mistakes
✗ Mistakef(g(x)) with f(x) = x2, g(x) = x − 1: x2 − 1.
✓ Insteadf(g(x)) = (x − 1)2 = x2 − 2x + 1.
x2 − 1 is g(f(x)), the other order. In f(g(x)), the whole g(x) gets squared.
✗ Mistakef(g(x)) = f(x) · g(x).
✓ Insteadf(g(x)) means g(x) is the input of f.
Composition chains two functions; multiplying their outputs is a different operation, (fg)(x).
Substituteg(x) in parentheses so the whole expression is doubled, not just the x.
Not to be confused with
Composition of Functionsvs.Product of functions
(fg)(x) = f(x) · g(x) multiplies outputs; (f ∘ g)(x) = f(g(x)) feeds one output into the other function. With f(x) = x + 1, g(x) = 2x at x = 3: product 24, composition 7.
Composition of Functionsvs.Inverse function
An inverse undoes a function, and composing them gives back the input: f(f−1(x)) = x. A general composition just chains two functions.
Quick check: 3 questions
Question 1 of 3
If f(x) = 2x and g(x) = x − 4, what is f(g(10))?
Show answer and explanation
Answer: B.g(10) = 6, then f(6) = 12. 16 is g(f(10)), the reverse order; 120 multiplies f(10) · g(10); 6 stops after g.
Question 2 of 3
If f(x) = x2 and g(x) = x − 1, what is f(g(x))?
Show answer and explanation
Answer: C. Replace x in f with g(x) = x − 1: (x − 1)2. x2 − 1 is g(f(x)), and x3 − x2 is the product f(x) · g(x).
Question 3 of 3
Using h(x) = √x and k(x) = x + 9, what is h(k(16))?
Show answer and explanation
Answer: A.k(16) = 25, and h(25) = 5. 13 is k(h(16)) = 4 + 9, 25 stops after k, and 7 adds the square roots of 16 and 9.
Composition of Functions: frequently asked questions
What does f(g(x)) mean?
It means “f of g of x”: take an input x, apply g to it, and then apply f to the result. The output of g becomes the input of f. For g(x) = x − 2 and f(x) = 5x, f(g(7)) = f(5) = 25. The notation (f ∘ g)(x) means exactly the same thing.
Is f(g(x)) the same as g(f(x))?
Usually not. The order of the steps changes the answer. With f(x) = x + 3 and g(x) = x2, f(g(2)) = 4 + 3 = 7, while g(f(2)) = 52 = 25. They agree only in special cases, such as when one function is the inverse of the other or when both just add constants.
How do you find the domain of a composite function?
Start with the domain of the inner function g, then remove any x whose output g(x) is not allowed in f. For f(x) = √x and g(x) = x − 5, the composite √x − 5 needs x − 5 ≥ 0, so the domain is x ≥ 5, even though g itself accepts every number.
Updated November 2026·Reviewed by the Effortless Math team·Standards: CCSS HSF-BF.A.1.c
Cite this entry
Effortless Math Team. “Composition of Functions.” Effortless Math Dictionary. Updated November 2026. https://www.effortlessmath.com/math-dictionary/composition-of-functions/
Flashcard
TermComposition of Functionsf(g(x))
DefinitionFeeding the output of one function into another: do the inner function first. With g(x) = x + 1, f(x) = x2: f(g(2)) = 9.
DomainThe domain of a function is the set of all input values (usually x-values) the function can accept. Unless a problem says otherwise, it is every real number except values that would divide by zero or take an even root of a negative number. On a graph, the domain is how far the graph reaches left and right.Functions · Grade 8, Algebra 1, Algebra 2MultiplicationMultiplication is the operation that combines equal groups to find a total. The fact 4 × 6 = 24 means 4 groups of 6, or 6 + 6 + 6 + 6. The numbers you multiply are called factors, and the result is the product. Order does not matter: 6 × 4 is also 24.Operations · Grade 2, Grade 3, Grade 4DerivativeA derivative measures how fast a function’s output changes at one exact input: its instantaneous rate of change. On a graph it is the slope of the tangent line at that point. The derivative of f(x) = x2 is f′(x) = 2x, so at x = 3 the curve is rising with slope 6.Calculus · CalculusChain RuleThe chain rule is the rule for the derivative of a composite function: if y = f(g(x)), then y′ = f′(g(x)) · g′(x). Differentiate the outer function, leave the inner function inside, then multiply by the derivative of the inner function. For (x2 + 1)3, the derivative is 3(x2 + 1)2 · 2x.Calculus · CalculusSubstituteSubstitute means to replace a variable with a number or with an equal expression. In 4x − 1, substituting 3 for x gives 4(3) − 1. You substitute to evaluate expressions, to check whether a number is a solution, and to solve systems of equations by swapping in an equal expression.Algebra · Grade 6, Grade 7, Grade 8NumberA number is an amount or value used to count, measure, order and compare. We write numbers with digits (7), words (seven) or other symbols, but the number itself is the amount: 7 dots, the word seven and the numeral 7 all show the same number. Numbers include whole numbers, fractions, decimals and negatives.Number System · Kindergarten, Grade 1, Grade 2FunctionA function is a rule that gives exactly one output for each input. If you put in one x-value, a function gives back one y-value. In f(x) = 2x + 1, the input 3 gives the output 7. Two inputs may share an output, but one input can never have two different outputs.Functions · Grade 8, Algebra 1, Algebra 2InputAn input is the value you put into a function or a rule. The rule acts on the input to produce the output: for f(x) = x + 2, the input 5 gives the output 7. For many functions, the input is the x-value. In an input-output table, the inputs fill the first column.Functions · Grade 6, Grade 7, Grade 8OutputAn output is the value a function or rule produces from a given input. You put a number in, apply the rule, and the result that comes out is the output. For y = 2x, the input 3 gives the output 6. In an input-output table the output sits in the second column.Functions · Grade 6, Grade 7, Grade 8Domain and RangeDomain and range describe a function: the domain is the set of all inputs it accepts, and the range is the set of all outputs it produces. For the points (1, 4) and (2, 5), the domain is {1, 2} and the range is {4, 5}. Restrictions usually come from division by zero or square roots of negatives.Functions · Grade 8, Algebra 1, Algebra 2Function NotationFunction notation is the way of writing a function as f(x), read “f of x”: f names the function, x is the input, and f(x) is the output. Writing f(x) = 2x + 5 means the same as y = 2x + 5, and f(3) = 11 says that the input 3 gives the output 11.Functions · Grade 8, Algebra 1, Algebra 2Inverse FunctionAn inverse function undoes another function: if f sends a to b, its inverse f−1 sends b back to a. For f(x) = 2x + 3, the inverse is f−1(x) = x − 32. Only one-to-one functions have inverses, and the graph of f−1 is the mirror image of f across y = x.Functions · Algebra 2, PrecalculusTransformation of FunctionsTransformation of functions is changing a function’s rule so that its graph moves, flips or resizes. Adding k outside, f(x) + k, shifts the graph up; replacing x with x − h shifts it right; −f(x) reflects it over the x-axis; and a · f(x) stretches it vertically. The basic graph being changed is the parent function.Functions · Algebra 1, Algebra 2, PrecalculusPiecewise FunctionA piecewise function is a function defined by two or more formulas, each used on its own interval of the domain. To find an output, first check which interval the input belongs to, then use that piece’s formula. Absolute value, step functions and tiered prices are common examples.Functions · Algebra 1, Algebra 2, Precalculus