topic badge

2.7 Composition of functions

Lesson

Introduction

Learning objectives

  • 2.7.A Evaluate the composition of two or more functions for given values.
  • 2.7.B Construct a representation of the composition of two or more functions.
  • 2.7.C Rewrite a given function as a composition of two or more functions.

Composition of Functions

We can create a composite function using an operation that combines two functions f and g and produces a function h such that h\left(x\right)=g\left(f\left(x\right)\right), where the function g is applied to the result of applying the function f to x.

The output, or function values, of the function f\left(x\right) have become the input, or x-values, of the function g\left(x\right). We introduce a new symbol \circ to represent this new function.

Composite function

A function created when one function is substituted into another function

In a composition of functions, the inner function is evaluated first, followed by the outer function. For example, in the composition g\left(f\left(x\right)\right), the function f is applied first, followed by the function g. This means that \left(g \circ f\right)\left(x\right) is not necessarily equal to \left(f \circ g\right)\left(x\right).

The domain of \left(g \circ f\right)\left(x\right) is restricted to all x-values in the domain of f whose range values, f\left(x\right), are in the domain of g.

Examples

Example 1

Consider the following pair of functions:

\begin{aligned} f\left(x\right) & = -5x+5\\\ g\left(x\right) & = 2x^2+3x-10 \end{aligned}

a

Find \left(f \circ g\right)\left(x\right)

Worked Solution
Create a strategy

To find \left(f \circ g\right)\left(x\right), we will use g\left(x\right) as the input of f\left(x\right).

Apply the idea
\displaystyle \left(f \circ g\right)\left(x\right)\displaystyle =\displaystyle f\left(g\left(x\right)\right)Definition of function composition
\displaystyle =\displaystyle f\left(2x^2+3x-10\right)Substitute g\left(x\right)

The notation f\left(2x^2+3x-10\right) indicates that we should replace the independent variable in f\left(x\right) with 2x^2+3x-10.

\displaystyle f\left(x\right)\displaystyle =\displaystyle -5x+5Original function, f\left(x\right)
\displaystyle f\left(2x^2+3x-10\right)\displaystyle =\displaystyle -5\left(2x^2+3x-10\right)+5Substitute \left(2x^2+3x-10\right)
\displaystyle =\displaystyle -10x^2-15x+50+5Distribute -5
\displaystyle =\displaystyle -10x^2-15x+55Evaluate the addition

Therefore, \left(f\circ g\right)=-10x^2-15x+55.

b

Find \left(g \circ f\right)\left(x\right)

Worked Solution
Create a strategy

To find \left(g \circ f\right)\left(x\right), we will use f\left(x\right) as the input of g\left(x\right).

Apply the idea
\displaystyle \left(g \circ f\right)\left(x\right)\displaystyle =\displaystyle g\left(f\left(x\right)\right)Definition of function composition
\displaystyle =\displaystyle g\left(-5x+5\right)Substitute g\left(x\right)

The notation g\left(-5x+5\right) indicates that we should replace the independent variable in g\left(x\right) with -5x+5.

\displaystyle g\left(x\right)\displaystyle =\displaystyle 2x^2+3x-10Original function, g\left(x\right)
\displaystyle g\left(-5x+5\right)\displaystyle =\displaystyle 2\left(-5x+5\right)^2+3\left(-5x+5\right)-10Substitute \left(-5x+5\right)
\displaystyle g\left(-5x+5\right)\displaystyle =\displaystyle 2\left(25x^2-50x+25\right)+3\left(-5x+5\right)-10Square the binomial \left(-5x+5\right)
\displaystyle =\displaystyle 50x^2-100x+50-15x+15-10Distributive property
\displaystyle =\displaystyle 50x^2-115x+55Combine like terms

Therefore, \left(g\circ f\right)=50x^2-115x+55.

Reflect and check

Notice that the composition \left(g\circ f\right) resulted in a different function \left(f\circ g\right). This is because function composition is not commutative.

Example 2

A cylindrical tank initially contains 200 \text{ in}^3 of grain and starts being filled at a constant rate of 40 \text{ in}^3 per second.

The radius of the tank is 12 inches. Let g be the amount of grain in the container after t seconds.

a

State the function for h\left(g\right), the height of the grain in the container, in terms of g.

Worked Solution
Create a strategy

As the tank fills with grain, the amount of grain takes the shape of a cylinder which has a volume given by V=\pi r^2h.

We know that:

  • g represents the volume of grain

  • h\left(g\right) represents the height of the grain in terms of g

  • r is given to be 12 inches

Substituting these values into the volume of a cylinder, V=\pi r^2h, we can form an equation relating g and h\left(g\right).

Apply the idea
\displaystyle V\displaystyle =\displaystyle \pi r^2 hVolume of a cylinder
\displaystyle g\displaystyle =\displaystyle \pi \left(12\right)^2 \cdot h\left(g\right)Substituting V=g, r=12, and h=h\left(g\right)
\displaystyle g\displaystyle =\displaystyle 144 \pi \cdot h\left(g\right)Evaluating the square
\displaystyle \dfrac{g}{144\pi}\displaystyle =\displaystyle h\left(g\right)Divide both sides by 144\pi
\displaystyle h\left(g\right)\displaystyle =\displaystyle \dfrac{g}{144\pi}Symmetric property of equality

The function h\left(g\right)=\dfrac{g}{144\pi} represents the height of the grain in the container, in terms of the volume of grain g.

b

State the function for g\left(t\right), the amount of grain in the tank after t seconds.

Worked Solution
Create a strategy

We know that initially, t=0, there are 200 \text{ in}^3 of grain in the tank. Each second that passes, 40 \text{ in}^3 is added.

Apply the idea
t0123
g\left(t\right)200240280320

Creating a table of values, we can see that we have a linear equation where the amount of grain is equal to 200 plus 40 for every second that passes.

The function g\left(t\right)=40t+200

c

The function A\left(t\right) is defined as A\left(t\right)=\left( h \circ g \right)\left(t\right). Form an equation for A\left(t\right) in terms of t.

Worked Solution
Create a strategy

\left(h \circ g\right)\left(t\right) is the same as h\left(g\left(t\right)\right), so want to substitute g\left(t\right)=40t+200 into the function h\left(g\right)=\dfrac{g}{144\pi}.

Apply the idea
\displaystyle A\left(t\right)\displaystyle =\displaystyle \left( h \circ g \right)\left(t\right)
\displaystyle =\displaystyle h\left(g\left(t\right)\right)Definition of \left( h \circ g \right)\left(t\right)
\displaystyle =\displaystyle h\left(40t+200\right)Substitute g\left(t\right)
\displaystyle =\displaystyle \dfrac{40t+200}{144\pi}Substitute h\left(g\right)
\displaystyle =\displaystyle \dfrac{5t+25}{18\pi}Simplifying the quotient
Reflect and check

In the working above we substituted g\left(t\right)=40t+200 into the function for h. We can also obtain the same answer by first substituting h\left(g\right)=\dfrac{g}{144\pi} into h\left(g\left(t\right)\right):

\displaystyle A\left(t\right)\displaystyle =\displaystyle h\left(g\left(t\right)\right)
\displaystyle =\displaystyle \dfrac{g\left(t\right)}{144\pi}Substitute h\left(g\right)
\displaystyle =\displaystyle \dfrac{40t+200}{144\pi}Substitute g\left(t\right)
\displaystyle =\displaystyle \dfrac{5t+25}{18\pi}Simplifying the quotient
d

Explain what A\left(t \right) represents.

Worked Solution
Create a strategy

g\left(t\right) represents the amount of grain in the container after t seconds, and h\left(g\right) represents the height of grain in terms of the amount of grain. Composing the two gives us \left(h \circ g\right)\left(t\right). This represents height as a function of time.

Apply the idea

A\left(t \right) represents the height of the grain in the container, in inches, after t seconds.

e

If the barrel can hold 10\,000 \text{ in}^3 of grain, determine the domains of g\left(t\right), h\left(g\right) and A\left(t\right).

Worked Solution
Create a strategy

The lower boundary of the domain of g\left(t\right) is 0 as the time starts at 0 seconds. This means the lower boundary of the domain of A\left(t\right) is also 0 seconds.

To calculate the upper boundaries, we can use the fact that the barrel can hold a maximum of 10\, 000 \text{ in}^3 of grain. The time it takes to fill the barrel will be the upper boundary of both g\left(t\right) and A\left(t\right).

As g is the input for h\left(g\right), the range of g\left(t\right) will be the domain of h\left(g\right). So, the lower boundary of h\left(g\right) will be the amount of grain in the barrel initially, and the upper amount will be the maximum amount of grain the barrel can hold.

Apply the idea

The lower boundary of h\left(g\right) is 200 \text{ in}^3 as this is how much is in the barrel initially, and the upper boundary is 10\, 000 \text{ in}^3 as this is the maximum amount of grain the barrel can hold.

Calculating the total amount of time needed to fill the barrel:

\displaystyle g\left(t\right)\displaystyle =\displaystyle 40t+200
\displaystyle 10\,000\displaystyle =\displaystyle 40t+200Substitute g\left(t\right)=10\,000
\displaystyle 9800\displaystyle =\displaystyle 40tSubtract 200 from both sides
\displaystyle 245\displaystyle =\displaystyle tDivide both sides by 40

This means the barrel will be completely full after 245 seconds. The domain of both g\left(t\right) and A\left(t\right) is \left[0, 245 \right].

  • Domain of g\left(t\right): \left[0, 245\right]
  • Domain of h\left(g\right): \left[200, 10\,000\right]
  • Domain of A\left(t\right): \left[0, 245\right]

Example 3

Consider the functions f\left(x\right)=x^2 and g\left(x\right)=x+5.

a

If y=f\left(g\left(x\right)\right), state the equation for y.

Worked Solution
Create a strategy

Substitute the expression for g\left(x\right) into the equation y=f\left(g\left(x\right)\right).

Apply the idea

Substituting x+5 for g\left(x\right)into y=f\left(g\left(x\right)\right) gives y=f\left(x+5\right).

Now substitute x+5 in for x in the expression f\left(x+5\right) giving the equation y=\left(x+5\right)^2.

b

Graph the function y.

Worked Solution
Create a strategy

We can create a table of values for y=\left(x+5\right)^2.

To do this we will substitute values for x to find the y-values. Since the equation is in vertex form we can see that the vertex will be located at an x-value of -5, so we want to make sure to include that value and values to the left and right of it in our table.

Apply the idea

Substitute the values -7, -6, -5, -4, and -3 for x to find the y-values.

\left(-7+5\right)^2=\left(-2\right)^2=4

\left(-6+5\right)^2=\left(-1\right)^2=1

\left(-5+5\right)^2=\left(0\right)^2=0

\left(-4+5\right)^2=\left(1\right)^1=1

\left(-3+5\right)^2=\left(2\right)^2=4

Transferring this into a table of values we get:

xy
-74
-61
-50
-41
-34

Plotting each entry on the graph as an ordered pair we can find the graph of the function:

-7
-6
-5
-4
-3
-2
-1
1
x
-4
-3
-2
-1
1
2
3
4
y
Reflect and check

We could have also graphed the function by applying transformations which we will explore in part (c).

c

Describe the transformation of f\left(x\right) that y corresponds to.

Worked Solution
Create a strategy

We can compare the graphs of f\left(x\right) and y to determine the transformation.

Apply the idea
-7
-6
-5
-4
-3
-2
-1
1
x
-4
-3
-2
-1
1
2
3
4
y

We can see from the graph that the tranformation is a horizontal translation to the left 5 units.

Idea summary

Composite function is a function created when one function is substituted into another function.

Composition: \left(f \circ g\right)\left(x\right)= f\left(g\left(x\right)\right)

Function composition is not commutative.

That is: \left(f \circ g\right)\left(x\right) \neq \left(g \circ f\right)\left(x\right) in most cases.

Outcomes

2.7.A

Evaluate the composition of two or more functions for given values.

2.7.B

Construct a representation of the composition of two or more functions.

2.7.C

Rewrite a given function as a composition of two or more functions.

What is Mathspace

About Mathspace