“We use composition of functions every day: We take the answer from one mathematical problem and use it as the input for a different mathematical problem. For example, let’s say you have $20 and you want to see a movie for $6.50, and after that, you want to eat dinner for $9, and you want to buy a gift for your brother. Of course, these can be represented by a single linear function, but in more complex situations, composition may be easier (and the linear function that represents all these situations together can be obtained through composition of functions).”
Ask for volunteers. Start with one person at the board. Let the student secretly pick one of the functions on the laminated Function Machine cards (M-A2-6-3_Function Machine.doc).
Remind students that functions require an input and produce an output. Have students volunteer inputs to the student with the chosen function, and have that student perform the function on the input and provide the output on the board. Keep a table of x- and y-values (inputs and outputs) for the chosen function also on the board. Have students keep guessing until they can guess the function.
“That’s a good review of how ‘regular’ functions work: you provide an input and you get an output. Today, we’re going to talk about composing functions. What does the word compose mean or where have you heard the word compose before?” (composing an e-mail, writing a composition, a music composer, etc.)
“All those uses of the word compose have basically the same meaning—to put together. That relates precisely to what we’re doing when we compose functions; we’re going to put them together, although in a very specific way.”
Have two more volunteers come to the front of the class and have each of them secretly select a function from the Function Machine cards. Give each function a name (f, g, etc. You can use each student’s first initial as well). Explain to the class how we’re going to combine, or compose, the two functions.
“First, we’ll provide the first function with an input. Then, we’re going to use that function’s output as the input to the next function.”
Demonstrate this to students first using the Function Machine (M-A2-6-3_Function Machine.doc) [IS.4 - All Students], and show them the function f(x) and g(x) on the front of the card, and then flip it over to show them f(g(x)) and g(f(x)). Emphasize that whatever the function g(x) is, you place the entire function in place of the x in f(x) for f(g(x)), as that notation literally means plug in g(x) for x in f(x). Also emphasize that order matters, f(g(x)) is not going to be the same as g(f(x)) in most cases. Show the two index cards and have students notice how different the two results are. Once you think students understand this, continue with more examples as follows:
- Do some examples first (without worrying about recording the results). Have students provide the first function with an input, and then have the person representing that function tell the other function/student the output, and have the second person provide the “final output.”
- Get two new students with two new functions. Again, provide them with function names, and introduce the notation for composition of functions. Stress which of the two functions the class will provide the initial input to (say, f ) and stress the order in which the functions are written under composition, i.e., g(f (x)), with the first function on the inside of the composition statement. (Also, use the other notation for composition, (g ○ f)(x).) Emphasize that the way in which composed functions are written and spoken is important in making accurate representations of the functions being composed. Have students say and speak the terms correctly. Write g(f(x)) and have them practice saying it correctly, “g of f of x”.
Create an input–output table for g(f (x)), again allowing the class to provide inputs and allow the functions to generate the appropriate output. Now, ask the class how calculating f (g(x)) is different from g(f (x)). Remind students of the importance of order when writing the functions.
Create an input–output table for f (g(x)) and compare it to the original table.
“Does the order in which we compose functions make a difference?” (Yes, most of the time.)
Depending on how the class is doing (and the time remaining), this activity can be repeated, allowing for exploration of composition, including using more than two students/functions, trying to find functions where composition does not make a difference, allowing students to come up with their own functions instead of using the Function Machine cards, etc.
Eventually, bring the situation back to having two functions, both chosen from the Function Machine cards. Remind students how, at the beginning of class, they provided inputs to a function and were given outputs and eventually determined what the function was. Have them repeat that process with both functions, f and g, and write f and g on the board with their rule, in function notation:
f (x) = x +2 and g(x) = 3x
Now, have students provide the composition
some inputs, and have the composition work together, in the correct order, to provide outputs. Record the inputs and outputs and ask students if they can figure out a single rule that covers the whole composition instead of thinking about it as two separate rules. Guide students through a couple of examples (including reversing the order of composition) of generating a single rule to cover the composition, and then work into the abstract, algebraic approach.
Example: f (x) = x + 2; g(x) = 3x
(g ○ f )(x) = 3(x + 2)
f (x) = x + 2; g(x) = 3x
(f ○g)(x) = 3x + 2
When doing the algebraic approach, remind students that whatever is inside the parentheses functions as our input, and we replace all instances of x with our input, and then simplify.
“Now that we have explored composition with functions written as equations, as well as with the Function Machine, we’ll take a look at exploring composition with graphs. Remember, though, that graphs are really just another representation of functions (equations) and tables, so the idea is going to be almost identical.”
Hand out the It Takes Two activity (M-A2-6-3_It Takes Two.doc and M-A2-6-3_It Takes Two KEY.doc) and work with students on the first couple of problems. Again, emphasize starting with the inside function, determining the y-coordinate associated with the given x-coordinate, and then using that y-coordinate as the x-coordinate for the second, outside function. Work with the class through as many examples as necessary; once individual students get it, they will begin to work ahead at their own pace.
Use the following questions to help students reflect on the lesson:
“What does a function do on its own?” (take an input, provide an output, change a number)
“What does composition of functions mean?” (to combine two functions, use the output from one as the input for the other)
“Does the order of composition matter?” (yes)
Extension:
- Assign students to create two additional compositions that they can pose to the class. Each student will work each composition, showing each step and its associated arithmetic operation. Make sure that students are prepared to explain what and why for each step and demonstrate the procedure individually to the entire class.
- After several students have demonstrated a solution to each of their questions, ask the class to suggest which characteristics of the questions make some solutions more difficult than others.
Some possible answers might include:
- functions that use nonintegers
- functions with exponents and/or radicals
- multiple compositions