Composition of Functions
Sometimes the output of one function becomes the input of another. The distance you cycle depends on time, the energy you burn depends on distance, and the snacks you need depend on the energy. Chaining functions like this is called composition, and it gives you a single function that goes straight from the first input to the final output.
Key ideas
Section titled “Key ideas”What f(g(x)) means
Section titled “What f(g(x)) means”The composition of and is
Read it from the inside out: first apply to , then apply to the result. Picture two function machines in a row. The number goes into machine , and whatever comes out goes straight into machine .
For example, if and , then .
Order matters
Section titled “Order matters”In general, . With the same functions, , not . “Add , then square” is a different process from “square, then add ”. Occasionally the two orders do agree (for example, a function and its inverse), but you can never assume it.
Three ways to compose
Section titled “Three ways to compose”- From tables: find in the table, then look up that number in the table.
- From graphs: read from the graph of (go up or down from to the graph). Then use that output as the new input on the graph of .
- From equations: substitute the whole expression for in place of every in . Use brackets.
To find from the graphs above: the line gives , and then the parabola gives . So . In the other order, , and then , so .
Domain and range of a composition
Section titled “Domain and range of a composition”is in the domain of when both of these are true:
- is in the domain of (so exists), and
- is in the domain of (so can accept it).
Find the domain from these conditions, not just from the simplified formula, which can hide a restriction (Example 3 shows how). For the range, think about which values of actually get fed into , and what does to them.
Decomposing a function
Section titled “Decomposing a function”Going backwards, you can often split a complicated function into an “inside” and an “outside” function. For , the inside is and the outside is , so . Decomposing is useful for seeing how a function was built, and you’ll use it constantly in calculus.
Worked examples
Section titled “Worked examples”Example 1: Composing from tables
Section titled “Example 1: Composing from tables”Use the tables to evaluate , , , and .
Solution. Work from the inside out each time.
- : , then . So .
- : , then . So .
- : , then . So .
- : , then . So .
- : , then . So .
The first two show that changing the order changes the answer: but .
Example 2: Composing equations
Section titled “Example 2: Composing equations”Let and . Find and .
Solution. For , replace the in with the whole expression :
For , replace the in with :
The results are different functions.
Check with : and , and the formula gives . ✓ Also and , and the formula gives . ✓
Example 3: Domain and range
Section titled “Example 3: Domain and range”Let and . Find and , and state the domain and range of each.
Solution.
.
accepts every real number, but can only take inputs that are . So we need , which means , or .
For these -values, goes from (at ) up to (at ). Taking square roots gives values from to .
(The graph is the top half of a circle with radius .)
.
It looks like a line, but the first step is , which needs . So the domain is , and the graph is only the part of starting at . As grows from , falls from , so the range is .
Example 4: Snacks for a bike ride
Section titled “Example 4: Snacks for a bike ride”A cyclist rides at a steady km/h, so after hours she has gone km. At that pace she burns about kilocalories (kcal) per kilometre, so kcal for kilometres. Each granola bar she packs has kcal, so replacing kcal takes bars.
- (a) Find and explain what it means.
- (b) How many granola bars does she need to replace the energy from a -hour ride?
Solution.
(a) Work from the inside out:
is the number of granola bars needed to replace the energy burned in hours of riding: bars for every hour. Composition skipped the middle steps and went straight from time to bars.
(b) , so she needs granola bars.
Check step by step: h gives km, which burns kcal, which is bars. ✓
Common mistakes
Section titled “Common mistakes”Working from the outside in. means first, then , even though is written first. Start with the innermost brackets.
Multiplying instead of composing. is not . For and , the product is , but the composition is .
Forgetting brackets when substituting. with gives , not or .
Reading the domain from the simplified formula. In Example 3, simplifies to , but isn’t allowed, because doesn’t exist. Check the inside function first.
Reusing the x-value on a graph. After you find , the next input is , not . Move to on the graph of .
Assuming f(g(x)) = g(f(x)). It’s usually false. Example 1 and Example 2 both show different answers in the two orders.
Practice
Section titled “Practice”1. (Warm-up) Use the tables to find , and .
Solution
: , then . So .
: , then . So .
: , then . So .
2. (Warm-up) Let and . Find and .
Solution
: , then .
: , then .
3. (Warm-up) Use the graphs of and in Key ideas to find , and .
Solution
: the parabola gives , then the line gives . So .
: the line gives , then the parabola gives . So .
: , then . So .
4. (Core) Let and .
- (a) Find and .
- (b) Solve .
Solution
(a)
(b)
Check: and . ✓ So the two orders agree only at .
5. (Core) Let and . Find and , and state the domain of each.
Solution
can’t accept , so we need : the domain is .
needs , and accepts anything. The domain is .
6. (Core) Find functions and so that . (There’s more than one answer; give the most natural one.)
- (a)
- (b)
- (c)
- (d)
Solution
Look for the “inside” expression and call it .
(a) and .
(b) and .
(c) and .
(d) and . (Another answer: and .)
7. (Core) Oil leaking from a tanker spreads in a circle on the water. The radius after minutes is metres, and the area of a circle is .
- (a) Find and explain what it represents.
- (b) Find the area after minutes.
- (c) When does the area reach m²?
Solution
(a) . It’s the area of the slick, in square metres, minutes after the leak starts.
(b) m².
(c) Solve with :
The area reaches m² after about minutes.
8. (Challenge) Let . Find if .
Solution
doubles its input and adds , so . Set this equal to the given expression:
Check: . ✓
9. (Challenge) Let . Find in simplest form and state its domain.
Solution
Multiply the top and bottom by :
Domain: the inside needs . The outside can’t accept , so we also need , which means , or . (That matches the denominator .)
Notice that is excluded even though the simplified formula gives there.
Homework
Section titled “Homework”Try these independently after the practice questions. Show your setup and explain your reasoning. Use exact answers where possible, and check that your answers fit the question. Homework solutions are not provided on the published site.
Foundations
Section titled “Foundations”H1. (Foundations) Use the tables to evaluate each expression. If a value can’t be found from the tables, say so and explain why.
- (a)
- (b)
- (c)
- (d)
- (e)
H2. (Foundations) Let and . Evaluate each expression, working from the inside out.
- (a)
- (b)
- (c)
H3. (Core) Let and .
- (a) Find in simplified form.
- (b) Find in simplified form. Are and the same function?
- (c) Check both answers at by evaluating step by step from the original functions.
H4. (Core) Let and .
- (a) Find and state its domain and range in set notation.
- (b) Find and state its domain and range in set notation.
- (c) Explain why exists but does not.
H5. (Core) Each function can be written as . For (a) and (b), give two different pairs of functions and (neither one simply ), and check one pair by composing.
- (a)
- (b)
H6. (Core) You order a hoodie from a US website. Use a hypothetical exchange rate where US dollar is worth Canadian dollars, so converts US dollars to Canadian dollars. Then a hypothetical sales tax is added, so gives the total after tax on Canadian dollars.
- (a) Find and explain what it represents.
- (b) Find the total cost in Canadian dollars of an $80 (US) hoodie, to the nearest cent.
- (c) The site also adds a $15 (Canadian) shipping charge after converting and before tax: . Write the total cost as a composition of , and , and find it for the $80 (US) hoodie.
- (d) A friend says the shipping should be added after tax instead. Find and explain why it differs from (c).
Challenge
Section titled “Challenge”H7. (Challenge) Let and . A student writes:
- (a) Use to show that the student’s answer is wrong. Describe the mistake.
- (b) Find correctly.
- (c) Find , and explain how you know it isn’t the same as your answer to (b).
H8. (Challenge) Find all real values of for which , or explain why there are none.
- (a) and
- (b) and
H9. (Challenge) Work backwards to find the missing function.
- (a) Let . Find two different linear functions such that .
- (b) Let . Find such that .
H10. (Challenge) (IB style) A stone is dropped into a still pond, making a circular ripple. The radius of the ripple seconds later is metres, and the area of a circle with radius is .
- (a) Find and explain what it represents.
- (b) Find the area enclosed by the ripple after seconds. Give an exact answer and a decimal to two decimal places.
- (c) Find the time at which the enclosed area is m², to the nearest hundredth of a second.
- (d) The ripple stops when it reaches the edge of the pond, m from where the stone landed. State a suitable domain and the range of for this model, in set notation.