If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

## Algebra (all content)

### Course: Algebra (all content)>Unit 7

Lesson 15: Composing functions (Algebra 2 level)

# Intro to composing functions

Learn why we'd want to compose two functions together by looking at a farming example.
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, left parenthesis, a, right parenthesis, equals, 7500, a, minus, 1500
For example, if Cam plants two, he expects to produce C, left parenthesis, 2, right parenthesis, equals, 7500, left parenthesis, 2, right parenthesis, minus, 1500, equals, 13, comma, 500 start text, k, g, end text 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, left parenthesis, c, right parenthesis, equals, 0, point, 9, c, minus, 50
So if Cam produces 13, comma, 500, start text, space, k, g, end text of corn, he can expect to make M, left parenthesis, 13, comma, 500, right parenthesis, equals, 0, point, 9, left parenthesis, 13, comma, 500, right parenthesis, minus, 50, equals, dollar sign, 12, comma, 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, left parenthesis, a, right parenthesis kilograms of corn. And if he produces C, left parenthesis, a, right parenthesis kilograms of corn, he expects to make M, left parenthesis, C, left parenthesis, a, right parenthesis, right parenthesis dollars.
So, to find a general rule that converts a acres directly into expected earnings, we can find the expression M, left parenthesis, C, left parenthesis, a, right parenthesis, right parenthesis.
But just how do we do this? Well, notice that in the expression M, left parenthesis, start color #1fab54, C, left parenthesis, a, right parenthesis, end color #1fab54, right parenthesis, the input of function M is start color #1fab54, C, left parenthesis, a, right parenthesis, end color #1fab54. So, to find this expression, we can substitute start color #1fab54, C, left parenthesis, a, right parenthesis, end color #1fab54 in for start color #e07d10, c, end color #e07d10 in function M.
\begin{aligned} 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{aligned}
So the function M, left parenthesis, C, left parenthesis, a, right parenthesis, right parenthesis, equals, 6750, a, minus, 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, left parenthesis, C, left parenthesis, 2, right parenthesis, right parenthesis, equals, 6750, left parenthesis, 2, right parenthesis, minus, 1400, equals, dollar sign, 12, comma, 100
Cam can expect to make dollar sign, 12, comma, 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, left parenthesis, a, right parenthesis into function M, or by finding M, left parenthesis, C, left parenthesis, a, right parenthesis, right parenthesis. Let's call this new function M, circle, C, which is read as "M composed with C".
We now know that left parenthesis, M, circle, C, right parenthesis, left parenthesis, a, right parenthesis, equals, M, left parenthesis, C, left parenthesis, a, right parenthesis, right parenthesis. 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 dollar sign12,100.
Using the composite function, we see that function M, circle, C takes two directly to dollar sign12,100.
The two are equivalent!

# Now let's practice some problems.

### Problem 1

Using the functions presented in the example, how much can Cam expect to earn if he sells all the corn produced on 1.5 acres?
For reference: C, left parenthesis, a, right parenthesis, equals, 7500, a, minus, 1500, M, left parenthesis, c, right parenthesis, equals, 0, point, 9, c, minus, 50 and M, left parenthesis, C, left parenthesis, a, right parenthesis, right parenthesis, equals, 6750, a, minus, 1400
dollars

### Problem 2

Ben is a potato farmer. The function P, left parenthesis, a, right parenthesis, equals, 25, comma, 000, a, minus, 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, left parenthesis, p, right parenthesis, equals, 0, point, 2, p, minus, 200 gives the amount of money, M, in dollars, that Ben expects to make if he produces p kilograms of potatoes.
How much money can Ben expect to make if he sells all of the potatoes produced on the 3 acres?

### Problem 3

Which of the following expressions gives the amount of money that Ben expects to make if he plants potatoes on a acres of land?