Worksheet 2: Composition of functions Name: Date: Let there be two functions defined as: f:A→B by f(x) for all x∈A g: B→C by g(x) for all x∈B Then, the new function, “gof” read as "g circle f" or "g composed with f", is defined as: g Domain of f(x) Domain of h(x) Range of f(x) Domain of g(f(x)) f ( x) g ( f ( x)) , for all x∈A Range of g(x) Range of h(x) = g(f(x)) Example 1: Let two functions be defined as: f={(1,2) ,(2,3) ,(3,4) ,(4,5) } and g={(2,4) ,(3,2) ,(4,3) ,(5,1) } Check whether “gof” and “fog” exist for the given functions. Solution: Hence, Domain Range ⇒Range of “f”⊂Domain of “g” “gof”exists. f {1,2,3,4} {2,3,4,5} g {2,3,4,5} {4,2,3,1}={1,2,3,4} ⇒Range of “g”⊂Domain of “f” “fog” exists. It means that both compositions “gof” and “fog” exist for the given sets. 1 Example 2: Given f ( x) 2 x 1 and g ( x) x 2 3 , find: a. ( f o g)(x). b. ( g o f)(x). c. ( f o f)(x). d. ( g o g)(x). Solution: a. f g x f g x f x 2 3 2 x 2 3 1 2 x 2 7 . b. c. d. g f x g f x g 2 x 1 2 x 1 3 f g f x f f x f 2x 1 2 2 x 1 1 4x 3 2 4 x 2 4 x 1 3 4 x 2 4 x 2 g x g g x g x 2 3 x 2 3 3 2 x4 6x2 9 3 x4 6 x2 6 Note that: f g x 2x2 7 g f x 4x2 4x 2 That is, ( f o g)(x) is not the same as (g o f )(x). The open dot "o" is not the same as a multiplication dot "•", nor does it mean the same thing. 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] Domain and range of the composition of functions Consider the function: f ( x) 1 , when x 1 Domain of f is 1 , i.e. all real numbers but 1. 1 x 2 Let us now see the expression of composition of function with itself, f 1 1 f x f f x f 1 x 1 1 1 x 1 1 1 x x 1 valid for real values of x≠0. 1 x 1 x x x 1 x 1 x 1 x Since f is undefined for x = 1, and f composition f f is undefined for x = 0, thus the domai n of the f x is : 0,1 ; i.e. all real numbers except 0 and 1. Sometimes you have to be careful with the domain and range of the composite function. General rule to determine the domain: f ( x) Polynomial f ( x) x0 Domain 1 x f ( x) x f ( x) log( x) f ( x) a x x0 x0 , for a 0 , 0 ,for a 0 Example: Given f ( x) x and g ( x) x 3 , find the domains of ( f o g)(x) and (g o f )(x). Solution: f ( x) x x 0 So: f g x f g x x 3 x 3 0 x 3 Hence, the domain of ( f o g)(x) is "all x > 3". Now do the other composition: g f x g g x ... Hence, the domain of (gof)(x) is … 3 Going backward: given composed function, find original functions 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 they'll ask you to come up with the two original functions that they composed. Example 1: Given h x x 5 3 x 5 7 , determine two functions f (x) and g(x) which, when composed, generate h(x). 2 Solution: 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 x 2 3 x 7 , except that, instead of squaring x, they're squaring x + 5. So let's make g(x) = x + 5, and then plug this function into f x x2 3x 7 : f g x f g x f x 5 x 5 3 x 5 7 2 Then h(x) may be stated as the composition of f x x2 3x 7 and g(x) = x + 5. Example 2: Given h x 3x 4 , determine two functions f (x) and g(x) which, when composed, generate h(x). Solution: Since the square root is "on" (or "around") the "3x + 4", then the 3x + 4 is put inside the square root, that is: h ( x ) f ( g ( x )) x 3x 4 g x f x 3x 4 Thus, g(x) = 3x + 4, f x x , and h(x) = ( f o g)(x). 4 Exercise For the given functions: a. f(x) = x + 1 , g(x) = 3x b. f ( x) x 2 1, g ( x) 2 x c. f ( x) x 1, g ( x) x 2 5 d. f(x) = 2x + 1 , g(x) = x2 Find: 1. Domain and range of each f(x) and g(x) f x g x a. Domain = Range = b. Domain = Range = b. Domain = Range = Domain = Range = Domain = Range = Domain = Range = c. Domain = Range = Domain = Range = 2. Determine f g x and its domain a. f g x Domain = b. f g x Domain = c. f g x 5 Domain = d. f g x Domain = 3. Determine g f x and its domain a. g f x Domain = b. g f x Domain = c. g f x Domain = d. g f x Domain = 4. Determine f a. f f x and its domain f x Domain = b. f f x 6 Domain = c. f f x Domain = d. f f x Domain = 5. Determine g g x and its domain a. g g x Domain = b. g g x Domain = c. g g x Domain = d. g g x Domain = 6. A function is defined for real values by : f ( x) 1 for all real values except x 1 x =1 . Determine f f f x and draw the graph of resulting composition! 7 7. Given f(2) = 3, g(3) = 2, f(3) = 4 and g(2) = 5, evaluate (f o g)(3)! 8. Functions f and g are as sets of ordered pairs f = {(-2,1),(0,3),(4,5)} and g = {(1,1),(3,3),(7,9)} Find the composite function defined by g o f and describe its domain and range. 9. Write function F given below as the composition of two functions f and g, where 1 1 g ( x ) and F ( x) x 1 x x 8 10. Evaluate f(g(h(1))), if possible, given that h( x) x , g ( x) x 1, and f ( x) 1 . x2 11. For the composite function f g ( x) and f ( x) , find g x ! a. f g ( x) x , f ( x) x 2 2 b. f g ( x) 2 x 6 x 2 1 , f ( x ) 2 x 3 x 1 c. f g ( x) x 1 4 , f x x 2 4 d. f g ( x) x, f x x 2 5 2 9 12. For the composite function f g ( x) and g ( x ) , find f x ! e. f g ( x) sin x 2 1 , g ( x) x 2 1 f. f g ( x) x , g ( x) 1 x 2 g. f g ( x) 4 x, g ( x) x 1 x , g ( x) 1 1 h. f g ( x) x 1 1 1 x 1 10