By combining these 2 function into 1 function, we have performed function composition, which is the focus of this section.
Definition of Function Composition
Function composition is a method to combine existing functions. Another method is to carry out the usual algebraic operations on functions, including addition, subtraction, multiplication, & division.
We do this by performing the operations with the function outputs, defining the result as the output of our new function.
For Example, when we need to add 2 columns of numbers that represent a Father and mother’s separate annual Salaries over a period of years, with the result being their total household income.
We want to do this for every year, adding only that year’s salaries and then collecting all the data in a new column.
If F(x) is the father’s salary and M(x) is the mother’s salary in year x, and we want A to represent the total income, then we can define a new function.
If this holds true for every year, then we can focus on the relation between the functions without reference to a year and write
Just as for this sum of 2 functions, we can define product, difference, & ratio functions for any pair of functions that have the same kinds of inputs (not always numbers) and the same kinds of outputs. In this way, we can think of adding, subtracting, multiplying, & dividing functions.
“Function Composition” is applying one function to the results of another:
→ f (x) → g(x) →
The result of f () is sent through g ()
It is written: (g o f)(x), Which means: g(f(x))
The symbol for composition is a small circle:
(g o f)(x)
It is not a filled in dot: (g · f)(x), as that means multiply.
We can go the other way and break up a function into a composition of other functions.
This can be useful if the original function is too complicated to work on.