Composition of Functions – Example and Practice Problems

A composition of functions is formed by taking the outputs of one function and converting them into the inputs of another function. These functions can be very useful when we have to model different processes with different functions.

Here, we will explore a brief overview of function composition and we will learn how to get a composition if we have two functions. In addition, we will look at several examples with answers in order to master the process used to obtain the composition of functions.

ALGEBRA
examples of composition of functions

Relevant for

Learning about the composition of functions with examples.

See examples

ALGEBRA
examples of composition of functions

Relevant for

Learning about the composition of functions with examples.

See examples

Summary of composition of functions

The composition of functions is an operation where two functions like f(x) and g(x) generate a new function like h(x) in such a way that we have h(x)=g(f(x)).

This means that the function g is applied to the function f(x). This means that basically a function is applied to the result of another function.

Symbol: A composition of functions is also denoted as (g\circ f)(x), where the small circle, \circ, is the symbol of the composition of functions. We cannot replace the circle with a point (·) since this indicates the product of two functions.

Domain: The composition f(g(x)) is read as “f of g of x“. In this composition, the domain of the function f becomes g(x) since the domain is the set of all input values ​​of the function.

To apply the composition f\circ g, we carry out the following two steps:

Step 1: We apply the function g to the input x and obtain the result g(x) as the output.

Step 2: We apply the function f using g(x) as the input and we get the result f(g(x)) as the output.


Composition of functions – Examples with answers

The following function composition examples can be used to fully understand the process used to obtain a function composition. It is advisable to try to solve the exercises yourself before looking at the answer.

EXAMPLE 1

Find the composition f(g(x)) is we have the functions f(x)=2x+3 and g(x)=x+1.

To find the combination f(g(x)), we have to use the outputs of the function g(x) on the inputs of f(x). Therefore, we use x+1 as the inputs of the function f and we have:

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

 f(g(x))=2x+2+3

 f(g(x))=2x+5

EXAMPLE 2

Find the composition f\circ g is we have the functions f(x)={{x}^2}+5 and g(x)=x+1.

The composition f \circ g can also be written as f(g(x)). Therefore, we have to take the output of g(x) and use it as the input of f(x). We start by substituting each value of x in function f for the function g:

f(g(x))={{(x+1)}^2}+5

Now, we can apply the exponent to expand and simplify to the function:

f(g(x))={{x}^2}+2x+1+5

f(g(x))={{x}^2}+2x+6

EXAMPLE 3

We have the functions f(x)=2{{x}^2}+3x-10 and g(x)=-x+2. Find the composition f\circ g.

Similar to the previous exercise, we know that the composition f \circ g can be written as f(g(x)). Therefore, we replace each x in the function f(x) with the function g(x).

Then, we expand the parentheses with the exponent and simplify the composition of functions:

f\circ g=2{{(-x+2)}^2}+3(-x+2)-10

 =2({{x}^2}-2x+4)-3x+6-10

=2{{x}^2}-4x+8-3x+6-10

 f\circ g=2{{x}^2}-7x+4

EXAMPLE 4

Find the composition of functions g\circ f is we have f(x)=6{{x}^2}+8x-10 and g(x)=\frac{1}{2}x+5.

In this case, we have the composition g\circ f, which is equal to g(f(x)). Therefore, we use the output of f(x) as the input of g(x):

g\circ f=\frac{1}{2}(6{{x}^2}+8x-10)+5

=3{{x}^2}+4x-5+5

g\circ f=3{{x}^2}+4x

EXAMPLE 5

We have the functions f(x)=2{{x}^2}+5 and g(x)=\sqrt{-2x+4}. Find the composition f(g(x)).

We have to take the function g(x) and use it as the input of f(x). In this case, the function g(x) has a square root.

Let’s see what happens when we expand and simplify:

f(g(x))=2{{(\sqrt{-2x+4})}^2}+5

=2(-2x+4)+5

=-4x+8+5

=-4x+13

EXAMPLE 6

Calculate the composition g\circ f if we have the functions f(x)=16\sqrt{x+2} and g(x)=\sqrt{x}.

We know that this composition is equivalent to having g(f(x)). Therefore, we use the outputs of f(x) as the inputs of g(x). This case is interesting since we have a square root that goes inside another square root:

g\circ f=\sqrt{16\sqrt{x+2}}

 =4\sqrt{\sqrt{x+2}}

We can write radicals as exponential expressions with fractional exponents and then apply the power of a power rule to simplify:

 4\sqrt{\sqrt{x+2}}=4{{[{{(x+2)}^{\frac{1}{2}}}]}^{\frac{1}{2}}}

=4{{(x+2)}^{\frac{1}{4}}}

Now, we rewrite the exponential expression as the fourth root:

 g\circ f=4\sqrt[4]{x+2}

EXAMPLE 7

If we have f(x)=3{{x}^2}+2x-6, find the composition of functions f\circ f.

We start by removing the parentheses using the distributive property:

-2x(3{{x}^2}+2x-1)+4x+2{{x}^2}+6-4{{x}^3}-10x+5

=-6{{x}^3}-4{{x}^2}+2x+4x+2{{x}^2}+6-4{{x}^3}-10x+5

Here we have several terms with the variable x with different powers. We have to make sure to combine only the terms that have the same power:

=(-6{{x}^3}-4{{x}^3})+(-4{{x}^2} +2{{x}^2}) +(2x+4x-10x)+(5+6)

=-10{{x}^3}-2{{x}^2}-4x+11


Composition of functions – Practice problems

Put into practice what you have learned about the composition of functions by solving the following problems. Choose an answer and check it to see if you got the correct answer. Check out the solved examples above in case you need help.

Find the composition f(g(x)) if we have the functions f(x)=4x+2 and g(x)=x+2.

Choose an answer






Find the composition f\circ g if we have the functions f(x)=2{{x}^2}-3x-1 and g(x)=-x+5.

Choose an answer






If we have f(x)=-10{{x}^2}+6x-4 and g(x)=\frac{1}{2}x+2, find g\circ f.

Choose an answer






Find the composition f(g(x)) with the functions f(x)=4{{x}^2}-4 and g(x)=\sqrt{-5x+1}.

Choose an answer






Find the composition f\circ f is we have f(x)=-3{{x}^2}-7x+4.

Choose an answer







See also

Interested in learning more about functions? Take a look at these pages:

Learn mathematics with our additional resources in different topics

LEARN MORE