Composition of Functions
Composition of Functions
It is written: (g º f)(x)
Which means: g(f(x))
Example: f(x) = 2x+3 and g(x) = x2
f(input) = 2(input)+3
g(input) = (input)2
Let's start:
(g º f)(x) = g(f(x))
(g º f)(x) = (2x+3)2
(f º g)(x) = f(g(x))
Symbol
The symbol for composition is a small circle:
(g º f)(x)
It is not a filled in dot: (g · f)(x), as that means multiply.
Example: f(x) = 2x+3
(f º f)(x) = f(f(x))
(f º f)(x) = 2(2x+3)+3 = 4x + 9
We should be able to do it without the pretty diagram:
(f º f)(x)= f(f(x))
= f(2x+3)
= 2(2x+3)+3
= 4x + 9
Domains
It has been easy so far, but now we must consider the Domains of the
functions.
The function must work for all values we give it, so it is up to us to make sure
we get the domain correct!
We can't have the square root of a negative number (unless we use imaginary
numbers, but we aren't), so we must exclude negative numbers:
{x | x ≥ 0}
[0,+∞)
Example: f(x) = √x and g(x) = x2
(g º f)(x)= g(f(x))
2
= (√x)
= x
Now, "x" normally has the Domain of all Real Numbers ...
De-Composing Function
We can go the other way and break up a function into a composition of other
functions.
Example: (x+1/x)2
f(x) = x + 1/x
g(x) = x2
And we get:
(g º f)(x)= g(f(x))
= g(x + 1/x)
2
= (x + 1/x)
This can be useful if the original function is too complicated to work on.
Summary
"Function Composition" is applying one function to the results of another.
(g º f)(x) = g(f(x)), first apply f(), then apply g()
We must also respect the domain of the first function
Some functions can be de-composed into two (or more) simpler functions.