Return to the Purplemath home page

 


powered by FreeFind

 

Print-friendly page

 

 

Composition of Functions:
     Composing Functions with Functions
(page 3 of 5)

Sections: Composing functions that are sets of point, Composing functions at points, Composing functions with other functions, Word problems using composition, Inverse functions and composition


You can also evaluate compositions symbolically. It is simpler to evaluate a composition at a point because you can simplify as you go. That is, you'll always just be plugging in a number. Evaluating a symbolic compositon, where you're first plugging x into some function and then plugging that function into some other function, can be much messier. But the process works just as the at-a-number composition does. However, using parentheses to be carefully explicit at each step will be even more helpful at this stage.

  • Given f(x) = 2x + 3 and g(x) = –x2 + 5, find ( f o g)(x).
  • In this case, I am not trying to find a certain value. Instead, I am finding the formula that results from plugging the g(x) rule into the f(x) rule. Write the rules as you go, using parentheses to indicate where the input (the formula from the one function) should go (in the formula for the other function):

      ( f o g)(x) = f (g(x))
          = f (–x2 + 5)
          = 2(             ) + 3     ... setting up to insert the input
          = 2(–x2 + 5) + 3
          = –2x2 + 10 + 3
          = –2x2 + 13

If you plug in "1" for the x, you will get ( f o g)(1) = –2(1)2 + 13 = –2 + 13 = 11, which is the same answer we got before. So when you are evaluating at a point, you can either plug in and then evaluate as you go along (the way I did it the first time), or else evaluate symbolically and then plug the number in at the end (the way I did it this time). The choice is up to you.

  • Given f(x) = 2x + 3 and g(x) = –x2 + 5, find (g o f )(x).
    • (g o f )(x) = g( f(x))
          = g(2x + 3)
          = –(           )2 + 5    ... setting up to insert the input
          = –(2x + 3)2 + 5
          = –(4x2 + 12x + 9) + 5
          = –4x2 – 12x – 9 + 5
          = –4x2 – 12x – 4


There is something you should note from these two symbolic examples. Look at the results I got:

    ( f o g)(x) = –2x2 + 13
    (g o f )(x) = –4x2 – 12x – 4

That is, ( f o g)(x) is not the same as (g o f )(x). This is true in general, meaning that you should assume that the compositions ( f o g)(x) and (g o f )(x) are going to be different. In particular, this helps remind you that composition is not the same thing as multiplication. That is, the open dot "o" is not the same as a multiplication dot "•", nor does it mean the same thing. While the following is true:

    f(x) g(x) = g(x) f(x)            [always true for multiplication]

...you cannot say that:

    ( f o g)(x) = (g o f )(x)           [generally false for composition]

That is, you cannot reverse the order in composition and expect to end up with the correct result. Composition is not flexible like multiplication, and is an entirely different process. Do not try to multiply functions when you are supposed to be plugging them into each other.


  • Given f(x) = 2x + 3 and g(x) = –x2 + 5, find ( f o f )(x).
    • ( f o f )(x) = f ( f (x))
          = f (2x + 3)
          = 2(           ) + 3    ... setting up to insert the input
          = 2(2x + 3) + 3
          = 4x + 6 + 3
          = 4x + 9

  • Given f(x) = 2x + 3 and g(x) = –x2 + 5, find (g o g)(x).
    • (g o g)(x) = g(g(x))
          = –(             )2 + 5     ... setting up to insert the input
          = –(–x2 + 5)2 + 5
          = –(x4 – 10x2 + 25) + 5
          = –x4 + 10x2 – 25 + 5
          = x4 + 10x2 – 20


Sometimes you have to be careful with the domain and range of the composite function.

  • Given f (x) = sqrt(x) and g(x) = x – 2, find the domains of ( f o g)(x) and (g o f )(x).
  • Since  f (x) involves a square root, the inputs have to be non-negative. This means that the domain (the set of x-values) for f (x) is "all x > 0". Then, in (g o f )(x), where I'm plugging x first into f (x) = sqrt(x), the domain is at least restricted to "all x > 0". Let's see what the two compositions look like:   Copyright © Elizabeth Stapel 2006-2008 All Rights Reserved

      ( f o g)(x) =  f (g(x))
          f (x – 2)
          = sqrt(         )
          = sqrt(x – 2)

    The domain for the square root is all inputs that make "x – 2" non-negative. That is, all x such that x – 2 > 0. Solving this for x, I get that the domain of ( f o g)(x) is "all x > 2".

    Now to do the other composition:

      (g o f )(x) = g( f (x))
          = g( sqrt(x) )
          = (              ) – 2
          = ( sqrt(x) ) – 2
          = sqrt(x) – 2

    The domain for this is all inputs that make the square root defined. Since there is only "x" inside the square root, then the domain of (g o f )(x) is "all x > 0".

If your initial functions are just plain old polynomials, then their domains are "all x", and so will be the domain of the composition. It's pretty much only if your dealing with denominators (where you can't divide by zero) or square roots (where you can't have a negative) that the domain ever becomes an issue.


Usually composition is used to combine two functions. But sometimes you are asked to go backwards. That is, they will give you a function, and ask you to come up with the two original functions that they composed. For example:

  • Given h(x) = (x + 1)2 + 2(x + 1) – 3, determine two functions f (x) and g(x) which, when composed, generate h(x).
  • This is asking you to notice patterns and to figure out what is "inside" something else. In this case, this looks similar to the quadratic x2 + 2x – 3, except that, instead of squaring x, they're squaring x + 1. In other words, this is a quadratic into which they've plugged x + 1. So let's make g(x) = x + 1, and then plug this into f (x) = x2 + 2x – 3:

      ( f o g)(x) = f (g(x))
          = f (x + 1)
          = (         )2 + 2(         ) – 3
          = (x + 1)2 + 2(x + 1) – 3

    Then h(x) may be stated as the composition of  f (x) = x2 + 2x – 3 and g(x) = x + 1.

  • Given h(x) = sqrt(4x + 1), determine two functions f (x) and g(x) which, when composed, generate h(x).
  • Since the square root is "on" (or "around") the "4x + 1", then the 4x + 1 is put inside the square root. That is, I need to take x, do "4x + 1" to it, then then take the square root of the result. Then:

      g(x) = 4x + 1,  f(x) = sqrt(x), and h(x) = ( f o g)(x).

<< Previous  Top  |  1 | 2 | 3 | 4 | 5  |  Return to Index  Next >>

Cite this article as:

Stapel, Elizabeth. "Composing Functions with Functions." Purplemath. Available from
    http://www.purplemath.com/modules/fcncomp3.htm. Accessed
 

 

Lessons index

Lessons CD




Purplemath:
  Linking to this site
  Printing pages
  Donating
  School licensing


Reviews of
Internet Sites:
   Free Help
   Practice
   Et Cetera

The "Homework
   Guidelines"

Study Skills Survey

Tutoring ($$)


This lesson may be printed out for your personal use.

Content copyright protected by Copyscape website plagiarism search
  

  Copyright © 2006-2008  Elizabeth Stapel   |   About   |   Terms of Use

 

 Feedback   |   Error?