1. Find f(g(x)) and g(f(x)) for f(x)=3x−2 and g(x)=x².
- f(g(x))=3x²−2.
- g(f(x))=(3x−2)²=9x²−12x+4.
- At x=2 the answers are 10 and 16; order changes the result.
Maths · Algebra / Precalculus · suggested level; school sequences vary
Double a number, then add 3. Now reverse that order. Starting with 5 gives 13 one way and 16 the other. A composition records which machine acts first.
Start here
For (f ∘ g)(x), apply g first, then f. Keep inputs that are allowed by g and whose g-output is allowed by f.
Original BananaLearn guide · 7 November 2026
On a narrow screen, swipe the diagram or open it full size.
A composition feeds one function’s output into another function. If g changes a measurement and f then converts that result, the complete rule is f(g(x)), also written (f ∘ g)(x). Read from the inside out. The small circle means composition, not multiplication.
Define the functions before substituting. With f(x)=2x and g(x)=x+3, f(g(5))=f(8)=16, while g(f(5))=g(10)=13. They use the same two rules but describe different journeys.
If f(x)=x²−4 and g(x)=3x+1, replacing f’s input gives f(g(x))=(3x+1)²−4. The entire expression 3x+1 takes the place of x. Squaring only the first term would change the rule. Expand to 9x²+6x−3 only if that form is useful.
Leaving a composition unexpanded can make its meaning easier to see. It also preserves which restrictions arose in the inside function. Algebraic simplicity and a correct domain are separate checks.
In general, f(g(x)) and g(f(x)) need not agree. A numerical counterexample is enough to disprove equality. To establish equality as functions, both formulas and domains must match for every allowed input.
Some pairs do commute: adding 2 and adding 5 give x+7 in either order. That special case does not justify swapping an arbitrary pair. Write the two expressions independently before comparing them.
On a narrow screen, swipe the diagram or open it full size.
First require x to belong to g’s domain. Next require g(x) to belong to f’s domain. For f(x)=√x and g(x)=x−4, the composition √(x−4) needs x≥4. But g(f(x))=√x−4 needs only x≥0.
For a fraction, exclude any zero denominator. For a real square root, require its radicand to be non-negative. When these conditions occur together, solve them together rather than accepting only the easiest one.
Let g(x)=1/x and f(x)=1/x, each with zero excluded. Their composition simplifies to 1/(1/x)=x, but its domain is still x≠0. The unrestricted identity function x on all real numbers is a different function.
Retain restrictions from the original journey beside each simplification. At x=0 the first machine cannot produce an output, so there is nothing for the second machine to undo.
If g(2)=7 and f(7)=10, then f(g(2))=10. To find g(f(2)), you would need f(2) and then the corresponding g-value; the first pair of facts is not enough.
In finite tables, check that the intermediate result appears among the second function’s allowed inputs. A blank or missing entry is not automatically zero. Record it as unavailable from the supplied information.
The rule h(x)=√(5x−2) can be made from g(x)=5x−2 followed by f(u)=√u. This decomposition reveals the domain condition 5x−2≥0, giving x≥2/5. Other decompositions are possible.
Choose pieces that make the next task easier. For evaluation, a number journey may suffice. For domain, isolate the operation with restrictions. Later, this habit helps when working with inverse functions and calculus.
Use one easy allowed value to compare your composite formula with the original two-stage calculation. Then check a boundary value and a forbidden input where relevant. A few numerical checks catch errors but do not prove an identity.
If brackets are the difficulty, revisit substitution and expansion. If restrictions disappear during cancellation, focus on domain. Parents can ask the learner to name the intermediate result rather than supplying the final rule.
See the reasoning
Try, explain, check
Try each task before opening its explanation. These are original BananaLearn questions, not official exam or past-paper questions. Where several answers can work, the explanation gives the criteria.
10
g(3)=6, then f(6)=10.
14
f(3)=7, then double it.
(x−5)²
The complete input x−5 is squared.
x²−5
Apply the square before subtracting 5.
x≥−3
Require 2x+6≥0.
All real x except −3 and 3
Both values make the denominator zero.
−1
The g-output is the required f-input.
No
Neither f(4) nor its g-output has been supplied.
No
The first reciprocal is undefined there.
g(x)=2x+1, f(u)=u³
Then f(g(x)) is the stated rule.
Yes, on the real numbers
Both orders give x+9 with the same domain.
No
An identity must agree at every allowed input, with matching domains.
Copy these headings and fill them for one worked task, then for a fresh attempt. Use your own evidence rather than copying the model answer.
Explore BananaLearn’s games, learning features and one-to-one tutoring. Maths is our priority; English and Science tutoring are also available. Bring a recent example of schoolwork when checking teaching fit.
Original BananaLearn explanations, examples, illustrations and practice. Source facts checked 7 November 2026. Suggested levels are learning guides, not a claim that every board or textbook uses the same sequence.
How we prepare guides · Report a correction
Share the complete guide: https://bananalearn.com/learn/composite-functions-order-and-domain.html