2.2.8 · D1Functions

Foundations — Composition of functions — f(g(x)), g(f(x))

2,076 words9 min readBack to topic

Before you can compose functions, you must be fluent in the little pieces the parent note throws around: arrows, letters like , the mysterious circle , "domain", "range", nested parentheses. We build them one at a time, and each one earns its place before it is used again.


1. The function machine:

Read out loud as "f of x". It does not mean " times ". The brackets are not multiplication — they are a feeding slot: whatever sits inside them is the thing being dropped into the machine.

Figure — Composition of functions — f(g(x)), g(f(x))

Figure s01 — a rounded box labelled (the machine) with a magenta arrow feeding the input into its slot on the left, and an orange arrow carrying the output out on the right; the rule "square it, add 1" is printed inside the box.

  • The name (or , or ) labels which machine we are using.
  • The input is whatever is inside the brackets.
  • The output is what comes out — the value stands for.

2. The arrow:

The parent writes and, using a second machine named (Section 1 — any letter names a machine), . Let us earn every piece.

The arrow is chosen because a function has a direction: things flow in one way. You feed , you never feed . This one-way arrow is exactly why order will matter later.

Figure — Composition of functions — f(g(x)), g(f(x))

Figure s02 — three white circles labelled , , left to right; a violet arrow marked runs from to , an orange arrow marked runs from to , showing the machines lined up head-to-tail so that is both the out-pile of and the in-pile of .

Why does the topic need this? Because composition demands that the out-pile of the first machine fits into the in-slot of the second. The parent's rule "the outputs of must be a subset of the inputs accepts" is just: the arrows must line up head-to-tail, like .


3. Domain and range: the in-pile and the out-pile

So we now have three named piles: the domain (, inputs), the codomain (, declared outputs), and the range (the part of genuinely hit). See Domain and range of function for the full story. Here is the picture that matters for composition:

  • refuses negative inputs — you cannot square-root and stay in real numbers. Its domain is .
  • accepts anything — its domain is all real numbers.

4. Nested parentheses: innermost first

The parent constantly writes things like . This is a nesting, and there is one iron rule.

This is the same rule you already use in arithmetic: in you compute before , exactly as in you compute before multiplying. Innermost bracket wins.

Figure — Composition of functions — f(g(x)), g(f(x))

Figure s03 — the expression printed large; a magenta box rings the inner labelled "compute this inner value first", and a violet downward arrow leads to the caption "drop that value into g's slot", with the arithmetic analogy underneath.

Why the topic needs this: the entire meaning of depends on reading it inside-out. Read it outside-in and you would apply first — which is the wrong machine and the wrong answer.


5. The circle : the composition symbol

Now we can meet the star of the topic.

The circle is just a compact label for "the assembly-line machine". Everything the parent proves — non-commutativity, associativity, the identity — is a fact about this combined machine.


6. The identity machine

Why does the topic need a do-nothing machine? Because composition needs a neutral element — something that, when bolted on, changes nothing. It plays the role that plays for adding and plays for multiplying: and (where is taken on whichever set makes the arrows line up). It also secretly powers Inverse functions, where a function and its inverse compose back to .


How the foundations feed the topic

The map below reads top-to-bottom (graph TD = "graph, top-down"): an arrow means "you need before makes sense." Trace it: the function machine (top) is the seed of everything. It grows two shoots — the arrow notation (which sets and ) and the rule about nested brackets. The arrow notation feeds domain and range; nested brackets and domain/range together feed the circle symbol. The machine also spawns the identity. Finally, the circle, the identity, and domain/range all pour into full composition (the box near the bottom), which then flows onward to inverses and the chain rule.

Function machine f of x

Arrow notation f from A to B

Nested brackets innermost first

Domain and Range in pile out pile

Circle symbol composition

Identity machine I of x equals x

Composition f of g of x

Inverse and chain rule later

Each box is a symbol or idea you now own. The bottom box — actual composition — is what the parent note runs with. From there the path continues to Inverse functions, Bijective functions, and Derivatives - chain rule, all of which lean on this same machinery.


Equipment checklist

Cover the right side and test yourself — if you can answer all of these, you are ready for the parent note.

What does mean, and what does it NOT mean?
A machine's rule applied to input ; it is NOT multiplied by .
Do letters other than name functions?
Yes — , mean the machines named , applied to , exactly like .
In , what are and called?
is the domain (allowed inputs); is the codomain (declared out-pile).
What is the difference between codomain and range?
Codomain = the pile outputs are declared to live in; range = the outputs actually produced, which sits inside the codomain.
In , which do you compute first?
The innermost bracket, , then feed its value into .
How do you read and which function runs first?
"g after f"; the rightmost function (nearest the input) runs first.
Why does the range of have to fit inside the domain of for ?
Because 's output becomes 's input; if can't accept it, the composite is undefined.
What is the identity function, on what set, and what does composing with it do?
on a set (domain = codomain = ); composing with it leaves the other function unchanged.