Login
📚 Precalculus
Chapters ▾

5.1 Function Composition

Before we embark upon any further adventures with functions, we need to take some time to gather our thoughts and gain some perspective. Chapter first introduced us to functions in Section. At that time, functions were specific kinds of relations - sets of points in the plane which passed the Vertical Line Test, Theorem. In Section, we developed the idea that functions are processes - rules which match inputs to outputs - and this gave rise to the concepts of domain and range. We spoke about how functions could be combined in Section using the four basic arithmetic operations, took a more detailed look at their graphs in Section and studied how their graphs behaved under certain classes of transformations in Section. In Chapter, we took a closer look at three families of functions: linear functions (Section ), absolute value functions1 (Section ), and quadratic functions (Section ). Linear and quadratic functions were special cases of polynomial functions, which we studied in generality in Chapter. Chapter culminated with the Real Factorization Theorem, Theorem, which says that all polynomial functions with real coefficients can be thought of as products of linear and quadratic functions. Our next step was to enlarge our field2 of study to rational functions in Chapter. Being quotients of polynomials, we can ultimately view this family of functions as being built up of linear and quadratic functions as well. So in some sense, Chapters,, and can be thought of as an exhaustive study of linear and quadratic3 functions and their arithmetic combinations as described in Section. We now wish to study other algebraic functions, such as f ( x ) = x and g ( x ) = x 2 / 3 , and the purpose of the first two sections of this chapter is to see how these kinds of functions arise from polynomial and rational functions. To that end, we first study a new way to combine functions as defined below.

The quantity g f is also read ` g composed with f ' or, more simply ` g of f .' At its most basic level, Definition tells us to obtain the formula for ( g f ) ( x ) , we replace every occurrence of x in the formula for g ( x ) with the formula we have for f ( x ) . If we take a step back and look at this from a procedural, `inputs and outputs' perspective, Defintion tells us the output from g f is found by taking the output from f , f ( x ) , and then making that the input to g . The result, g ( f ( x ) ) , is the output from g f . From this perspective, we see g f as a two step process taking an input x and first applying the procedure f then applying the procedure g . Abstractly, we have

Coordinate-plane figure.
Figure 5.1

In the expression g ( f ( x ) ) , the function f is often called the `inside' function while g is often called the `outside' function. There are two ways to go about evaluating composite functions - `inside out' and `outside in' - depending on which function we replace with its formula first. Both ways are demonstrated in the following example.

It should be clear from Example Example 1 that, in general, when you compose two functions, such as f and g above, the order matters.4 We found that the functions f g and g f were different as were g h and h g . Thinking of functions as processes, this isn't all that surprising. If we think of one process as putting on our socks, and the other as putting on our shoes, the order in which we do these two tasks does matter.5 Also note the importance of finding the domain of the composite function before simplifying. For instance, the domain of f g is much different than its simplified formula would indicate. Composing a function with itself, as in the case of finding ( g g ) ( 6 ) and ( h h ) ( x ) , may seem odd. Looking at this from a procedural perspective, however, this merely indicates performing a task h and then doing it again - like setting the washing machine to do a `double rinse'. Composing a function with itself is called `iterating' the function, and we could easily spend an entire course on just that. The last two problems in Example Example 1 serve to demonstrate the associative property of functions. That is, when composing three (or more) functions, as long as we keep the order the same, it doesn't matter which two functions we compose first. This property as well as another important property are listed in the theorem below.

By repeated applications of Definition, we find ( h ( g f ) ) ( x ) = h ( ( g f ) ( x ) ) = h ( g ( f ( x ) ) ) . Similarly, ( ( h g ) f ) ( x ) = ( h g ) ( f ( x ) ) = h ( g ( f ( x ) ) ) . This establishes that the formulas for the two functions are the same. We leave it to the reader to think about why the domains of these two functions are identical, too. These two facts establish the equality h ( g f ) = ( h g ) f . A consequence of the associativity of function composition is that there is no need for parentheses when we write h g f . The second property can also be verified using Definition. Recall that the function I ( x ) = x is called the identity function and was introduced in Exercise in Section. If we compose the function I with a function f , then we have ( I f ) ( x ) = I ( f ( x ) ) = f ( x ) , and a similar computation shows ( f I ) ( x ) = f ( x ) . This establishes that we have an identity for function composition much in the same way the real number 1 is an identity for real number multiplication. That is, just as for any real number x , 1 x = x 1 = x , we have for any function f , I f = f I = f . We shall see the concept of an identity take on great significance in the next section. Out in the wild, function composition is often used to relate two quantities which may not be directly related, but have a variable in common, as illustrated in our next example.

A useful skill in Calculus is to be able to take a complicated function and break it down into a composition of easier functions which our last example illustrates.

Exercises

In Exercises -, use the given pair of functions to find the following values if they exist.

  • ( g f ) ( 0 )
  • ( f g ) ( 1 )
  • ( f f ) ( 2 )
  • ( g f ) ( 3 )
  • ( f g ) ( 1 2 )
  • ( f f ) ( 2 )
  1. f ( x ) = x 2 , g ( x ) = 2 x + 1
  2. f ( x ) = 4 x , g ( x ) = 1 x 2
  3. f ( x ) = 4 3 x , g ( x ) = | x |
  4. f ( x ) = | x 1 | , g ( x ) = x 2 5
  5. f ( x ) = 4 x + 5 , g ( x ) = x
  6. f ( x ) = 3 x , g ( x ) = x 2 + 1
  7. f ( x ) = 6 x x 2 , g ( x ) = x x + 10
  8. f ( x ) = x + 1 3 , g ( x ) = 4 x 2 x
  9. f ( x ) = 3 1 x , g ( x ) = 4 x x 2 + 1
  10. f ( x ) = x x + 5 , g ( x ) = 2 7 x 2
  11. f ( x ) = 2 x 5 x 2 , g ( x ) = 4 x + 1
  12. f ( x ) = 2 x + 5 , g ( x ) = 10 x x 2 + 1

In Exercises -, use the given pair of functions to find and simplify expressions for the following functions and state the domain of each using interval notation.

  • ( g f ) ( x )
  • ( f g ) ( x )
  • ( f f ) ( x )
  • f ( x ) = 2 x + 3 , g ( x ) = x 2 9
  • f ( x ) = x 2 x + 1 , g ( x ) = 3 x 5
  • f ( x ) = x 2 4 , g ( x ) = | x |
  • f ( x ) = 3 x 5 , g ( x ) = x
  • f ( x ) = | x + 1 | , g ( x ) = x
  • f ( x ) = 3 x 2 , g ( x ) = x + 1
  • f ( x ) = | x | , g ( x ) = 4 x
  • f ( x ) = x 2 x 1 , g ( x ) = x 5
  • f ( x ) = 3 x 1 , g ( x ) = 1 x + 3
  • f ( x ) = 3 x x 1 , g ( x ) = x x 3
  • f ( x ) = x 2 x + 1 , g ( x ) = 2 x + 1 x
  • f ( x ) = 2 x x 2 4 , g ( x ) = 1 x
  • ( h g f ) ( x )
  • ( h f g ) ( x )
  • ( g f h ) ( x )
  • ( g h f ) ( x )
  • ( f h g ) ( x )
  • ( f g h ) ( x )
  • p ( x ) = ( 2 x + 3 ) 3
  • P ( x ) = ( x 2 x + 1 ) 5
  • h ( x ) = 2 x 1
  • H ( x ) = | 7 3 x |
  • r ( x ) = 2 5 x + 1
  • R ( x ) = 7 x 2 1
  • q ( x ) = | x | + 1 | x | 1
  • Q ( x ) = 2 x 3 + 1 x 3 1
  • v ( x ) = 2 x + 1 3 4 x
  • w ( x ) = x 2 x 4 + 1
  • Write the function F ( x ) = x 3 + 6 x 3 9 as a composition of three or more non-identity functions.
  • Let g ( x ) = x , h ( x ) = x + 2 , j ( x ) = 3 x and k ( x ) = x 4 . In what order must these functions be composed with f ( x ) = x to create F ( x ) = 3 x + 2 4 ?
  • What linear functions could be used to transform f ( x ) = x 3 into F ( x ) = 1 2 ( 2 x 7 ) 3 + 1 ? What is the proper order of composition?

In Exercises -, use f ( x ) = 2 x , g ( x ) = x and h ( x ) = | x | to find and simplify expressions for the following functions and state the domain of each using interval notation.

In Exercises -, write the given function as a composition of two or more non-identity functions. (There are several correct answers, so check your answer using function composition.)

In Exercises -, let f be the function defined by

f = { ( 3 , 4 ) , ( 2 , 2 ) , ( 1 , 0 ) , ( 0 , 1 ) , ( 1 , 3 ) , ( 2 , 4 ) , ( 3 , 1 ) }

and let g be the function defined

g = { ( 3 , 2 ) , ( 2 , 0 ) , ( 1 , 4 ) , ( 0 , 0 ) , ( 1 , 3 ) , ( 2 , 1 ) , ( 3 , 2 ) }

. Find the value if it exists.

  1. ( f g ) ( 3 )
  2. f ( g ( 1 ) )
  3. ( f f ) ( 0 )
  4. ( f g ) ( 3 )
  5. ( g f ) ( 3 )
  6. g ( f ( 3 ) )
  7. ( g g ) ( 2 )
  8. ( g f ) ( 2 )
  9. g ( f ( g ( 0 ) ) )
  10. f ( f ( f ( 1 ) ) )
  11. f ( f ( f ( f ( f ( 1 ) ) ) ) )
  12. ( g g g ) n  times ( 0 )

In Exercises -, use the graphs of y = f ( x ) and y = g ( x ) below to find the function value.

Coordinate-plane figure.
Figure 5.4 y = f ( x )
Coordinate-plane figure.
Figure 5.5 y = g ( x )
  1. ( g f ) ( 1 )
  2. ( f g ) ( 3 )
  3. ( g f ) ( 2 )
  4. ( f g ) ( 0 )
  5. ( f f ) ( 1 )
  6. ( g g ) ( 1 )
  7. The volume V of a cube is a function of its side length x . Let's assume that x = t + 1 is also a function of time t , where x is measured in inches and t is measured in minutes. Find a formula for V as a function of t .
  8. Suppose a local vendor charges $ 2 per hot dog and that the number of hot dogs sold per hour x is given by x ( t ) = 4 t 2 + 20 t + 92 , where t is the number of hours since 10 AM, 0 t 4 .

    1. Find an expression for the revenue per hour R as a function of x .
    2. Find and simplify ( R x ) ( t ) . What does this represent?
    3. What is the revenue per hour at noon?
  9. Discuss with your classmates how `real-world' processes such as filling out federal income tax forms or computing your final course grade could be viewed as a use of function composition. Find a process for which composition with itself (iteration) makes sense.

Answers

  1. For f ( x ) = x 2 and g ( x ) = 2 x + 1 ,

    • ( g f ) ( 0 ) = 1
    • ( f g ) ( 1 ) = 1
    • ( f f ) ( 2 ) = 16
    • ( g f ) ( 3 ) = 19
    • ( f g ) ( 1 2 ) = 4
    • ( f f ) ( 2 ) = 16
  2. For f ( x ) = 4 x and g ( x ) = 1 x 2 ,

    • ( g f ) ( 0 ) = 15
    • ( f g ) ( 1 ) = 4
    • ( f f ) ( 2 ) = 2
    • ( g f ) ( 3 ) = 48
    • ( f g ) ( 1 2 ) = 13 4
    • ( f f ) ( 2 ) = 2
  3. For f ( x ) = 4 3 x and g ( x ) = | x | ,

    • ( g f ) ( 0 ) = 4
    • ( f g ) ( 1 ) = 1
    • ( f f ) ( 2 ) = 10
    • ( g f ) ( 3 ) = 13
    • ( f g ) ( 1 2 ) = 5 2
    • ( f f ) ( 2 ) = 26
  4. For f ( x ) = | x 1 | and g ( x ) = x 2 5 ,

    • ( g f ) ( 0 ) = 4
    • ( f g ) ( 1 ) = 5
    • ( f f ) ( 2 ) = 0
    • ( g f ) ( 3 ) = 11
    • ( f g ) ( 1 2 ) = 23 4
    • ( f f ) ( 2 ) = 2
  5. For f ( x ) = 4 x + 5 and g ( x ) = x ,

    • ( g f ) ( 0 ) = 5
    • ( f g ) ( 1 ) is not real
    • ( f f ) ( 2 ) = 57
    • ( g f ) ( 3 ) is not real
    • ( f g ) ( 1 2 ) = 5 + 2 2
    • ( f f ) ( 2 ) = 7
  6. For f ( x ) = 3 x and g ( x ) = x 2 + 1 ,

    • ( g f ) ( 0 ) = 4
    • ( f g ) ( 1 ) = 1
    • ( f f ) ( 2 ) = 2
    • ( g f ) ( 3 ) = 7
    • ( f g ) ( 1 2 ) = 7 2
    • ( f f ) ( 2 ) = 3 5
  7. For f ( x ) = 6 x x 2 and g ( x ) = x x + 10 ,

    • ( g f ) ( 0 ) = 24
    • ( f g ) ( 1 ) = 0
    • ( f f ) ( 2 ) = 6
    • ( g f ) ( 3 ) = 0
    • ( f g ) ( 1 2 ) = 27 2 42 8
    • ( f f ) ( 2 ) = 14
  8. For f ( x ) = x + 1 3 and g ( x ) = 4 x 2 x ,

    • ( g f ) ( 0 ) = 3
    • ( f g ) ( 1 ) = 6 3
    • ( f f ) ( 2 ) = 3 3 + 1 3
    • ( g f ) ( 3 ) = 4 4 3 + 2 3
    • ( f g ) ( 1 2 ) = 12 3 2
    • ( f f ) ( 2 ) = 0
  9. For f ( x ) = 3 1 x and g ( x ) = 4 x x 2 + 1 ,

    • ( g f ) ( 0 ) = 6 5
    • ( f g ) ( 1 ) = 1
    • ( f f ) ( 2 ) = 3 4
    • ( g f ) ( 3 ) = 48 25
    • ( f g ) ( 1 2 ) = 5
    • ( f f ) ( 2 ) is undefined
  10. For f ( x ) = x x + 5 and g ( x ) = 2 7 x 2 ,

    • ( g f ) ( 0 ) = 2 7
    • ( f g ) ( 1 ) = 1 16
    • ( f f ) ( 2 ) = 2 37
    • ( g f ) ( 3 ) = 8 19
    • ( f g ) ( 1 2 ) = 8 143
    • ( f f ) ( 2 ) = 2 13
  11. For f ( x ) = 2 x 5 x 2 and g ( x ) = 4 x + 1 ,

    • ( g f ) ( 0 ) = 1
    • ( f g ) ( 1 ) is not real
    • ( f f ) ( 2 ) = 8 11
    • ( g f ) ( 3 ) = 7
    • ( f g ) ( 1 2 ) = 3
    • ( f f ) ( 2 ) = 8 11
  12. For f ( x ) = 2 x + 5 and g ( x ) = 10 x x 2 + 1 ,

    • ( g f ) ( 0 ) = 5 5 3
    • ( f g ) ( 1 ) is not real
    • ( f f ) ( 2 ) = 11
    • ( g f ) ( 3 ) is not real
    • ( f g ) ( 1 2 ) = 13
    • ( f f ) ( 2 ) = 7
  13. For f ( x ) = 2 x + 3 and g ( x ) = x 2 9

    • ( g f ) ( x ) = 4 x 2 + 12 x , domain: ( , )
    • ( f g ) ( x ) = 2 x 2 15 , domain: ( , )
    • ( f f ) ( x ) = 4 x + 9 , domain: ( , )
  14. For f ( x ) = x 2 x + 1 and g ( x ) = 3 x 5

    • ( g f ) ( x ) = 3 x 2 3 x 2 , domain: ( , )
    • ( f g ) ( x ) = 9 x 2 33 x + 31 , domain: ( , )
    • ( f f ) ( x ) = x 4 2 x 3 + 2 x 2 x + 1 , domain: ( , )
  15. For f ( x ) = x 2 4 and g ( x ) = | x |

    • ( g f ) ( x ) = | x 2 4 | , domain: ( , )
    • ( f g ) ( x ) = | x | 2 4 = x 2 4 , domain: ( , )
    • ( f f ) ( x ) = x 4 8 x 2 + 12 , domain: ( , )
  16. For f ( x ) = 3 x 5 and g ( x ) = x

    • ( g f ) ( x ) = 3 x 5 , domain: [ 5 3 , )
    • ( f g ) ( x ) = 3 x 5 , domain: [ 0 , )
    • ( f f ) ( x ) = 9 x 20 , domain: ( , )
  17. For f ( x ) = | x + 1 | and g ( x ) = x

    • ( g f ) ( x ) = | x + 1 | , domain: ( , )
    • ( f g ) ( x ) = | x + 1 | = x + 1 , domain: [ 0 , )
    • ( f f ) ( x ) = | | x + 1 | + 1 | = | x + 1 | + 1 , domain: ( , )
  18. For f ( x ) = 3 x 2 and g ( x ) = x + 1

    • ( g f ) ( x ) = 4 x 2 , domain: [ 2 , 2 ]
    • ( f g ) ( x ) = 2 x , domain: [ 1 , )
    • ( f f ) ( x ) = x 4 + 6 x 2 6 , domain: ( , )
  19. For f ( x ) = | x | and g ( x ) = 4 x

    • ( g f ) ( x ) = 4 | x | , domain: [ 4 , 4 ]
    • ( f g ) ( x ) = | 4 x | = 4 x , domain: ( , 4 ]
    • ( f f ) ( x ) = x = | x | , domain: ( , )
  20. For f ( x ) = x 2 x 1 and g ( x ) = x 5

    • ( g f ) ( x ) = x 2 x 6 , domain: ( , 2 ] [ 3 , )
    • ( f g ) ( x ) = x 6 x 5 , domain: [ 5 , )
    • ( f f ) ( x ) = x 4 2 x 3 2 x 2 + 3 x + 1 , domain: ( , )
  21. For f ( x ) = 3 x 1 and g ( x ) = 1 x + 3

    • ( g f ) ( x ) = 1 3 x + 2 , domain: ( , 2 3 ) ( 2 3 , )
    • ( f g ) ( x ) = x x + 3 , domain: ( , 3 ) ( 3 , )
    • ( f f ) ( x ) = 9 x 4 , domain: ( , )
  22. For f ( x ) = 3 x x 1 and g ( x ) = x x 3

    • ( g f ) ( x ) = x , domain: ( , 1 ) ( 1 , )
    • ( f g ) ( x ) = x , domain: ( , 3 ) ( 3 , )
    • ( f f ) ( x ) = 9 x 2 x + 1 , domain: ( , 1 2 ) ( 1 2 , 1 ) ( 1 , )
  23. For f ( x ) = x 2 x + 1 and g ( x ) = 2 x + 1 x

    • ( g f ) ( x ) = 4 x + 1 x , domain: ( , 1 2 ) ( 1 2 , 0 ) , ( 0 , )
    • ( f g ) ( x ) = 2 x + 1 5 x + 2 , domain: ( , 2 5 ) ( 2 5 , 0 ) ( 0 , )
    • ( f f ) ( x ) = x 4 x + 1 , domain: ( , 1 2 ) ( 1 2 , 1 4 ) ( 1 4 , )
  24. For f ( x ) = 2 x x 2 4 and g ( x ) = 1 x

    • ( g f ) ( x ) = x 2 2 x 4 x 2 4 , domain: ( , 2 ) [ 1 5 , 2 ) [ 1 + 5 , )
    • ( f g ) ( x ) = 2 1 x x + 3 , domain: ( , 3 ) ( 3 , 1 ]
    • ( f f ) ( x ) = 4 x x 3 x 4 9 x 2 + 16 , domain: ( , 1 + 17 2 ) ( 1 + 17 2 , 2 ) ( 2 , 1 17 2 ) ( 1 17 2 , 1 + 17 2 ) ( 1 + 17 2 , 2 ) ( 2 , 1 + 17 2 ) ( 1 + 17 2 , )
  25. ( h g f ) ( x ) = | 2 x | = 2 x , domain: ( , 0 ]
  26. ( h f g ) ( x ) = | 2 x | = 2 x , domain: [ 0 , )
  27. ( g f h ) ( x ) = 2 | x | , domain: { 0 }
  28. ( g h f ) ( x ) = | 2 x | = 2 | x | , domain: ( , )
  29. ( f h g ) ( x ) = 2 | x | = 2 x , domain: [ 0 , )
  30. ( f g h ) ( x ) = 2 | x | ,, domain: ( , )
  31. Let f ( x ) = 2 x + 3 and g ( x ) = x 3 , then p ( x ) = ( g f ) ( x ) .
  32. Let f ( x ) = x 2 x + 1 and g ( x ) = x 5 , P ( x ) = ( g f ) ( x ) .
  33. Let f ( x ) = 2 x 1 and g ( x ) = x , then h ( x ) = ( g f ) ( x ) .
  34. Let f ( x ) = 7 3 x and g ( x ) = | x | , then H ( x ) = ( g f ) ( x ) .
  35. Let f ( x ) = 5 x + 1 and g ( x ) = 2 x , then r ( x ) = ( g f ) ( x ) .
  36. Let f ( x ) = x 2 1 and g ( x ) = 7 x , then R ( x ) = ( g f ) ( x ) .
  37. Let f ( x ) = | x | and g ( x ) = x + 1 x 1 , then q ( x ) = ( g f ) ( x ) .
  38. Let f ( x ) = x 3 and g ( x ) = 2 x + 1 x 1 , then Q ( x ) = ( g f ) ( x ) .
  39. Let f ( x ) = 2 x and g ( x ) = x + 1 3 2 x , then v ( x ) = ( g f ) ( x ) .
  40. Let f ( x ) = x 2 and g ( x ) = x x 2 + 1 , then w ( x ) = ( g f ) ( x ) .
  41. F ( x ) = x 3 + 6 x 3 9 = ( h ( g ( f ( x ) ) ) where f ( x ) = x 3 , g ( x ) = x + 6 x 9 and h ( x ) = x .
  42. F ( x ) = 3 x + 2 4 = k ( j ( f ( h ( g ( x ) ) ) ) )
  43. One possible solution is F ( x ) = 1 2 ( 2 x 7 ) 3 + 1 = k ( j ( f ( h ( g ( x ) ) ) ) ) where g ( x ) = 2 x , h ( x ) = x 7 , j ( x ) = 1 2 x and k ( x ) = x + 1 . You could also have F ( x ) = H ( f ( G ( x ) ) ) where G ( x ) = 2 x 7 and H ( x ) = 1 2 x + 1 .
  44. ( f g ) ( 3 ) = f ( g ( 3 ) ) = f ( 2 ) = 4
  45. f ( g ( 1 ) ) = f ( 4 ) which is undefined
  46. ( f f ) ( 0 ) = f ( f ( 0 ) ) = f ( 1 ) = 3
  47. ( f g ) ( 3 ) = f ( g ( 3 ) ) = f ( 2 ) = 2
  48. ( g f ) ( 3 ) = g ( f ( 3 ) ) = g ( 1 ) = 4
  49. g ( f ( 3 ) ) = g ( 4 ) which is undefined
  50. ( g g ) ( 2 ) = g ( g ( 2 ) ) = g ( 0 ) = 0
  51. ( g f ) ( 2 ) = g ( f ( 2 ) ) = g ( 2 ) = 1
  52. g ( f ( g ( 0 ) ) ) = g ( f ( 0 ) ) = g ( 1 ) = 3
  53. f ( f ( f ( 1 ) ) ) = f ( f ( 0 ) ) = f ( 1 ) = 3
  54. f ( f ( f ( f ( f ( 1 ) ) ) ) ) = f ( f ( f ( f ( 3 ) ) ) ) = f ( f ( f ( 1 ) ) ) = f ( f ( 0 ) ) = f ( 1 ) = 3
  55. ( g g g ) n  times ( 0 ) = 0
  56. ( g f ) ( 1 ) = 3
  57. ( f g ) ( 3 ) = 4
  58. ( g f ) ( 2 ) = 0
  59. ( f g ) ( 0 ) = 4
  60. ( f f ) ( 1 ) = 3
  61. ( g g ) ( 1 ) = 0
  62. V ( x ) = x 3 so V ( x ( t ) ) = ( t + 1 ) 3
    1. R ( x ) = 2 x
    2. ( R x ) ( t ) = 8 t 2 + 40 t + 184 , 0 t 4 . This gives the revenue per hour as a function of time.
    3. Noon corresponds to t = 2 , so ( R x ) ( 2 ) = 232 . The hourly revenue at noon is $ 232 per hour.

Adapted from Precalculus, 3rd corrected edition, by Carl Stitz and Jeff Zeager (stitz-zeager.com), licensed under CC BY-NC-SA 3.0. Changes were made: reformatted as an accessible XYZ web edition. License: CC-BY-NC-SA-3.0.