Loading [MathJax]/jax/output/HTML-CSS/fonts/TeX/fontdata.js
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

6.4: Composition of Functions

( \newcommand{\kernel}{\mathrm{null}\,}\)

PREVIEW ACTIVITY 6.4.1: Constructing a New Function

Let A={a,b,c,d}, B={p,q,r}, and C={s,t,u,v}. The arrow diagram in Figure 6.6 shows two functions: f:AB and g:BC. Notice that if xA, then f(x)B. Since f(x)B, we can apply the function g to f(x), and we obtain g(f(x)), which is an element of C.

Using this process, determine g(f(a)), g(f(b)), g(f(c)), and g(f(d)). Then explain how we can use this information to define a function from A to C.

imageedit_3_6667660914.png

Figure 6.6: Arrow Diagram Showing Two Functions

PREVIEW ACTIVITY 6.4.1: Verbal Descriptions of Functions

The outputs of most real functions we have studied in previous mathematics courses have been determined by mathematical expressions. In many cases, it is possible to use these expressions to give step-by-step verbal descriptions of how to compute the outputs. For example, if

f:RR is defined by f(x)=(3x+2)3,

we could describe how to compute the outputs as follows:

Step Verbal Description Symbolic Result
1 Choose an input. x
2 Multiply by 3. 3x
3 Add 2. 3x+2
4 Cube the result. (3x+3)3

Complete step-by-step verbal descriptions for each of the following functions.

  1. f:RR by f(x)=3x2+2, for each xR.
  2. g:RR by g(x)=sin(3x2+2), for each xR.
  3. h:RR by h(x)=e3x2+2, for each xR.
  4. G:RR by G(x)=ln(x4+3), for each xR.
  5. k:RR by k(x)=3sin(4x+3)x2+1, for each xR.

Composition of Functions

There are several ways to combine two existing functions to create a new function. For example, in calculus, we learned how to form the product and quotient of two functions and then how to use the product rule to determine the derivative of a product of two functions and the quotient rule to determine the derivative of the quotient of two functions. The chain rule in calculus was used to determine the derivative of the composition of two functions, and in this section, we will focus only on the composition of two functions. We will then consider some results about the compositions of injections and surjections.

The basic idea of function composition is that when possible, the output of a function f is used as the input of a function g. This can be referred to as “f followed by g” and is called the composition of f and g. In previous mathematics courses, we used this idea to determine a formula for the composition of two real functions.

For example, if

f(x)=3x2+2 and g(x)=sinx

then we can compute g(f(x)) as follows:

g(f(x))=g(3x2+2)=sin(3x2+2).

In this case, f(x), the output of the function f, was used as the input for the function g. We now give the formal definition of the composition of two functions.

Definition: composite function

Let A, B, and C be nonempty sets, and let f:AB and g:BC be functions. The composition of f and g is the function gf:AC defined by

(gf)(x)=g(f(x))

for all xA. We often refer to the function gf as a composite function.

It is helpful to think of composite function gf as "f followed by g". We then refer to f as the inner function and g as the outer function.

Composition and Arrow Diagrams

The concept of the composition of two functions can be illustrated with arrow diagrams when the domain and codomain of the functions are small, finite sets. Although the term “composition” was not used then, this was done in Preview Activity 6.4.1, and another example is given here.

Let A={a,b,c,d}, B={p,q,r}, and C={s,t,u,v}. The arrow diagram in Figure 6.7 shows two functions: f:AB and g:BC.

屏幕快照 2019-04-01 下午4.00.46.png

If we follow the arrows from the set A to the set C, we will use the outputs of f as inputs of g, and get the arrow diagram from A to C shown in Figure 6.8. This diagram represents the composition of f followed by g.

屏幕快照 2019-04-01 下午4.01.53.png

Progress Check 6.17 (The Composition of Two Functions)

Let A={a,b,c,d} and B={1,2,3}. Define the function f and g as follows:

f:AB defined by f(a)=2, f(b)=3, f(c)=1, and f(d)=2.

g:AB defined by g(1)=3. g(2)=1, and g(3)=2.

Create arrow diagrams for the function f, g, gf, and gg.

Answer

Add texts here. Do not delete this text first.

Decomposing Functions

We use the chain rule in calculus to find the derivative of a composite function. The first step in the process is to recognize a given function as a composite function. This can be done in many ways, but the work in Preview Activity 6.4.2 can be used to decompose a function in a way that works well with the chain rule. The use of the terms “inner function” and “outer function” can also be helpful. The idea is that we use the last step in the process to represent the outer function, and the steps prior to that to represent the inner function. So for the function,

f:RR by f(x)=(3x+2)3,

the last step in the verbal description table was to cube the result. This means that we will use the function g (the cubing function) as the outer function and will use the prior steps as the inner function. We will denote the inner function by h. So we let h:RR by h(x)=3x+2 and g:RR by g(x)=x3. Then

(gh)(x)=g(h(x))=g(3x+2)=(3x+2)3=f(x).

We see that gh=f and, hence, we have “decomposed” the function f. It should be noted that there are other ways to write the function f as a composition of two functions, but the way just described is the one that works well with the chain rule. In this case, the chain rule gives

f(x)=(gh)(x)=g(h(x))h(x)=3(h(x))23=g(3x+2)2

Progress Check 6.18 (Decomposing Functions

Write each of the following functions as the composition of two functions.

  1. F:RR by F(x)=(x2+3)3
  2. G:RR by G(x)=In(x2+3)
  3. f:ZZ by f(x)=|x23|
  4. g:RR by g(x)=cos(2x3x2+1)
Answer

Add texts here. Do not delete this text first.

Theorems about Composite Functions

If f:AB and g:BC, then we can form the composite function gf:AC. In Section 6.3, we learned about injections and surjections. We now explore what type of function gf will be if the functions f and g are injections (or surjections).

Progress Check 6.19: Compositions of Injections and Surjections

Although other representations of functions can be used, it will be helpful to use arrow diagrams to represent the functions in this progress check. We will use the following sets:

A={a,b,c}, B={p,q,r}, C={u,v,w,x}, and D={u,v}.

  1. Draw an arrow diagram for a function f:AB that is an injection and an arrow diagram for a function g:BC that is an injection. In this case, is the composite function gf:AC an injection? Explain.
  2. Draw an arrow diagram for a function f:AB that is a surjection and an arrow diagram for a function g:BD that is a surjection. In this case, is the composite function gf:AD a surjection? Explain.
  3. Draw an arrow diagram for a function f:AB that is a bijection and an arrow diagram for a function g:BA that is a bijection. In this case, is the composite function gf:AA bijection? Explain.
Answer

Add texts here. Do not delete this text first.

In Progress Check 6.19, we explored some properties of composite functions related to injections, surjections, and bijections. The following theorem contains results that these explorations were intended to illustrate. Some of the proofs will be included in the exercises.

Theorem 6.20.

Let A, B, and C be nonempty sets and assume that f:AB and g:BC.

  1. If f and g are both injections, then (gf):AC is an injection.
  2. If f and g are both surjections, then (gf):AC is an surjection.
  3. If f and g are both bijections, then (gf):AC is an bijection.
Proof

The proof of Part (1) is Exercise (6).

Part (3) is a direct consequence of the first two parts. We will discuss a process for constructing a proof of Part (2). Using the forward-backward process, we first look at the conclusion of the conditional statement in Part (2). The goal is to prove that gf is a surjection. Since (gf):AC, this is equivalent to proving that

For all cC, there exists an aA such that (gf)(a)=c.

Since this statement in the backward process uses a universal quantifier, we will use the choose-an-element method and choose an arbitrary element c in the set C. The goal now is to find an aA such that (gf)(a)=c.

Now we can look at the hypotheses. In particular, we are assuming that both f:AB and g:BC are surjections. Since we have chosen cC, and g:BC is a surjection, we know that

there exists a bB such that g(b)=c.

Now, bB and f:AB is a surjection. Hence

there exists an aA such that f(a)=b.

If we now compute (gf)(a), we will see that

(gf)(a)=g(f(a))=g(b)=c.

We can now write the proof as follows:

Proof of Theorem 6.20, Part (2)

Let A, B, and C be nonempty sets and assume that f:AB and g:BC are both surjections. We will prove that gf:AC is a surjection.

Let c be an arbitrary element of C. We will prove there exists an aA such that (gf)(a)=c. Since g:BC is a surjection, we conclude that

there exists a bB such that g(b)=c.

Now, bB and f:AB is a surjection. Hence

there exists an aA such that f(a)=b.

We now see that

(gf)(a)=g(f(a))=g(b)=c.

We have now shown that for every cC, there exists an aA such that (gf)(a)=c, and this proves that gf is a surjection.

Theorem 6.20 shows us that if f and g are both special types of functions, then the composition of f followed by g is also that type of function.The next question is, “If the composition of f followed by g is an injection (or surjection), can we make any conclusions about f or g?” A partial answer to this question is provided in Theorem 6.21. This theorem will be investigated and proved in the Explorations and Activities for this section. See Exercise (10).

Theorem 6.21

Let A, B, and C be nonempty sets and assume that f:AB and g:BC.

  1. If gf:AC is an injection, then f:AB is an injection.
  2. If gf:AC is a surjection, then f:AB is a surjection.
Exercise 6.4
  1. In our definition of the composition of two functions, f and g, we required that the domain of g be equal to the codomain of f. However, it is sometimes possible to form the composite function gf even though dom(g) codom(f). For example, let
    f:RRtextbedefinedbyf(x)=x2+1, and letg:R{0}Rtextbedefinedbyg(x)=1x.

    (a) Is it possible to determine (gf)(x) for all xR? Explain.
    (b) In general, let f:AT and g:BC. Find a condition on the domain of g (other than B=T) that results in a meaningful definition of the composite function gf:AC.
  2. Let h:RR be defined h(x)=3x+2 and g:RR be defined by g(x)=x3. Determine formulas for the composite functions gh and hg. Is the function gh equal to the function hg? Explain. What does this tell you about the operation of composition of functions?
  3. Following are formulas for certain real functions. Write each of these real functions as the composition of two functions. That is, decompose each of the functions.

    (a) F(x)=cos(ex)
    (b) G(x)=ecos(x)
    (c) H(x)=1sinx
    (d) K(x)=cos(ex2)
  4. The identity function on a set S, denoted by IS, is defined as follows: IS:SS by Is(x)=x for each xS. Let f:AB.

    (a) For each xA, determine (fIA)(x) and use this to prove that fIA=f.
    (b) Prove that IBf=f.
  5. (a) Let f:RR be defined by f(x)=x2, let g:RR be defined by g(x)=sinx, and let h:RR be defined by h(x)=3x.

    Determine formulas for [(hg)f](x) and [h(gf)](x).

    Does this prove that (hg)f=h(gf) for these particular functions? Explain.

    (b) Now let A, B, and C be sets and let f:AB, g:BC, and h:CD. Prove that (hg)f=h(gf). That is, prove that function composition is an associative operation.
  6. Prove Part (1) of Theorem 6.20.
    Let A, B, and C be nonempty sets and let f:AB and g:BC. If f and g are both injections, then gf is an injection.
  7. For each of the following, give an example of functions f:AB and g:BC that satisfy the stated conditions, or explain why no such example exists.

    (a) The function f is a surjection, but the function gf is not a surjection.
    (b) The function f is an injection, but the function gf is not an injection.
    (c) The function g is a surjection, but the function gf is not a surjection.
    (d) The function g is an injection, but the function gf is not an injection.
    (e) The function f is not a surjection, but the function gf is a surjection.
    (f) The function f is not an injection, but the function gf is an injection.
    (g) The function f is not an injection, but the function gf is an injection.
    (h) The function g is not an injection, but the function gf is an injection.
  8. Let A be a nonempty set and let f:AA. For each nN, define a funciton fn:AA recursively as follows: f1=f and for each nN, fn+1=ffn. For example, f2=ff1=ff and f3=ff2=f(ff).

    (a) Let f:RR by f(x)=x+1 for each xR. For each nN and for each xR, determine a formula for fn(x) and use induction to prove that your formula is correct.
    (b) Let a,bR and let f:RR by f(x)=ax+b for each xR. For each nN and for each xR, determine a formula for fn(x) and use induction to prove that your formula is correct.
    (c) Now let A be a nonempty set and let f:AA. Use induction to prove that for each nN, fn+1=fnf. (Note: You will need to use the result in Exercise (5).)

    Explorations and Activities
  9. Exploring Composite Functions. Let A, B, and C be nonempty sets and let f:AB and g:BC. For this activity, it may be useful to draw your arrow diagrams in a triangular arrangement as follows:
    屏幕快照 2019-04-01 下午5.09.57.png
    It might be helpful to consider examples where the sets are small. Try constructing examples where the set A has 2 elements, the set B has 3 elements, and the set C has 2 elements.

    (a) Is it possible to construct an example where gf is an injection, f is an injection, but g is not an injection? Either construct such an example or explain why it is not possible.
    (b) Is it possible to construct an example where gf is an injection, g is an injection, but f is not an injection? Either construct such an example or explain why it is not possible.
    (c) Is it possible to construct an example where gf is a surjection, f is a surjection, but g is not a surjection? Either construct such an example or explain why it is not possible.
    (d) Is it possible to construct an example where gf is a surjection, g is a surjection, but f is not a surjection? Either construct such an example or explain why it is not possible.
  10. The Proof of Theorem 6.21. Use the ideas from Exercise (9) to prove Theorem 6.21. Let A, B and C be nonempty sets and let f:AB and g:BC.

    (a) If gf:AC is an injection, then f:AB is an injection.
    (b) If gf:AC is a surjection, then g:BC is a surjection.

    Hint: For part (a), start by asking, “What do we have to do to prove that f is an injection? ” Start with a similar question for part (b).
Answer

Add texts here. Do not delete this text first.


This page titled 6.4: Composition of Functions is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Ted Sundstrom (ScholarWorks @Grand Valley State University) via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?