WRITING A FUNCTION AS A COMPOSITION

LESSON READ-THROUGH
by Dr. Carol JVF Burns (website creator)
Follow along with the highlighted text while you listen!
Thanks for your support!
 

When you're given a multi-step task to perform, you may want to break it into pieces,
and assign different pieces to different people.

When you're given a function that does several things,
you may want to break it into ‘smaller’ functions that accomplish the same job!

EXAMPLE (breaking a composite function into pieces)

Consider the function $\,h(x) = 5(x-4)^3 - 7\,$.
This function $\,h\,$ does the following:

  1. subtracts $\,4\,$
  2. cubes the result
  3. multiplies by $\,5\,$
  4. subtracts $\,7\,$
Break these four tasks into two pieces, as shown in the mapping diagram below:

With these assignments, the composite function $\,g\circ f\ $ (where $\,f\,$ acts first, followed by $\,g\,$) accomplishes the same thing as $\,h\,$: $$ \cssId{s24}{(g\circ f\,)(x)} \cssId{s25}{= g(f(x))} \cssId{s26}{= g\bigl((x-4)^3\bigr)} \cssId{s27}{= 5(x-4)^3 - 7} \cssId{s28}{= h(x)} $$

You can break a task into pieces in different ways!

Of course, you can delegate the responsibilities in different ways:

In both cases, be sure to check that $\,(g\circ f\,)(x) = h(x)\,$.

You can use more than two helpers!

Or, you can use more ‘helper’ functions.
For example:

Then,

$ \displaystyle \begin{align} \cssId{s47}{(c\circ b\circ a\,)(x)}\ &\cssId{s48}{= c(b(a(x)))}\cr &\cssId{s49}{= c(b(x-4))}\cr &\cssId{s50}{= c((x-4)^3)}\cr &\cssId{s51}{= 5(x-4)^3 - 7}\cr &\cssId{s52}{= h(x)} \end{align} $

The exercises in this lesson give you practice with this process of writing a function as a composition.

Master the ideas from this section
by practicing the exercise at the bottom of this page.


When you're done practicing, move on to:
using a function box ‘backwards’
On this exercise, you will not key in your answer.
However, you can check to see if your answer is correct.
PROBLEM TYPES:
1 2
AVAILABLE MASTERED IN PROGRESS