Did you know? A student can simplify f(g(x)) beautifully and still give the wrong answer to an H2 Mathematics question. The arithmetic may be correct, but the composite function might not exist on the domain given in the question. The missing idea is that one function must produce outputs the next function is allowed to accept.
For families looking for a JC1 H2 Mathematics Tutor Bukit Timah, this is an excellent example of why mathematics tuition should teach meaning before speed. The Singapore–Cambridge 2027 A-Level H2 Mathematics syllabus 9758 includes functions, domains, ranges, composite functions and conditions for their existence. A student who understands this can face unfamiliar square roots, reciprocals and nested expressions with much more confidence.
This guide answers one focused question: How do we tell whether a composite function exists, and which function acts first? It includes an immediate rule, contrasting worked examples, the crucial difference between an algebraic expression and a full composite on a stated domain, a teaching pathway, exercises with answers, parent-friendly diagnostic questions and related reading. It is not an attempt to reproduce a complete JC1 functions textbook.
Quick answer: the inner function must produce acceptable inputs
For f(g(x)), we calculate g(x) first and then feed that output into f. For a composite f ∘ g to exist on the entire stated domain of g, every possible output of g must belong to the stated domain of f.
In set notation, Range(g) ⊆ Domain(f).
That condition is the first thing to check. A formula that looks neat after substitution does not override it. Similarly, for g(f(x)), the corresponding condition is Range(f) ⊆ Domain(g).
- f ∘ g or fg means apply g first, then f, when the composite exists.
- g ∘ f or gf means apply f first, then g, when the composite exists.
- To check f ∘ g, compare the range of g with the domain of f.
- To check g ∘ f, compare the range of f with the domain of g.
- The two compositions can have different formulas, different domains, or different existence conditions.
- If the stated function definitions prevent full composition, do not silently change their domains and pretend nothing happened.
It may help to picture two machines. One machine prints a number onto a ticket; the next machine must be able to read every ticket it receives. A machine that accepts only non-negative numbers cannot safely receive negative outputs from the first machine.
Domain and range are not interchangeable vocabulary
The domain of a function is the set of inputs it is permitted to receive. Its range is the set of outputs it actually produces from those inputs. That distinction is not optional for composite functions: composition connects one function’s range to another function’s domain.
For example, f(x) = √x on the real numbers has domain x ≥ 0 and range y ≥ 0. Negative inputs are forbidden because the real square root of a negative number is not defined.
The function g(x) = x² + 1, defined for every real x, has range [1, ∞). It never produces a negative output and never produces anything below one. So feeding g’s output into f is safe. The first machine prints numbers at least one; the second accepts every number at least zero.
Conversely, the function h(x) = x² − 1, defined for every real x, has range [−1, ∞). It sometimes produces negative outputs. Feeding all outputs of h into f(x) = √x is therefore not safe on the whole real domain of h.
A comparison of ranges and domains reveals the issue before we write a long nested formula.
Worked example 1: two functions that can compose in both orders
Let f(x) = 2x + 1 and g(x) = x² − 4, both defined for all real numbers. Their domains are all real numbers. Their ranges are, respectively, all real numbers and [−4, ∞).
Since f accepts every real number, Range(g) ⊆ Domain(f). And since g also accepts every real number, Range(f) ⊆ Domain(g). Both compositions exist on the original specified domains.
Find f(g(x)) by inserting the whole formula for g into f. We obtain f(g(x)) = 2(x² − 4) + 1 = 2x² − 7.
Now reverse the order. g(f(x)) = (2x + 1)² − 4 = 4x² + 4x + 1 − 4 = 4x² + 4x − 3.
These are not the same functions. The algebra itself shows that changing the order changes the result.
At x = 1, f(g(1)) = f(−3) = −5. But g(f(1)) = g(3) = 5. We can verify that the formulas agree: 2(1)² − 7 = −5 and 4(1)² + 4(1) − 3 = 5.
What this example teaches beyond substitution
A learner who writes f(g(x)) = g(f(x)) because the same letters appear has assumed that composition is commutative. It is not generally commutative. An addition like 3 + 5 has the same value as 5 + 3, but a sequence of operations can depend on order.
The clearest repair is to say the operations out loud. First square x and subtract four; then double the result and add one. That produces 2x² − 7. In the reverse order, first double x and add one; then square the result and subtract four. That produces 4x² + 4x − 3.
This interpretation is more robust than memorising whether fg means “f first” or “g first.” The expression f(g(x)) visibly places g inside f.
Worked example 2: a square root that accepts every output of g
Let f(x) = √(x − 2), defined for real x ≥ 2, and g(x) = x² + 3, defined for all real x.
First determine the range of g. Because x² ≥ 0 for every real x, x² + 3 ≥ 3, with the minimum three attained at x = 0. Therefore Range(g) = [3, ∞).
The domain of f is [2, ∞). Since every g-output is at least three, it lies within the domain of f. Thus f ∘ g exists on the whole real domain of g.
Now form the expression: f(g(x)) = √((x² + 3) − 2) = √(x² + 1). The expression is real for every real x, as predicted by the range–domain check.
What about the reverse order? g accepts every real input, so every output of f is acceptable to g. Thus g ∘ f exists on the domain x ≥ 2 of f. We get g(f(x)) = (√(x − 2))² + 3 = x + 1, for x ≥ 2.
The formula x + 1 might look valid for all real x, but the composite has inherited the restriction x ≥ 2 from f. You must not erase that restriction simply because squaring cancels the square root symbol.
Worked example 3: a neat expression does not guarantee a full composite
Keep f(x) = √(x − 2), domain [2, ∞). Now let h(x) = x², domain all real numbers, with range [0, ∞).
Because h can output numbers such as zero or one, and f accepts only inputs at least two, the range of h is not a subset of the domain of f. Therefore f ∘ h does not exist as a full composite on h’s entire stated real domain.
A learner may nevertheless substitute the formula and write f(h(x)) = √(x² − 2). That expression is real for x ≤ −√2 or x ≥ √2, but it is not real for x = 0, for example. So the algebraic expression is only partially defined if we view it in isolation.
The key is not that the expression is always meaningless. The key is that it fails the existence condition for the full composite on the specified domain of h. That is what the syllabus condition is designed to test.
This distinction is easy to lose. A student may say, “But my calculator can draw parts of √(x² − 2).” Yes, it can draw where the expression is real. That does not make it a full composite of the original pair of functions on every input that h was specified to accept.
Scope note for the H2 syllabus
The official 2027 H2 Mathematics 9758 syllabus includes conditions for the existence of composite functions, but explicitly excludes restriction of a domain to obtain a composite function. In a syllabus-aligned answer, identify the given domains and ranges correctly and report when full composition is not defined as stated. Do not assume a question is asking you to modify a function’s original domain unless the particular problem expressly changes the definition.
Understanding where a nested expression happens to be real remains mathematically useful, but it must not be confused with what the prescribed composite-function existence task asks.
Worked example 4: a forbidden denominator input
Let p(x) = 1/(x − 1), defined for all real x except x = 1, and q(x) = x + 1, defined for all real x.
The range of q is all real numbers, including one. Since p cannot accept input one, p ∘ q does not exist as a full composite over the stated entire domain of q.
If we substitute formally, p(q(x)) = 1/((x + 1) − 1) = 1/x. This expression is undefined at x = 0, even though zero is an allowed input to q. Indeed, q(0) = 1 and p(1) is forbidden. That single example proves the full composition condition fails.
The reverse order is different. q has all real numbers in its domain, so it accepts every output of p. Therefore q ∘ p exists on p’s given domain x ≠ 1. Its formula is q(p(x)) = 1/(x − 1) + 1, with x ≠ 1.
A student who writes only a simplified rational expression and omits x ≠ 1 may have completed the algebra while leaving the function definition incomplete.
A table of decisions that saves time
Instead of expanding everything immediately, make four little entries: Domain(f), Range(f), Domain(g), and Range(g). Then place an arrow from the range of the inner function to the domain of the outer function.
For f ∘ g, look only at the arrow Range(g) → Domain(f). Is every element in the left-hand set accepted by the right-hand set? If yes, the full composition exists. If not, it does not exist as stated.
For g ∘ f, reverse the arrow. There is no reason to expect the two decisions to agree. In our square-root example, both orders were possible because g accepted everything and its outputs were all large enough for f. In the reciprocal example, only q ∘ p was possible.
This two-arrow procedure is reliable because it separates the existence decision from the formula calculation. Algebra is the second stage, not the first.
The graph interpretation: output heights become new inputs
Imagine the graph of y = g(x). Each point tells us what output g produces for an allowed input x. To apply f after g, take that output height and use it as the new input to f.
If g’s graph dips below zero but f is a square-root function that accepts only non-negative inputs, some heights cannot be fed into f. It is the same obstruction we saw algebraically. We can often determine it visually by comparing g’s lowest height with the start of f’s input domain.
For g(x) = x² + 3, the graph lies at or above three. For f(x) = √(x − 2), every possible g-output is acceptable. But h(x) = x² ranges down to zero, which is below the threshold of two required by f.
This is why domain and range should be taught with graphs and sets, not just with memorised inequality labels.
A composition mistake that looks like a square-root mistake
A student correctly writes f(g(x)) = √(x² + 1), but then claims the domain is x ≥ 0 because “there is a square root.” That reasoning confuses the requirement radicand ≥ 0 with the requirement x ≥ 0.
For √(x² + 1), the radicand is x² + 1, which is at least one for every real x. Thus there is no x ≥ 0 restriction. Negative values of x are allowed: x = −3 gives √10.
The repair is to write the actual inequality under the square root. For any real-valued square-root expression √A(x), the condition is A(x) ≥ 0, not automatically x ≥ 0.
That check is useful beyond composite functions. But in a composite question, do it only after respecting the input and output sets of the original functions as defined.
What happens when a function is already one-to-one?
Being one-to-one is relevant to whether a function has an inverse on its domain. It does not by itself guarantee that another function can be composed with it.
For example p(x) = x + 1 is one-to-one on all real numbers. Yet when p’s outputs are used as inputs to a function defined only for x ≥ 10, some outputs are forbidden. One-to-one tells us that different inputs do not collapse to the same output; it does not tell us that every output meets another machine’s domain restriction.
Likewise, a function that is not one-to-one may still compose perfectly well with another function whose domain accepts its range. The two questions—invertibility and composability—have different conditions.
For inverse-function study, see the existing eduKateSG JC1 H2 functions, domain and inverses guide. Separating these ideas prevents a common revision error where students recall the right mathematical words but apply them to the wrong problem.
A concrete diagnostic session for a JC1 learner
I would begin with two input–output tables. One machine squares a number; another takes a square root. Ask the student what outputs can leave the first machine and whether the second machine can accept them. Then reverse the machines.
Next, replace the tables with functions and intervals. Use f(x) = √(x − 2) and g(x) = x² + 3. The learner must describe the range of g and compare it with the domain of f before making any substitution.
Then introduce h(x) = x² on all reals. The same learner should notice that some h-outputs are below two. The tutor’s follow-up question is: “Can every permitted input pass through both machines, or just some?” That is the precise boundary between the full composite and a partially defined nested expression.
Finally give a rational function with an excluded denominator value. Ask the learner to locate one input that produces the forbidden number. An answer with a clear counterexample is more informative than a long calculation that misses the restriction.
How to recognise the first incorrect move in written work
A typical wrong solution reads: “f(x) = √(x − 2), h(x) = x², so fh(x) = √(x² − 2). The composite exists because the expression contains a square root.” The student has skipped the range–domain inclusion check.
Another wrong solution reads: “Since (√(x − 2))² = x − 2, the answer is valid for all real x.” The simplification is algebraically valid where it is defined, but it cannot restore forbidden original inputs.
A third wrong solution calculates f(g(x)) correctly but calls it gf. The algebra can be repaired by rereading the notation and placing the inner function inside parentheses.
These are different errors. The first is an existence-condition failure; the second is an inherited-domain failure; the third is an order-of-composition failure. Treating all three as “careless mistakes” overlooks the distinct mathematical understanding each one needs.
Ten short H2 Maths practice questions with answers
1. f(x) = x + 2 and g(x) = 3x, each with domain all real numbers. Find f(g(x)). Answer: 3x + 2.
2. For the same pair, find g(f(x)). Answer: 3(x + 2) = 3x + 6. The order changes the answer.
3. f(x) = √x, domain x ≥ 0; g(x) = x² + 4 on all real numbers. Does f ∘ g exist? Answer: Yes. Range(g) = [4, ∞) is contained in Domain(f) = [0, ∞).
4. With the same functions, compute f(g(−2)). Answer: g(−2) = 8, so f(g(−2)) = √8 = 2√2.
5. f(x) = √(x − 5), domain x ≥ 5; g(x) = x² + 6 on all real numbers. Does f ∘ g exist? Answer: Yes, because every g-output is at least six.
6. f(x) = √(x − 5), domain x ≥ 5; h(x) = x², domain all real numbers. Does f ∘ h exist on that complete domain? Answer: No. h(0) = 0 is not an allowed input to f.
7. f(x) = 1/(x − 2), defined for x ≠ 2; g(x) = x + 2 on all reals. Does f ∘ g exist on all reals? Answer: No. g(0) = 2, forbidden for f.
8. Let f(x) = x² and g(x) = √x, with g defined for x ≥ 0. Find f(g(x)) and keep its domain. Answer: x, for x ≥ 0. The formula does not justify adding negative inputs.
9. Is the condition for f ∘ g Range(f) ⊆ Domain(g)? Answer: No. It is Range(g) ⊆ Domain(f).
10. If f and g are both defined on all reals and produce only real outputs, do both composites exist? Answer: Yes. Each range is contained in the other’s all-real domain, although the resulting formulas may differ.
These short tasks are deliberately varied: some ask for a formula, others for a validity decision. A student who can expand expressions but fails the range–domain checks needs to focus on meaning rather than more algebraic speed drills.
Challenge: two composite functions with different natural outputs
Let f(x) = x² and g(x) = x − 3, each defined on all real numbers. Then f(g(x)) = (x − 3)², while g(f(x)) = x² − 3.
Both compositions exist. Both are quadratics, and both have expressions involving a square and three. Yet their graphs have different turning points. The first has minimum zero at x = 3; the second has minimum −3 at x = 0.
At x = 0, the first function gives nine and the second gives −3. A single test input exposes the difference.
This is a useful demonstration that even when both orders exist, we must not swap functions casually. Function composition describes the sequence in which a result is transformed. It can change the location of a turning point, the range, the intersection with an axis and the interpretation of a model.
Frequently asked questions
Does fg mean f acts first or g acts first?
In the usual H2 Mathematics composite notation fg(x) means f(g(x)): g acts first and f acts second. When in doubt, write the nested parentheses explicitly.
Why do I check the inner function’s range rather than its domain?
Because the outer function receives the outputs of the inner function. The question is whether those outputs are acceptable inputs to the outer function.
Can I use a graphing calculator to test a composite?
A graphing calculator can help check output ranges and find counterexamples. But the mathematical existence condition still needs to be understood and stated. An image showing part of a nested expression does not establish that every original input is permitted.
Is a partially defined nested formula always a full composite?
Not when the original function definitions specify broader domains that fail the range–domain inclusion condition. The 2027 syllabus tests the conditions for existence and excludes restriction of domain merely to obtain a composite function.
Why does a simplification sometimes still carry a restriction?
Because algebraic simplification does not rewrite the originally declared domain. For example (√(x − 2))² = x − 2 only for x ≥ 2 when the original square root is a real-valued function.
Can two functions compose in one order but not the other?
Yes. The two existence checks are different: Range(g) ⊆ Domain(f) versus Range(f) ⊆ Domain(g). One may hold while the other fails.
Official standard, further reading and consultation
The 2027 Singapore–Cambridge H2 Mathematics 9758 syllabus defines the functions-and-graphs scope, including the existence conditions and the express exclusion of restricting a domain to obtain a composite function. This educational guide explains those mathematical ideas; it does not replace a student’s particular school’s lesson sequence.
Explore why reciprocal graphs turn zeros into asymptotes, f(|x|) versus |f(x)| and how x + a moves a graph left for other focussed JC1 graph lessons. The Bukit Timah H2 Mathematics overview links the topic to the full two-year subject.
The immutable eduKateSG Mathematics tutorial reference sets out a diagnose–explain–practise–check approach for a Secondary 1 small-group programme. It is a teaching-method reference rather than evidence of JC1 fees, group size, class availability or timetables. Families can check Bukit Timah JC1 tuition enquiries separately.
For a lasting takeaway, remember the direction of the arrow: the inner function makes a ticket, and the outer function must be able to accept every ticket. When that condition is settled first, the formula becomes much easier to trust.
