The big idea: A composite function chains two functions together.__LINEBREAK___f(g(x)) means: apply g to x first, then apply f to the result.__LINEBREAK__Think of it as a two-step factory: → Raw material goes into machine g first. → The output of g goes into machine f. → The final product comes out.
- IB notation for "f composed with g"
- the inner function — applied first
- the outer function — applied second
[Diagram: math-composite-function-diagram] - Available in full study mode
- composite function
- A new function formed by applying one function to the output of another.
- inner function (g)
- The function applied first — the one inside the bracket.
- outer function (f)
- The function applied second — the one whose bracket contains g(x).
IB notation: inner function first: f(g(x)): g is inside the brackets → g runs first.__LINEBREAK__f ∘ g: read right to left → g first, then f.__LINEBREAK__A helpful memory trick: "inside out" — the inner function runs first, the outer runs last.
The big idea: When evaluating f(g(a)) for a specific number a:__LINEBREAK___Step 1: Compute the inner value g(a). Step 2: Use that result as the input for f.__LINEBREAK__Never try to do both steps at once — the marks are in the working.
Evaluating f(g(3))
Given f(x) = 2x + 1 and g(x) = x², find f(g(3)).
Step by step
- Inner first: find g(3).
- Now use g(3) = 9 as input for f.
Final answer
f(g(3)) = 19. Always show both steps.
Evaluating g(f(3)) — note the different order
Now find g(f(3)) using the same functions.
Step by step
- Inner first: find f(3) — this time f is the inner function.
- Now apply g to f(3) = 7.
Final answer
g(f(3)) = 49. This is different from f(g(3)) = 19. Order matters.
Do NOT multiply the functions: f(g(x)) does not mean f(x) × g(x).__LINEBREAK__f(x) × g(x) = (2x+1)(x²) = a product.__LINEBREAK__f(g(x)) = f(x²) = 2x² + 1 — a substitution.__LINEBREAK__These are completely different things.
Circle the inner result: When evaluating f(g(a)), circle or box the inner result after Step 1.__LINEBREAK__This prevents confusion about which function you are applying in Step 2.__LINEBREAK__IB gives a method mark for showing the intermediate value — even if Step 2 has an error.
Study smarter, not longer
Most students waste 40% of study time on topics they already know. Our AI tracks your progress and optimizes every minute.
The big idea: Instead of using a number, substitute the whole expression g(x) into f.__LINEBREAK__Replace every x in f's rule with the expression for g(x).__LINEBREAK__Then expand and simplify if asked.
Building f(g(x))
Given f(x) = 2x + 3 and g(x) = x² − 1, find f(g(x)).
Step by step
- Write f with g(x) in place of x.
- Substitute (x² − 1) for x in the rule for f.
- Expand.
- Simplify.
Final answer
f(g(x)) = 2x² + 1
Building g(f(x))
Using the same functions, find g(f(x)).
Step by step
- This time, f(x) = 2x+3 is the inner function. Write g with f(x) in place of x.
- Substitute (2x + 3) for x in g's rule: g(x) = x² − 1.
- Expand (2x+3)².
- Simplify.
Final answer
g(f(x)) = 4x² + 12x + 8. Clearly different from f(g(x)) = 2x² + 1.
Show the intermediate line: Write: f(g(x)) = f(x² − 1) = 2(x² − 1) + 3 = ...__LINEBREAK__Do not jump straight to the simplified answer.__LINEBREAK__The intermediate line (f(x²−1) = ...) shows IB you have correctly identified which function is outer — that step earns credit.
The big idea: f(g(x)) and g(f(x)) are almost always different functions.__LINEBREAK__Composite functions are not commutative — you cannot swap the order.__LINEBREAK__This is one of the most common marks lost in IB exams: students compute g(f(x)) when the question asks for f(g(x)).
Showing that order changes the result
f(x) = x + 4, g(x) = 3x. Find f(g(x)) and g(f(x)) and compare.
Step by step
- Find f(g(x)): g is inner → substitute 3x into f.
- Find g(f(x)): f is inner → substitute x+4 into g.
Final answer
f(g(x)) = 3x + 4. g(f(x)) = 3x + 12. They are different.
| f(g(x)) | g(f(x)) | |
|---|---|---|
| Which function runs first? | g runs first | f runs first |
| Which is "inner"? | g(x) is inside f(…) | f(x) is inside g(…) |
| Are they usually equal? | No — almost never | No — almost never |
| When are they equal? | Special cases only, e.g. f = g = x | Same special cases |
Read the question carefully: IB sometimes asks for both f(g(x)) and g(f(x)) in the same question.__LINEBREAK__Always identify which function is inside the brackets before computing.__LINEBREAK___f(g(x)): g is written first going right-to-left → g runs first. g(f(x)): f is written first going right-to-left → f runs first.
Quick check after evaluating: If IB asks for both, sanity-check by substituting x = 1:__LINEBREAK__- f(g(1)) and g(f(1)) should give different numbers. - If they match, re-check — one is likely wrong.