Cam is a farmer. Each year he plants seeds that turn into corn. The function below gives the amount of corn, $C$, in kilograms (kg), that he expects to produce if he plants corn on $a$ acres of land.
$C(a) = 7500a - 1500$
For example, if Cam plants two acres, he expects to produce $C( 2) = 7500( 2)-1500= {13{,}{500}}$ $\text{kg}$ of corn.
What Cam really wants to know is how much money he will make from selling this corn. So he uses the following function to predict the amount of money, $M$, in dollars, that he will earn from selling $c$ kilograms of corn.
$M(c) = 0.9c - 50$
So if Cam produces $13{,}500\text{ kg}$ of corn, he can expect to make $M({13{,}500})=0.9({13{,}500})-50=${12{,}100}$.
Notice that Cam has to use two separate functions to get from acres planted to expected earnings. The first function, $C$, takes acres to corn, while the second function, $M$, takes corn to money.
Wouldn't it be great if Cam could write a function that turned planted acres directly into expected earnings?
#Creating a new function
We can indeed find the function that takes acres planted directly to expected earnings! To find this new function, let's think about the most general question: how much money does Cam expect to make if he plants corn seed on $a$ acres of land?
Well, if Cam plants corn on $a$ acres, he expects to produce $C(a)$ kilograms of corn. And if he produces $C(a)$ kilograms of corn, he expects to make $M(C(a))$ dollars.
So, to find a general rule that converts $a$ acres directly into expected earnings, we can find the expression $M(C(a))$.
But just how do we do this? Well, notice that in the expression $M(\greenD{C(a)})$, the input of function $M$ is $\greenD{C(a)}$. So, to find this expression, we can substitute $\greenD{C(a)}$ in for $\goldD{c}$ in function $M$.
$\begin{align} M(\goldD c)&=0.9\goldD c-50\\
M({\greenD{C(a)}})&=0.9(\greenD{C(a)})-50\ \
&= 0.9(\greenD{7500a-1500})-50~~~~~~~~~~\small{\gray{\text{Since }}}\small{\gray{C(a)=7500a-1500} }\\
&= 6750a-1350-50\\
&=6750a-1400 \end{align}$
So the function $M(C(a))=6750a-1400$ converts acres planted directly into expected earnings. Let's use this new function to predict the amount of money that Cam would make from planting corn on two acres.
$M(C(2))=6750(2)-1400=$12{,}100$
Cam can expect to make $$12{,}100$ from planting corn on two acres of land, which is consistent with our previous work!
#Defining composite functions
We just found what is called a composite function. Instead of substituting acres planted into the corn function, and then substituting the amount of corn produced into the money function, we found a function that takes the acres planted directly to the expected earnings.
We did this by substituting $C(a)$ into function $M$, or by finding $M(C(a))$. Let's call this new function $M\circ C$, which is read as "$M$ composed with $C$".
We now know that $(M\circ C)(a)=M(C(a))$. This, in fact, is the formal definition of function composition!
#Visualizing the two methods
Here's a visual to help interpret the above definition.
Using both functions $C$ and $M$, function $C$—the corn function—takes two to 13,500. Then, function $M$—the money function—takes 13,500 to $$$12,100.
Using the composite function, we see that function $M\circ C$ takes two directly to $$$12,100.
The two are equivalent!
#Now let's practice some problems.
[[☃ graded-group 1]]
[[☃ explanation 1]]
###Problem 2
Ben is a potato farmer. The function $P(a) = 25{,}000a - 1000$ gives the amount of potatoes, $P$, in kilograms, that he expects to produce from planting potatoes on $a$ acres of land. The function $M(p) = 0.2p - 200$ gives the amount of money, $M$, in dollars, that Ben expects to make if he produces $p$ kilograms of potatoes.
[[☃ graded-group 2]]
[[☃ explanation 2]]
###Problem 3
[[☃ graded-group 3]]
[[☃ explanation 3]]