Composition passes one answer into the next function
Leans on
Quick review (2 minutes)
Picture two machines standing in a row.
(f ∘ g)(x) = f(g(x)). First apply g, then apply f to g's output.
The product (fg)(x) = f(x)·g(x) is a different operation.
1. Rewrite the circle notation as nested parentheses, meaning one pair of parentheses inside another: (f ∘ g)(x) = f(g(x)).
2. Name the inner function, which touches the original input.
3. Evaluate that function and write its output as a separate intermediate, or in-between, answer.
4. Put that whole intermediate answer into the outer function.
5. Check the path: original input, inner output, final output.
Let g(x) = x + 1 and f(x) = 2x. Find (f ∘ g)(2). The input is 2; add 1 first, then use that answer as the input to the doubling function. Plan: finish g first, then carry its whole answer into f.
(f ∘ g)(2) = 6.
Starting with f because its name appears first. In f ∘ g, g receives the original input. Expand the circle notation before calculating.
Rewrite (f ∘ g)(a) as f(g(a)); read it as f after g at a.
Find the inner function next to a and calculate g(a). Write that in-between answer on its own line.
Use the whole in-between answer as the outer input. Find f of that answer.
Check the path from original input to in-between answer to final output.
Function
A rule that gives exactly one output for each input it accepts.
Input
The starting value you give a function. It goes inside the parentheses in function notation.
Output
The answer a function produces from an accepted input.
Evaluate
Find the output of a function or the value of an expression for a given input.
Composition of functions
Using the output of one function as the input of another function.
Composite function
The new function produced by composition. Its single rule carries an input through both original functions in order.
Composition operator
The open-circle symbol ∘ that joins two function names to indicate composition.
Binary operation
An operation that takes two starting objects and produces one result. Here binary means two objects, rather than the computer digits 0 and 1.
Inner function
The function evaluated first in a composition. Its output becomes the next function's input.
Outer function
The function evaluated second in a two-function composition. It receives the inner function's output.
Function composition
Another name for composition of functions: one function's output becomes another function's input.
Order of operations
The agreed calculation order: parentheses, exponents, multiplication and division left to right, then addition and subtraction left to right.
Intermediate answer
The in-between output of the first function, which becomes the next function’s input.
Nested
Placed inside another expression, like one pair of parentheses inside another.
1 In plain words
Picture two machines standing in a row. Put in 2. The first machine adds 1 and hands out 3. The second machine doubles that 3 and hands out 6. One machine hands its finished answer straight to the next. This handoff is composition of functions, also called function composition. The combined recipe is a composite function. You can use it when one question depends on the answer to another. To price heating for a day, first find the day’s temperature, then use that temperature to find the cost. One starting input travels through both jobs and produces one final answer.
2 Picture it
Reminder
Reminder: Function notation, Order of operations, Multiplication notation
- Function notation. f(3) means the f output at input 3; if f(x) = 2x, f(3) = 6.
- Order of operations. Finish parentheses first: 2(2 + 1) = 2 × 3 = 6.
- Multiplication notation. A dot multiplies numbers: f(2)·g(2) = 4 × 3 = 12.
3 Why
The parentheses show what input each function receives. In f(g(x)), f is waiting for the value written inside its parentheses, namely g(x). You must obtain that value before f can act. This is the same order of operations used when you calculate 2(3 + 1): finish the inner calculation first. Because each machine produces one answer from an allowed input, the connected machines also produce one final answer wherever both stages can run.
4 The rule
.
First apply g, then apply f to g's output.
The product (fg) is a different operation.
The same idea, five ways
f of g of x; f composed with g at x; f after g
Put x into g first, then put g’s answer into f. The inner function is the first job; the outer function is the last job.
- (f ∘ g)(x) = f(g(x))
- f ∘ g names the new recipe
- (f ∘ g)(2) names its output at 2
- x → g(x) → f(g(x))
Day becomes temperature, then temperature becomes heating cost.
The same idea, other ways
Follow the wire. The first machine g changes x into g(x). The second machine f changes that intermediate answer into f(g(x)).
To estimate a heating cost for a day, first find that day's temperature. Then use the temperature to find the cost. A day cannot go straight into a rule that expects a temperature. Descriptive variables are names chosen to remind you what they measure: d for day, T for temperature, C for cost. C(T(d)) says cost after temperature after day.
Start with 2. Add 1 to obtain 3. Double 3 to obtain 6. The intermediate answer is a new input, not a number to multiply by the original input.
In f(g(x)), the input slot of f contains g(x). Compute the contents of the slot first. Memory cue: inside first, outside last.
f( g(x) )
Finish g(x)
Then f receives that result
Part 1: Inner function
The inner function is the first job. It is closest to the starting input in the nested notation. The name of the function does not decide its role; its position does.
- In f(g(x)), g is inner.
- In g(f(x)), f is inner.
Reminder
Reminder: Function notation
- Function notation. The name chooses a recipe and the parentheses supply its input: f(3) is the f output at input 3.
The same idea, five ways
Inner function
The inner function is the first job. It is closest to the starting input in the nested notation. The name of the function does not decide its role; its position does.
- In f(g(x)), g is inner.
- In g(f(x)), f is inner.
The inner function is the first job. It is closest to the starting input in the nested notation. The name of the function does not decide its role; its position does.
Worked example
Find the intermediate answer
In f(g(2)) with g(x) = x + 1, find the first answer. You are not finding the final f output yet. Plan: use the quantity or input named in the question, write the first result, then finish the stated operation.
Show the steps and the answer
- Evaluate .g is next to the starting input inside the parentheses.
Counterexamples
What it is not, and the tempting wrong moves.
Tips and tricks
- Point to the function directly touching the original input; that is the first job.
Part 2: Outer function
The outer function is the second job. Its input is the answer from the inner function. Think of a packing station receiving the item that a previous station finished.
- In f(g(x)), f is outer.
- An outer function must accept the intermediate output as its input.
Reminder
Reminder: Function notation
- Function notation. The name chooses a recipe and the parentheses supply its input: f(3) is the f output at input 3.
The same idea, five ways
Outer function
The outer function is the second job. Its input is the answer from the inner function. Think of a packing station receiving the item that a previous station finished.
- In f(g(x)), f is outer.
- An outer function must accept the intermediate output as its input.
The outer function is the second job. Its input is the answer from the inner function. Think of a packing station receiving the item that a previous station finished.
Worked example
Finish the second stage
The first stage gave 3. If f(x) = 2x, find f(3). The question asks for the final output after doubling the intermediate answer. Plan: use the quantity or input named in the question, write the first result, then finish the stated operation.
Show the steps and the answer
- .The input slot of f now holds 3.
Counterexamples
What it is not, and the tempting wrong moves.
Tips and tricks
- Write the in-between answer inside the outer parentheses before calculating.
Part 3: Composition operator and Binary operation
The open circle ∘ is the composition operator: it connects two functions into one new function. A binary operation takes two starting objects and makes one result. Here the starting objects are functions. The word binary refers to the number of starting objects, rather than to a computer’s zeros and ones. A degree is an angle measure. Its symbol ° appears after a number, as in 30°; it does not connect two functions.
- Read (f ∘ g)(x) as f composed with g at x.
- Read f(g(x)) as f of g of x.
- Both notations describe the same handoff.
- f ∘ g is a function name; (f ∘ g)(x) is that function’s output at input x.
f · g: multiply the two outputs
f ∘ g: g acts first, then f
30°: angle of thirty degrees
Reminder
Reminder: Function notation
- Function notation. The name chooses a recipe and the parentheses supply its input: f(3) is the f output at input 3.
The same idea, five ways
Composition operator and binary operation
The open circle ∘ is the composition operator: it connects two functions into one new function. A binary operation takes two starting objects and makes one result. Here the starting objects are functions. The word binary refers to the number of starting objects, rather than to a computer’s zeros and ones. A degree is an angle measure. Its symbol ° appears after a number, as in 30°; it does not connect two functions.
- Read (f ∘ g)(x) as f composed with g at x.
- Read f(g(x)) as f of g of x.
- Both notations describe the same handoff.
- f ∘ g is a function name; (f ∘ g)(x) is that function’s output at input x.
The open circle ∘ is the composition operator: it connects two functions into one new function. A binary operation takes two starting objects and makes one result. Here the starting objects are functions. The word binary refers to the number of starting objects, rather than to a computer’s zeros and ones. A degree is an angle measure. Its symbol ° appears after a number, as in 30°; it does not connect two functions.
f · g: multiply the two outputs
f ∘ g: g acts first, then f
30°: angle of thirty degrees
Worked example
Circle versus product
For f(x) = 2x and g(x) = x + 1, compare (f ∘ g)(2) and (fg)(2). You want to see what each symbol tells you to do. Plan: use the quantity or input named in the question, write the first result, then finish the stated operation.
Show the steps and the answer
- .Composition sends g(2) = 3 into f.
- (fg).The product uses two separate outputs at 2.
- Composition: 6.
- Product: 12.
Counterexamples
What it is not, and the tempting wrong moves.
Tips and tricks
- Recognize binary operation as vocabulary for a two-object operation. The word does not add a calculation step.
- Read the open circle as after before deciding which function acts first.
5 How
- Rewrite the circle notation as nested parentheses, meaning one pair of parentheses inside another: (f ∘ g)(x) = f(g(x)).
- Name the inner function, which touches the original input.
- Evaluate that function and write its output as a separate intermediate, or in-between, answer.
- Put that whole intermediate answer into the outer function.
- Check the path: original input, inner output, final output.
Evaluate a two-stage composition
- Rewrite (f ∘ g)(a) as f(g(a)); read it as f after g at a.
- Find the inner function next to a and calculate g(a). Write that in-between answer on its own line.
- Use the whole in-between answer as the outer input. Find f of that answer.
- Check the path from original input to in-between answer to final output.
6 Worked example
Worked example
Add 1, then double
Let g(x) = x + 1 and f(x) = 2x. Find (f ∘ g)(2). The input is 2; add 1 first, then use that answer as the input to the doubling function. Plan: finish g first, then carry its whole answer into f.
Show the steps and the answer
- .The circle means composition, so g is the inner function.
- .The original input goes into g first.
- .The output 3 from g is the input to f.
Counterexamples
What it is not, and the tempting wrong moves.
Tips and tricks
- Know cold: inside first, outside last. Write one intermediate answer so the order stays visible.
- Draw two boxes and a connecting arrow when the notation feels crowded.
- Know cold memory cue: read ∘ as after. f ∘ g says f after g, so g acts first.
7 The trap
Starting with f because its name appears first. In f ∘ g, g receives the original input. Expand the circle notation before calculating.