How do I compose two functions without mixing up the order?
Quick answer
In f(g(x)), apply g first, then feed its result into f. In g(f(x)), apply f first, then feed its result into g. The function written inside the parentheses is the first one you evaluate. For example, if f(x)=x² and g(x)=x+2, then f(g(x))=(x+2)², while g(f(x))=x²+2; these are different expressions.
The question, the details, the next step.
A practical checklist
Circle the inner function in the requested composition.
Evaluate the inner function before using the outer one.
Substitute the complete inner output, keeping necessary parentheses.
Simplify and compare the two orders separately if both are requested.
Check that the inner output is allowed by the outer function’s domain.
A few more useful answers
Does f(g(x)) mean multiply f by g?
No. It means apply g to x, then use that output as the input to f. The composition symbol is also written (f∘g)(x). [S1]
Can the two orders give the same answer?
They can for some functions or inputs, but they generally give different results. Compute each order separately rather than assuming they match. [S1]
Why do I need parentheses after substitution?
Parentheses show that the entire inner output is being used as the outer function’s input. For example, squaring x+2 gives (x+2)², not x²+2.
Sources
References used for this guide.
- [S1] OpenStax Algebra and Trigonometry 2e, Section 3.4: Composition of Functions openstax.org · Checked
