Worksheet 2: Composition of functions
Name:
Date:
Let there be two functions defined as:
f:AB by f(x) for all xA
g: BC by g(x) for all xB
Then, the new function, gof
read as "g circle f" or "g
composed with f", is defined
as:
 g o f  ( x)  g ( f ( x)) , for all xA
Domain of
f(x)
Domain of
Range of f(x)
Domain of
g(f(x))
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:
f
g
Domain
{1,2,3,4}
{2,3,4,5}
Range
{2,3,4,5}
{4,2,3,1}={1,2,3,4}
Hence,
Range of fDomain of g gofexists.
Range of gDomain of f fog exists.
It means that both compositions gof and fog exist for the given sets.
Example 2:
2
Given f ( x )  2 x  1 and g ( x)   x  3 , find:
a. ( f o g)(x).
b. ( g o f)(x).
c. ( f o f)(x).
d. ( g o g)(x).
Solution:
f og   x   f  g  x    f   x 2  3  2   x 2  3  1  2 x 2  7
a.
.
2
g o f   x   g  f  x    g  2 x  1    2 x  1  3
b. 
   4 x 2  4 x  1  3  4 x 2  4 x  2
c.
d.
f o f   x   f  f  x    f  2 x  1  2  2 x  1  1  4 x  3
 g og   x   g  g  x    g   x 2  3     x 2  3
   x4  6 x2  9  3   x4  6 x2  6
Note that:
 f og   x   2 x 2  7   g o f   x   4 x 2  4 x  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
,
1  x when x  1  Domain of f is  x : x  R \ 1 , i.e. all real numbers except 1.
Let us now see the expression of composition of function with itself,
1 
1
 
1
 1  x
1
1 x
1
1
1 x x 1
1 x
1
x
x
x
1 x 1 x 1 x
f o f   x  f  f  x   f 
 valid for real values of x0.
Since f is undefined for x = 1, and f o f is undefined for x = 0, thus the domain of the composition
 f o f   x  is :  x : x  R \ x  0, x  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
Domain
f ( x) 
x0
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 og   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 o f   x   g  g  x    ...
Hence, the domain of (gof)(x) is 
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:
h  x    x  5  3  x  5  7
Given
, 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.
2
In this case, this looks similar to the quadratic x  3 x  7 , except that, instead of squaring x, they're
squaring x + 5.
f  x   x 2  3x  7
So let's make g(x) = x + 5, and then plug this function into
:
2
 f og   x   f  g  x    f  x  5   x  5  3  x  5  7
Then h(x) may be stated as the composition of
f  x   x 2  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 ))
g x
x       3x 4
Thus, g(x) = 3x + 4,
f  x
f  x  x
 3x
, and h(x) = ( f o g)(x).
Exercise
For the given functions:
a. f(x) = x + 1 , g(x) = 3x
2
b. f ( x)  x  1, g ( x )  2 x
2
c. f ( x)   x  1, g ( x)  x  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 =
Domain =
Range =
Range =
b. Domain =
Domain =
Range =
Range =
b. Domain =
Domain =
Range =
Range =
c. Domain =
Domain =
Range =
Range =
2. Determine
 f og   x 
a.
f og   x 
and its domain
Domain =
b.
f og   x 
Domain =
c.
f og   x 
Domain =
d.
f og   x 
Domain =
a.
3. Determine
 g o f   x
 g o f   x  and its domain
Domain =
b.
 g o f   x
Domain =
c.
 g o f   x
Domain =
d.
 g o f   x
Domain =
4. Determine
 f o f   x
a.
 f o f   x  and its domain
Domain =
b.
 f o f   x
Domain =
c.
 f o f   x
Domain =
d.
 f o f   x
Domain =
5. Determine
 g og   x 
a.
 g og   x  and its domain
Domain =
b.
 g og   x 
Domain =
c.
 g og   x 
Domain =
d.
 g og   x 
Domain =
f ( x) 
1
1  x for all real values except x =1 .
6. A function is defined for real values by :
f f  f  x 
Determine
and draw the graph of resulting composition!
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
F ( x) 
g ( x) 
1
x and
1 x
10. Evaluate f(g(h(1))), if possible, given that
11. For the composite function
 f og  ( x )  x , f ( x )  x 2  2
a.
b.
c.
d.
f og  ( x )
h( x)   x , g ( x)  x  1,
f og  ( x )  2 x 6  x 2  1 f ( x )  2 x 3  x  1
,
f og  ( x )   x  1  4
f og  ( x )  x, f  x   x 2  5
1
x2.
g  x
and f ( x) , find
!
and
f ( x) 
f  x   x2  4
 f og  ( x) and g ( x) , find f  x  !
12. For the composite function
f og  ( x)  sin  x 2  1 g ( x)  x 2  1
e.
,
f.
 f og  ( x )  x ,
g.
h.
g ( x)  1  x 2
f o g  ( x )  4  x, g ( x )  x
f og  ( x ) 
1
x
1
1
 1    1 g ( x)  1 
x
x
,
10