Composition of Functions
Tyler Murphy
March 12, 2014
As always, first let’s establish some notation.
g◦f means the function g composed of the function f. To keep the order straight, remember
that you apply the last function that appears in the composition, then apply the next
function to the leftuntil you get to the end. That is, g(f(x)). Composition works right to
left.
Simply put, you find the value in the range of f that corresponds to your x in the domain
of f and then use that value as your domain input into g.
Even more simply put, consider y = f(x).
g ◦ f is just g(y).
The trick with composition is making sure that you are staying in the domain of your
functions as you progress.
For example, consider f : N → N given by the rule f(x) = x + 10 and g : N → Z given by
the rule g(x) = −x.
Then g ◦ f goes from N to Z, but does not include All of the natural numbers.
Consider what I mean by that.
What does g ◦ f mean? It means g(f(x)). So what can f(x) be? It can be all natural
numbers greater than or equal to 11 or else it would be outside the range of f.
So those are the only numbers you can put into g for the composition. So (g ◦ f)(x) is
all integers x less than or equal to -11.
So g ◦ f = {(x, y) | x ∈ N and y = −(x + 10), y ∈ Z}.
example
Let’s consider now a simple example.
Let A = {1, 2, 3}, B = {4, 5}, C = {7, 8, 9}.
We define f : A → B by f = {(1, 4), (2, 5), (3, 5)}.
We define g : B → C by g = {(4, 8), (5, 9)}.
Note that we find what pairs up with each element by following it through each function.
1
f takes 1 to 4. g takes 4 to 8. So (g ◦ f)(1) = 8, which gives us (1,8).
f takes 2 to 5. g takes 5 to 9. So (g ◦ f)(2) = 9, which gives us (2,9).
f takes 3 to 5. g takes 4 to 8. So (g ◦ f)(3) = 9, which gives us (3,9).
So g ◦ f = {(1, 8), (2, 9), (3, 9)}
This is how composition works. Don’t just skip the set B because the composition goes
from A → C.
Always remember that a composition of functions goes from the domain of the first
function to the range of the second function THROUGH the range of the first function.
Organized in a simple fashion, let us consider the sets A, B, C and fiunctions f, g de-
scribed a moment ago.
1 2 3 (x ∈ A)
↓ ↓ f(x)
4 5 (y ∈ B)
g(y)
7 8 9 (z ∈ C).
A table like this can really help us track where things go in compositions of functions
and how the composition really works.
2

Functions 2

  • 1.
    Composition of Functions TylerMurphy March 12, 2014 As always, first let’s establish some notation. g◦f means the function g composed of the function f. To keep the order straight, remember that you apply the last function that appears in the composition, then apply the next function to the leftuntil you get to the end. That is, g(f(x)). Composition works right to left. Simply put, you find the value in the range of f that corresponds to your x in the domain of f and then use that value as your domain input into g. Even more simply put, consider y = f(x). g ◦ f is just g(y). The trick with composition is making sure that you are staying in the domain of your functions as you progress. For example, consider f : N → N given by the rule f(x) = x + 10 and g : N → Z given by the rule g(x) = −x. Then g ◦ f goes from N to Z, but does not include All of the natural numbers. Consider what I mean by that. What does g ◦ f mean? It means g(f(x)). So what can f(x) be? It can be all natural numbers greater than or equal to 11 or else it would be outside the range of f. So those are the only numbers you can put into g for the composition. So (g ◦ f)(x) is all integers x less than or equal to -11. So g ◦ f = {(x, y) | x ∈ N and y = −(x + 10), y ∈ Z}. example Let’s consider now a simple example. Let A = {1, 2, 3}, B = {4, 5}, C = {7, 8, 9}. We define f : A → B by f = {(1, 4), (2, 5), (3, 5)}. We define g : B → C by g = {(4, 8), (5, 9)}. Note that we find what pairs up with each element by following it through each function. 1
  • 2.
    f takes 1to 4. g takes 4 to 8. So (g ◦ f)(1) = 8, which gives us (1,8). f takes 2 to 5. g takes 5 to 9. So (g ◦ f)(2) = 9, which gives us (2,9). f takes 3 to 5. g takes 4 to 8. So (g ◦ f)(3) = 9, which gives us (3,9). So g ◦ f = {(1, 8), (2, 9), (3, 9)} This is how composition works. Don’t just skip the set B because the composition goes from A → C. Always remember that a composition of functions goes from the domain of the first function to the range of the second function THROUGH the range of the first function. Organized in a simple fashion, let us consider the sets A, B, C and fiunctions f, g de- scribed a moment ago. 1 2 3 (x ∈ A) ↓ ↓ f(x) 4 5 (y ∈ B) g(y) 7 8 9 (z ∈ C). A table like this can really help us track where things go in compositions of functions and how the composition really works. 2