Haberman / Kling MTH 111c Section I: Sets and Functions Module 5: Function Composition In The Algebra of Functions (Section I: Module 4) we discussed adding, subtracting, multiplying, and dividing functions. In this module we will study another way to combine functions: function composition. EXAMPLE: When Peter was younger and people asked about his age, he never had to think: he had his age memorized. But now he s older and his age has taken enough different values that he sometimes lose track, and need to do some calculations to find his age. In this example we ll discuss the function that Peter uses to calculate his age when he can t remember: the age function. Let s call the age function a. Since his goal is to determine his age, we need to input Peter into the function a. (Thus, it makes sense to define the domain of a to be the set of all living people.) So what does the function a need to do to determine a person s age? First, a needs to find the person s birth-date, and then it needs to calculate how long ago the person s birth-date occurred. Since a needs to do these two things, we say that a is the composition of two functions: the birth-date function, b, and the how long ago this date occurred function, h. So a is the function that computes a person s age b is the function that finds a person s birth-date h is the function that calculates how long ago (measured in complete years) a date occurred. The diagram below represents how function a works. We can express this function symbolically as follows:
a Peter hb( Peter) h 5 1 / 7 /1971 (so Peter is 5 years old) and if x represents a generic person, then the age of person x can be calculated as follows: a( x) h b( x) As mentioned above, a is the composition of two functions: b and h. We have special notation for the composition of two functions: a( x) h b ( x) h b( x) KEY POINT: The composition of functions is denoted by the symbol. The composition of functions f and g is the function f g defined as follows: f g x f g x ( ) ( ). The notation f g can be translated as f composed with g or the composition of f and g. BE CAREFUL: f g does not mean the same thing as f g, which is the product of f and g. ( f g)( x) f g( x) while f g( x) f ( x) g( x) EXAMPLE: Table 1 shows the temperature, C, in degrees Celsius, as a function of the temperature in degrees Fahrenheit, F. Table shows the temperature in degrees Kelvin, K, as a function of the temperature in degrees Celsius, C. [The Kelvin scale is the temperature scale devised by Lord Kelvin in 1848.] Table 1: Celsius temperature vs. Fahrenheit temperature F 1 1 68 149 1 C(F) 5 5 0 0 65 100 Table : Kelvin temperature vs. Celsius temperature C 5 5 0 0 65 100 K (C) 8.15 48.15 7.15 9.15 8.15 7.15
Suppose we want a table that shows direct conversions from temperatures in degrees Fahrenheit to temperatures in degrees Kelvin. Table shows the temperature in degrees Kelvin, K, as a function of the temperature in degrees Fahrenheit, F. Table is easy to obtain using Table 1 and Table because the outputs of Table 1 are the same as the inputs of Table. Table : Kelvin temperature vs. Fahrenheit temperature F 1 1 68 149 1 K C( F ) 8.15 45.15 7.15 9.15 8.15 7.15 Since the output of Table 1 is used as the input of Table, we write the new function in K C( F ). The new function is formed by composing the other two functions. Table as The mathematical expression for this composition is K C( F ). Therefore, K C( F) K C( F). EXAMPLE: 5 Given C( F) ( F ) and K( C) C 7.15, find K C( F ), the 9 function which converts temperature in degrees Fahrenheit directly to temperatures in degrees Kelvin. SOLUTION: K C( F) K C( F) 5 K ( F ) 9 5 ( F ) 7. 5 9 5 Replace C( F) with ( F ). 9 Replace the input variable, C, in the formula 5 K( F) C 7.5 with ( F ). 9
4 EXAMPLE: Use Table 4 to evaluate f g () and g f (). Explain why f g (4) is undefined. (Remember with no algebraic rule or graph, the values in the table are the only values we know!) Table 4: Functions f and g. x f( x ) gx ( ) 1 4 5 0 4 4 1 9 5 4 7 SOLUTIONS: f g() f g() f ( 4 ) (since g() 4) ) 1 (since f (4) 1) ) g f () g f () g( ) (since f () ) 0 (since g( ) 0) f g(4) f g(4) f (9) But f (9) is undefined because there is no input value of 9 in Table 4. Therefore, f g (4) is undefin ed.
5 EXAMPLE: Use the graph in Figure 1 to find the values for k m () and m k (). SOLUTIONS: k m() k m() Figure 1: y m( x) is the parabola and y k( x) is the line. k( 1 ) (we find that m() 1 on Figure 1, so we replace m() with 1) (the linear function in Figure 1 shows us that k( 1) ) m k() mk() m( 4 ) (we find that k() 4 on Figure 1, so we replace k() with 4) (the parabolic function in Figure 1 shows us that m( 4) ) EXAMPLE: If m( x) x 5 and n x ( ) x 1, find and simplify the following: a. m n( x ) b. ( ) n m x c. m m( x ) SOLUTIONS: a. m n( x) m n( x) m x 1 x 1 5 6x 5 6x
6 b. n m( x) n m( x) nx 5 x 5 1 9x 0x 5 1 18x 60x 50 1 18x 60x 51 c. m m( x) mm( x) mx 5 x 5 5 9x 15 5 9x 0 KEY POINT: As the example above suggests, f g( x ) and g f ( x ) are typically different. general, Although it is possible that they are equal, in f g ( x) g f ( x). In fact, in a key point below, we notice that some functions cannot even be composed in both ways! Try this one yourself. If f ( x) x 5x 4 and g( x) x, find and simplify f g( x ). Click Here to Check Your Answer
7 EXAMPLE: If g x 1, find and simplify x g x h g x h. CLICK HERE FOR A SOLUTION CLICK HERE FOR ANOTHER METHOD EXAMPLE: A computer store offers a 15% discount on all new computers. At the same time, the computer manufacturer offers a $500 rebate. Let P represent the original price of a computer. a. Write a function f to represent a computer s price if only the 15% discount is applied and a function g to represent its price if only the $500 rebate is applied. b. When both the discount and the rebate are applied, the purchase price of the computer is either f g( P ) or g f ( P ), depending on the order in which they are applied. Which would you ask the dealer to apply first? Which composition represents your choice? Justify your answer by writing expressions for f g( P ) and g f ( P ). SOLUTIONS: a. If P represents the original price, then the price after the 15% discount is applied would be represented by P 0.15P 0.85P. So, f ( P) 0.85P is a function which represents the price of the computer if only the 15% discount is applied. If P represents the original price, then the price after the $500 rebate is applied would be P 500. So, g( P) P 500 is a function g which represents the price if only the $500 rebate is applied. b. To interpret f g( P ), we need to work from the inside out. P represents the original price; then g performs the $500 rebate followed by f which performs the 15% discount. To interpret g f ( P ), we again need to work from the inside out. P represents the original price, then f performs the 15% discount, followed by g which performs the $500 rebate.
f g( P) f gp ( ) 0.85 g( P) (put g( P) into f by replacing the input variable of f with g( P) ) 0.85( P 500) (replace g( P) with P 500 since g( P) P 500) 0.85P 45 g f ( P) g f( P) (apply the distributive property) f ( P) 500 (put f ( P) into g by replacing the input variable of g with f ( P) ) 0.85 P 500 (replace f ( P) with 0.85 P since f ( P) 0. 85P) 8 Since f g( P) 0.85P 45 and g f ( P) 0.85P 500, it appears that ( ) the 15% discount followed by the $500 rebate, would be the better deal. g f P, KEY POINT: In most applied problems, functions cannot be composed both ways, as demonstrated in the following example. EXAMPLE: Suppose that the function n P(t) represents the population (n) of the Portland metropolitan area t years after 1990 and l C(y) represents the carbon dioxide (CO ) concentration (l) in the atmosphere of a city of population y. Which composition function, C P( t ) or P C( y ), makes sense? Explain your reasoning. SOLUTION: ( ) C P t is the only composition that makes sense since C P( t) C P( t) and the input of C must be a population and the output of P is a population. P C ( y) P C( y) doesn t make sense because the input of P must be a time (in years since 1990), but the output of C is not a time. EXAMPLE: If f ( x) x, find two new functions u and w so that SOLUTION: f ( x) u w ( x). Essentially, this example asks us to de-compose the function f ( x) x into two new functions u and w. Since we need f ( x) u w ( x) u w( x)
9 we need to think of f ( x) x as consisting of a two-step process where w represents the first step of the process and u represents the second step in the process. There are always many different correct choices for u and w but, in this case, it is most natural to consider that the two steps involved in the function f( x) x are 1 st : Add to the input nd : Extract the square root of the result of the 1 st step. Thus, we can define the functions u and w as follows: w( x) x u( x) x Let s check if this choice of u and w works: u w( x) u w( x) u x x f( x) Since u w( x) f ( x), our choice of u and w is correct. EXAMPLE: If x, find two new functions u and w so that g( x) g( x) u w ( x). SOLUTION: In order to de-compose the function g( x) x into two functions u and w we need to think of g( x) x a two-step process where w represents the first step of the process and u represents the second step in the process. In this case, it is most natural to consider that the two steps involved in the function gx ( ) x are 1 st : Cube the input. nd : Add to the result of the 1 st step. Thus, we can define the functions u and w as follows:
w( x) x u( x) x 10 Let s check if this choice of u and w works: u w( x) u w( x) u x x gx ( ) Since u w( x) g( x), our choice of u and w is correct. h( x) x 5, find two new functions u and w so that EXAMPLE: If 10 h( x) u w ( x). SOLUTION: In order to de-compose the function 10 need to think of 10 h( x) x 5 into two functions u and w we h( x) x 5 a two-step process where w represents the first step of the process and u represents the second step in the process. In this case, there are a few equally natural ways to break-down the function into two steps. We ll show two different ways here: Solution A: hx ( ) x 5 to be: We can take the two steps involved in the function 10 1 st : Multiply the input by and then subtract 5 from the result. nd : Raise the result of the 1 st step to the power 10. Thus, we can define the functions u and w as follows: w( x) x 5 u( x) x Let s check if this choice of u and w works: 10
u w( x) u w( x) ux 5 x 5 10 hx ( ) 11 Since u w( x) h( x), our choice of u and w is correct. Solution B: hx ( ) x 5 to be: We can take the two steps involved in the function 10 1 st : Multiply the input by nd : Subtract 5 from the result of the 1 st step, and then raise the result to the power 10. Thus, we can define the functions u and w as follows: w( x) x u( x) ( x 5) Let s check if this choice of u and w works: 10 u w( x) u w( x) ux x 5 10 hx ( ) Since u w( x) h( x), our choice of u and w is correct. In the example above we de-composed the function 10 h( x) x 5 into two functions u and w, but you may have noticed that the function really consists of a three-step process. Thus, the most natural decomposition consists of three functions. Let s find a three-function h( x) x 5 : de-composition of the function 10 h( x) x 5, find three new functions u, v, and w so that EXAMPLE: If 10 h( x) u v w ( x).
1 SOLUTION: First, let s notice that h( x) u v w ( x) u v w( x) so, in order to de-compose the function 10 w, we need to think of 10 h( x) x 5 into three functions u, v, and h( x) x 5 a three-step process where w represents the first step, v represents the second step, and u represents the third step. In this case, it is hx ( ) x 5 are: most natural to consider that the three steps involved in the function 10 1 st : Multiply the input by. rd : Subtract 5 from the result of the 1 st step. nd : Raise the result of the nd step to the power 10. Thus, we can define the functions u, v, and w as follows: w( x) x v( x) x 5 u( x) x 10 Let s check if this choice of u, v, and w works: u v w( x) u v w( x) u v x ux 5) x 5 10 hx ( ) Since u v w( x) h( x), our choice of u, v, and w is correct.