Free preview Composite and inverse functions

Composing functions

📄 Intro to composing functions

#

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]]

📄 Composing functions

Given two functions, we can combine them in such a way so that the outputs of one function become the inputs of the other. This action defines a composite function. Let's take a look at what this means!

#Evaluating composite functions

###Example

If $f(x)=3x-1$ and $g(x)=x^3+2$, then what is $f(g(3))$?

###Solution

One way to evaluate $f(g(3))$ is to work from the "inside out". In other words, let's evaluate $g(3)$ first and then substitute that result into $f$ to find our answer.

Let's evaluate $g({3})$.

$\begin{align}g(x)&=x^3+2\\
g(3)&=({3})^3 +2~~~~~~~~~~~~~~~~~~~\small{\gray{\text{Plug in }x={3.}}}\\
&={29}\end{align}$

Since $g(3)=29$, then $f(g(3))=f(29)$.

Now let's evaluate $f({29})$.

$\begin{align}f(x)&=3x-1\\
f( {{29}})&=3({29}) - 1~~~~~~~~~~~~~~~\small{\gray{\text{Plug in }x= {29.}}}\\
&={86}\\
\end{align}$

It follows that $f(g({3}))=f( {29})={86}$.

#Finding the composite function

In the above example, function $g$ took $3$ to $29$, and then function $f$ took $29$ to $86$. Let's find the function that takes $3$ directly to $86$.

To do this, we must compose the two functions and find $f(g(x))$.

###Example

What is $f(g(x))$?
For reference, remember that $f(x)=3x-1$
and $g(x)=x^3+2$.

###Solution

If we look at the expression$f(\maroonD{g(x)})$, we can see that $\maroonD{g(x)}$ is the input of function $f$. So, let's substitute $\maroonD {g(x)}$ everywhere we see $\blueE x$ in function $f$.

$\begin{align}f(\blueE x)&=3\blueE x-1\\
f(\maroonD{g(x)}) &= 3(\maroonD{g(x)})-1 \
\end{align}$

Since ${{g(x)}={x^3+2}}$, we can substitute ${x^3+2}$ in for ${g(x)}$.

$\begin{align}{f(g(x))}&=3(g(x))-1 \\
&=3({x^3+2})-1 \\
&=3x^3+6-1\\
&=3x^3+5
\end{align}$

This new function should take $3$ directly to ${86}$. Let's verify this.

$\begin{align} f( g(x))&= 3x^3+5\ \
f( g( 3))&= 3( 3)^3+5 \\
&= {86} \end{align}$

Excellent!

##Let's practice

###Problem 1

$f(x)=3x-1$

$g(x)=x^3+2$

[[☃ graded-group 1]]

[[☃ explanation 1]]

###Problem 2

$m(x)=3x-2$

$n(x)=x+4$

[[☃ graded-group 2]]

[[☃ explanation 2]]

#Composite functions: a formal definition

In the above example, we found and evaluated a composite function.

In general, to indicate function $f$ composed with function $g$, we can write $f \circ g$, read as "$f$ composed with $g$". This composition is defined by the following rule:

$(f\circ g)(x)=f(g(x))$

The diagram below shows the relationship between $(f\circ g)(x)$ and $f(g(x))$.

Now let's look at another example with this new definition in mind.

###Example

$g(x)=x+4$

$h(x)=x^2-2x$

Find $(h\circ g)(x)$ and $(h\circ g)(-2)$.

###Solution

We can find $(h\circ g)(x)$ as follows:

$\begin{align}(h\circ g)(x)&=h(g(x))&\small{\gray{\text{Define.}}}\\
&=(g(x))^2-2(g(x))&\small{\gray{\text{Plug } g(x) \text{ in for } x\text{ in function }h.}}\\
&=({x+4})^2 -2({x+4})&\small{\gray{\text{Substitute } x+4 \text{ for } g(x).}}\\
&=x^2+8x+16-2x-8&\small{\gray{\text{Distribute.}}}\\
&=x^2+6x+8&\small{\gray{\text{Combine like terms.}}}\end{align}$

Since we now have function $h\circ g$, we can simply substitute $-2$ in for $x$ to find $(h\circ g)(-2)$.

$\begin{align}(h\circ g)(x)&=x^2+6x+8\\
(h\circ g)(-2)&=(-2)^2+6(-2)+8\\
&=4-12+8\\
&=0\\
\end{align}$

Of course, we could have also found $(h\circ g)(-2)$ by evaluating $h(g(-2))$. This is shown below:

$\begin{align}(h\circ g)(-2)&=h(g(-2))\\
&=h(2)~~~~~~~~\small{\gray{\text{Since }g(-2)=-2+4=2}}\\
&=0~~~~~~~~~~~~~\small{\gray{\text{Since }h(2)=2^2-2(2)=0}}\\
\end{align}$

The diagram below shows how $(h\circ g)(-2)$ is related to $h(g(-2))$.

Here we can see that function $g$ takes $-2$ to $2$ and then function $h$ takes $2$ to $0$, while function $h\circ g$ takes $-2$ directly to $0$.

#Now let's practice some problems

###Problem 3

$f(x)=3x-5$

$g(x)=3-2x$

[[☃ graded-group 1]]

[[☃ explanation 1]]

In problems 4 and 5, let $f(t)=t-2$ and $g(t)=t^2+5$.

Problem 4

[[☃ graded-group 2]]

[[☃ explanation 2]]

###Problem 5

[[☃ graded-group 3]]

[[☃ explanation 3]]

#Challenge Problem

[[☃ graded-group 4]]

[[☃ explanation 4]]

Enjoying the free preview?

Lessons after number 3 are reserved for Pro members — unlock the full course and every other one.

Sign up free Go Pro