Download algebra help software 
Algebra Help  
HelpAlgebra.com - Your Online Algebra Resource
Algebra Help Home > Algebra Help Articles > How to find Compositions of Functions

How to Find Compositions of Functions

f°g(x)=f(g(x))

This is called the composition of the functions f and g and the idea behind it is to do the two operations of the function one after another. If you think of functions as little machines it is like linking up the two machines together to form a new machine. This goes in reverse order of the way it is written, because this makes the order come out right with the nested parentheses. What is happening here is that the x goes into the g machine first and out comes g(x). Then the g(x) goes into the f machine and out comes f(g(x)). So for example, if f(x)=x+1 and g(x)=x2 , then since g is the function that squares a number, and f is the function that adds 1 to a number, the composition function fog would be the function that first squares the number and then adds 1 to the result of that, or fog(x)=x2+1. For more complicated functions it might be difficult to keep track of it that way, but that is not a problem, because if you just follow the definition, the notation is designed to make it come out right without thinking about it too much. So, for example, in this problem you could also figure it out simply by writing down

fog(x)=f(g(x))

and replacing things with what they are equal to.

fog(x)=f(g(x))=f(x2)

At this point you have to make sure to use function notation correctly (See my article Using Function Notation.) If it helps, rewrite the definition for f without the x. f(    )=(    )+1 and fill in the holes. (I will be doing that in all of the examples below, but you don't need to do it if you can keep track of things simply by replacing the x with what is in the parentheses.)

f(x2)=(x2)+1=x2+1.

In a similar way, we can find g°f. This should be the function that adds 1 and then squares.

gof(x)=g(f(x))=g(x+1).
g(     )=(     )2

so filling in the x+1, we get

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

One interesting thing to notice from this is that composition of functions is not a commutative operation. fog is not the same as gof.

Often to get practice with the idea of composition of functions and its notation students are asked to find f°g and gof, sometimes called fog and gof. When you do that you should be suspicious if you get the same answer for both of them, because most of the time that won't be right. In the following examples the instruction is to find fog and gof.

Example 1:

f(x)=x3, g(x)=
   1 
x+2

Solution:

fog(x)=f(g(x))=
Writing the definition of f without the x's, we get

f(     )=(     )3.

Then fill in the holes.


gof(x)=g(f(x))=g(x3)

Writing the definition of g without the x's, we get

g(    )=
   1 
(     )+2
.

Then fill in the holes.

g(x3)=
   1 
(x3)+2
=
    1 
x3+2
.

Example 2:

Solution:

fog(x)=f(g(x))=f(x2+x+2)

Writing the definition of f without the x's we get

Then fill in the holes.

Writing the definition of g without the x's we get

g(    )=(    )2+(    )+2 .

Then fill in the holes and simplify.

Example 3:

Solution:

Writing the definition of f without the x's we get
Then fill in the holes and simplify.
Here in order to simplify the complex fraction I am multiplying top and bottom by the least common multiple of all of the denominators, which is x.

Writing the definition of g without the x's we get

Then fill in the holes and simplify.
Here I am inverting and multiplying, because that is how you divide fractions.

Example 4:

f(x)=4, g(x)=x2+3

Solution:

fog(x)=f(g(x))=f(x2+3)

This one can be a little confusing, so we have to be careful. Writing down the definition of f without the x's we get

f(     )=4.

Then filling in the holes, there is no hole on the right side, so

f(x2+3)=4,

Since there is nothing to fill in on the right side, that's all there is to do.

gof(x)=g(f(x))=g(4)=42+3=16+3=19

This time I am filling in the hole with a number, because no matter what you put into the g function you get 4 out of it.

g(   )=(    )2+3

Fill in the hole here with a 4.

Example 5:

f(x)=4, g(x)=3

Solution:

fog(x)=f(g(x))=f(3)=4

Basically the idea here is that f(x)=4 means that f(anything)=4, including 3, or if as before we write the definition of f without the x's we get

f(   )=4

If we fill in the hole with a 3 we get, just as above, f(3)=4, because there is no hole to fill in on the right side.

gof(x)=g(f(x))=g(4)=3

g(    )=3

Fill in the blank with a 4 to get it.

Make Home Page
©2005 HelpAlgebra.com - All rights reserved.