We Are All Disciples Of Mathematics.




.

Dedication



To my mother, Julia. The only person who really understood me. I miss you Mom!



To Amy and Megan. The true loves of my life!



All Glory and Honor to God




.

Table Of Contents

Draft Table of Contents. Only enabled links have been completed.

A completed chapter has the sections included in the chapter. An uncompleted chapter shows the potential topics to be included in the chapter.

Each chapter has an associated Appendix.

SPECIFIC TOPICS AND CHAPTER ORDER ARE SUBJECT TO CHANGE!

Preface

Acknowledgements

Chapter 1: Fundamentals

Potential Topics

Chapter 2: Complex Numbers

Potential Topics

Chapter 3: Functions

Potential Topics Of A Key Chapter

Chapter 4: Quadratic Functions

Potential Topics

Chapter 5: Polynomial Division

Potential Topics

Chapter 6: Root Finding

Potential Topics

Chapter 7: Function Translation

Potential Topics

Chapter 8: Arithmetic Combination Of Functions

Chapter 9: Composite Functions

Chapter 10: Inverse Functions

Chapter 11: Rational Functions

Potential Topics

Chapter 12: Transcendental Functions

Chapter 13: Matrices and Matrix Algebra

Chapter 14: Solving Systems of Linear Equations

Potential Topics

Chapter 15: Trigonometric Functions

Appendix: Fundamentals

Appendix: Complex Numbers

Appendix: Functions

Appendix: Quadratic Functions

Appendix: Polynomial Division

Appendix: Root Finding

Appendix: Function Translation

Appendix: Arithmetic Combination Of Functions

Appendix: Composite Functions

Appendix: Inverse Functions

Appendix: Rational Functions

Appendix: Transcendental Functions

Appendix: Matrices and Matrix Algebra

Appendix: Solving Systems of Linear Equations

Appendix: Trigonometric Functions

About The Author


.

Preface

This book did not come about easily. In fact, I was quite hesitant to even entertain the idea. Yet, after much reflection and prayer, not to mention students repeatedly telling me “You should write a book”, I finally put pencil to paper, so to speak. Once I did, what I knew would happen came true; it would consume me and turn into a labor of love. Hopefully, regardless of anything else, that labor of love be evident.

The reasons for writing this book are several. Note to self: Give the reasons not forgetting to say that I wanted to tell a story. Also explain the title of the book, that’s important. How this book differs from other books. Etc.

Book Organization

Describe the organization and what each chapter is about.

Also describe how each chapter has an associated appendix - there is a 1-to-1 relationship. The appendices are meant to have what was presented in each chapter come “to life”, so to speak, through software and other mechanisms. Note also that the appendices can be considered optional to any use of the book for instruction either entirely or selectively. In other words, the book itself is not dependent on the use of the appendices (though highly recommended!).

For The Student / Reader

Give some tried and true words of wisdom to the students / readers of the book.

For A Teacher

Give some tried and true words of wisdom and/or suggestions to anyone who might want to use this book in their class.

R

Discuss the use of R.

Return To Table Of Contents


.

Acknowledgements

Any work of this magnitude is never done alone. I am grateful to my past, current, and (hopefully) future students for not only putting up with me, but for their many inputs thus making me a better teacher of mathematics. I am also deeply grateful to those who repeatedly suggested that I should write a book, something I never thought I would. In particular, I would like to thank Madelyn Baird and Addison Crotta for their review of this book and for providing insightful comments and suggestions; without their encouragement this book may never have happened.

These acknowledgements will undoubtedly grow over time.

Return To Table Of Contents


.

Chapter ??

Arithmetic Combination of Functions

In this chapter we will look at the first of two ways to combine two or more functions to create a new one. The first way is the taking two or more functions and combine them together via the arithmetic operations of addition, subtraction, multiplication, and division to create a new function. The second way is the composition of two or more functions, which will be explored in the next chapter.

To begin, let’s first consider having two functions, \(f(x)\) and \(g(x)\). These two functions can be combined via the arithmetic operations of addition, subtraction, multiplication, and division thus forming a new function via:

\[ \begin{align} (f + g)(x) &= f(x) + g(x) &\text{Addition} \\ (f - g)(x) &= f(x) - g(x) &\text{Subtraction}\\ (fg)(x) &= f(x)g(x) &\text{Multiplication} \\ \left(\frac{f}{g}\right)(x) &= \frac{f(x)}{g(x)},\text{ }g(x)\ne0 &\text{Division}\\ \end{align} \]

The left hand side is the notation used to represent the combination. \((f + g)(x)\) is the notation for the adding together of the two functions. \((fg)(x)\) is the notation for the multiplication of the two functions. And so on. The right hand side shows how this is accomplished; that is, how to actually create the new function. Thus the combination of these functions involves the algebraic combining the two functions under the given arithmetic operation. This is an algebraic exercise. What is actually very important to understand is what the new function created represents.


CONCEPT: The new function generated by the arithmetic combination of two functions represents the arithmetic combination of the outputs of the individual two functions for all \(x\) (cognizant of domains, of course as will be discussed below).


Using the function \((f + g)(x)\) as an example, this function represents the sum of the outputs of \(f(x)\) and \(g(x)\) for all \(x\). So, for any given \(x\) then \((f + g)(x)\) is the sum of the outputs \(f(x)\) and \(g(x)\). The implication, therefore, is that should one want to know what the output of \((f+g)(x)\) would be for a given value of \(x\), say \(x_{1}\), that is \((f+g)(x_{1})\), there are two ways of approaching this. One way would be to first find the function \((f + g)(x)\) by algebraically adding the two functions, \(f(x)\) and \(g(x)\), and then evaluating that newly formed function at \(x_{1}\). Or, one can evaluate the two functions individually at \(x_{1}\), \(f(x_{1})\) and \(g(x_{1})\), and then sum those two outputs. If the goal is to just find what the sum of two functions is at a given input, often the second approach is much easier for it does not require first finding the new function \((f + g)(x)\). If, however, the need is to have a way to find what the sum of two functions is for a variety of inputs or in a repeated loop, it would perhaps be more efficient to first find what the function \((f + g)(x)\) actually is and use it. Regardless, it is the understanding of what this new function actually represents which is key. This conceptual idea of what the function \((f + g)(x)\) represent extends to the other functions produced under the arithmetic operations of subtraction, multiplication, and division and will be explored more in-depth below.

To help understand and illustrate this idea of combining two functions together using arithmetic operations, the following schematic was developed. An input, \(x\), gets split and goes into the function \(f\) and the function \(g\) simultaneously. Each function produces its respective output for that given input. These outputs exist independently and could be used for whatever purpose they may serve. But by tapping into these function outputs, each output enters into what I call the Arithmetic Operation Unit (AOU). The AOU combines these two output using the desired arithmetic operation (addition, subtraction, multiplication or division) and the desired output is produced.

This schematic also shows two additional things which are interesting and important. First, as mentioned the input, \(x\), goes into both functions \(f(x)\) and \(g(x)\). What this means is that the input must be valid for both of these functions. That is, the input must be in the domain of both \(f(x)\) and \(g(x)\). The implication, therefore, is that the domain of the newly created arithmetic combination of the two functions has a domain which is the intersection of the domains of \(f(x)\) and \(g(x)\).


CONCEPT: The new function generated by the arithmetic combination of two functions has a domain which is the intersection of the domains of the two individual functions.


Second, since the input, \(x\), goes into each function, \(f(x)\) and \(g(x)\), two unique mappings are produced: \((x,f(x))\) and \((x,g(x))\), which are the outputs of each. It is these outputs which are then combined arithmetically. The mapping, therefore, of the newly formed arithmetically combined function is \((x,(f+g)(x))\), or \((x,(f-g)(x))\), or \((x,(fg)(x))\), or \((x,(f/g)(x))\) for addition, subtraction, multiplication, and division, respectively.


CONCEPT: The new function generated by the arithmetic combination of two functions maps the given input, \(x\), to \((x,(f+g)(x))\), or \((x,(f-g)(x))\), or \((x,(fg)(x))\), or \((x,(f/g)(x))\) for addition, subtraction, multiplication, and division, respectively.


This same process can be easily extended to two or more functions. The combining two functions together arithmetically extends beyond two functions. The function created via the summing or multiplying of \(n\) functions, \(f_{1}(x)\), \(f_{2}(x)\)\(f_{n}(x)\) is

\[ \begin{align} (f_{1} + f_{2} + \cdots + f_{n})(x) &= f_{1}(x) + f_{2}(x) + \cdots + f_{n}(x) \\ (f_{1} \cdot f_{2} \cdot f_{3} \cdots f_{n})(x) &= f_{1}(x)f_{2}(x)f_{3}(x) \cdots f_{n}(x) \end{align} \]

Subtraction and division of more than two functions is usually within the context of the combination of multiple arithmetic operations. This idea is further explored in the sections below.

The conceptual understanding of what this newly created function represents remains the same as with two functions: It represents the arithmetic combination of the outputs of the \(n\) individual functions for all \(x\). However, as eluded to above, to be complete, we must consider domains. This new function created via the arithmetic combination of two or more functions has domain constraints relative to the functions being combined. That is, the domain of the newly formed function is the intersection of the domains of the individual functions. It is only valid for those inputs which are valid for all the individual functions. The conceptual understanding of what this new function represents has been extended.


CONCEPT: The new function generated by the arithmetic combination (sum or difference or product or quotient) of two or more functions represents the outputs of the individual functions for all \(x\) within the domain of the intersection of the domains of each of the individual functions.


Each arithmetic combination of two or more functions will be considered individually in the following sections.

??.1 The Arithmetic Operation of the Addition of Two or More Functions

The function created via the summing of two functions, \(f(x)\) and \(g(x)\), is the function \((f + g)(x)\). The function created via the summing of \(n\) functions is

\[ (f_{1} + f_{2} + \cdots + f_{n})(x) = f_{1}(x) + f_{2}(x) + \cdots + f_{n}(x) \]

As was the case with just two functions, the evaluation of this new function, \((f_{1} + f_{2} + \cdots + f_{n})(x)\), at a particular input, say \(x_{1}\), can be found by either first finding what this new function is and then evaluating it at \(x_{1}\) or by evaluating each function individually at \(x_{1}\) and then summing the individual outputs.


CONCEPT: The new function generated by the arithmetic combination of addition of two or more functions represents the sum the outputs of each individual function for all \(x\) within the domain of the intersection of the domains of each of the individual functions.


Let’s look at some examples. starting with two simple functions.

Example ??.1

Consider the two functions, \(f(x) = x - 1\) and \(g(x) = 2x + 4\), find the new function created by the arithmetic operation of addition, \((f + g)(x)\) and what its output would be for \(x = -3\). (Note, these are two simple functions that will be used throughout this chapter as we explore each arithmetic operation.)

Solution

Before beginning to answer this type of question, it is always recommended, even if it is not explicitly asked, to verify that the number at which to evaluate the function is in the function’s domain. Since \(f(x)\) and \(g(x)\) are both polynomials (which have a domain of all real numbers), the new function created represents the sum of the outputs of each function for all \(x\) and has a domain of all real numbers. Hence, the value \(x = -3\) is in the domain.

Let’s first find the new function created by the arithmetic combination of addition, \((f + g)(x)\):

\[ \begin{align} (f + g)(x) &= f(x) + g(x) \\ &= (x - 1) + (2x + 4) \\ &= 3x + 3 \end{align} \]

Thus \((f + g)(x) = 3x + 3\). Evaluating this newly created function at \(x = -3\):

\[ \begin{align} (f + g)(-3) &= 3(-3) + 3 \\ &= -9 + 3 \\ &= -6 \end{align} \]

Thus \((f + g)(-3) = -6\). Now, let’s evaluate the two individual functions at \(x = -3\) and then add their respective outputs:

\[ \begin{align} f(-3) &= (-3) - 1 = -4 \\ g(-3) &= 2(-3) + 4 = -2 \\ (f + g)(-3) &= f(-3) + g(-3) \\ &= -4 + -2 = -6 \end{align} \]

The mapping, therefore, that occurs when \(x = -3\) is the input to \((f + g)(x)\) is \((-3,(f + g)(-3))\), or \((-3,-6)\).

\(\textbf{Note: This example is explored further in Appendix ??, Arithmetic Combination of Functions.}\)


As this example showed, the two approaches, finding the new function first then evaluating it at \(x = -3\) or evaluating the two individual functions at \(x = -3\) produced the same result: \((f + g)(-3) = -6\). This agrees with the idea that the new function, \((f + g)(x) = 3x + 3\), represents the sum of the outputs of each function for all \(x\) within its domain which is all real numbers.

Now, let’s look at an example with three functions.


Example ??.2

Given the three functions, \(f(x) = x^{2}\), \(g(x)= x+1\), and \(h(x)=-x+4\), find the new function can be created by the algebraic combination of addition.

Solution

Before beginning to answer this type of question, it is always recommended, if it is not explicitly asked, to verify that the number at which to evaluate the function is in the function’s domain. Since \(f(x)\), \(g(x)\), and \(h(x)\) are all polynomials (which have a domain of all real numbers), the new function created represents the sum of the outputs of each function for all \(x\) and has a domain of all real numbers.

Since there are three functions given, \(f(x)\), \(g(x)\), and \(h(x)\), the new function created by the arithmetic combination of addition would be \((f + g + h)(x)\):

\[ \begin{align} (f + g + h)(x) &= f(x) + g(x) + h(x) \\ &= (x^{2}) + (x+1) + (-x + 4) \\ &= x^{2} + 5 \end{align} \]

Again, this new function, \((f + g + h)(x) = x^{2} + 5\), represents the sum of the outputs of each function for all \(x\) and has a domain of all real numbers.


Example ??.3

For the same three functions given in Example ??.2, what would be the output of the function created by the arithmetic combination of addition when \(x = 1\)?

Solution

This question is asking what is \((f + g + h)(1)\). Since we already know that \((f + g + h)(x) = x^{2} + 5\), we can evaluate it at \(x = 1\):

\[ \begin{align} (f + g + h)(1) &= (1)^{2} + 5 \\ &= 6 \end{align} \]

The mapping, therefore, is:

\[ \begin{align} (1,(f+g+h)(1)) \text{ or } (1,6) \end{align} \]

However, another approach would be to evaluate each function at \(x = 1\) and then sum their respective outputs:

\[ \begin{align} f(1) &= (1)^{2} \\ &= 1 \\ g(1) &= (1) + 1 \\ &= 2 \\ h(1) &= -(1) + 4 \\ &= 3 \end{align} \]

Thus \((f + g + h)(1) = f(1) + g(1) + h(1) = 1+2+3 = 6\), which matches, as it should, the answer found via the evaluation of the actual combined function, \((f + g + h)(x) = x^{2}+5\) at \(x= 1\).


As examples ??.1, ??.2, and ??.3 show, the means of evaluating the new function created by the adding two or more functions together can be done either by finding the new function first and then evaluating it at the value of \(x\) of interest, or the individual functions can be evaluated individually at the value of \(x\) of interest and then their outputs added together. Thus, the new function created by the adding two or more functions together represents the sum of the individual function outputs for all \(x\). The following figure (GIVE NUMBER) reflects this idea for the functions used in the above two examples.

Each of the three individual functions are plotted: \(f(x)\) in red, \(g(x)\) in blue, and \(h(x)\) in green. The output of each function evaluated at \(x = 1\) is highlighted on the graph: \(f(1) = 1\), \(g(1) = 2\), and \(h(1) = 3\). The graph of the newly found function, \((f + g + h)(x) = x^{2} + 5\) is also plotted (in purple). The output of \((f + g + h)(1) = 6\) is plotted on the curve. It is clear, then, that this output value, 6, is the sum of the outputs of the three individual functions evaluated at \(x = 1\).

Example ??.3

Find \((f + g)(-1)\) where

\[ \begin{align} f(x) &= \frac{2x-1}{x-2} \\\\ g(x) &= \frac{x+3}{x+4} \end{align} \]

Solution

Before beginning to answer this type of question, it is always recommended, if it is not explicitly asked, to verify that the number at which to evaluate the function is in the function’s domain.

The domain of \(f(x)\) is all real numbers except \(x = 2\). The domain of \(g(x)\) is all real numbers except \(x = -4\). Therefore, the function that adds the output of the two individual functions is the intersection of these two domains which is all real numbers except \(x = 2\) and \(x = -4\), which in interval notation is \((-\infty,-4) \cup (-4,2) \cup (2,\infty)\). Since the value asked (\(x = -1\)) is in the domain of \((f + g)(x)\), we can proceed.

Since the question did explicitly state that the finding of the new function created by the adding of \(f(x)\) and \(g(x)\), we are free to choose either of the two approaches. Let’s first find the solution via the evaluation of the two individual functions at \(x = -1\) and then summing their outputs.

\[ \begin{align} f(-1) &= \frac{2(-1) - 1}{(-1) -2} \\ &= \frac{-3}{-3} = 1 \\ g(-1) &= \frac{(-1) + 3}{(-1) + 4} \\ &= \frac{2}{3} \end{align} \]

Thus \((f + g)(-1) = f(-1) + g(-1) = 1 + \frac{2}{3} = \frac{5}{3}\). One can always verify his/her answer by actually taking both approaches. Let’s then find the actual function, \((f + g)(x)\), and then evaluate it at \(x = -1\):

\[ \begin{align} (f + g)(x) &= f(x) + g(x)\\ &= \frac{2x-1}{x-2} + \frac{x+3}{x+4} \\ &= \frac{(x+4)(2x-1) + (x-2)(x+3)}{(x-2)(x+4)} \\ &= \frac{2x^{2} + 7x -4 + x^{2} +x - 6}{x^{2} + 2x - 8} \\ &= \frac{3x^{2} + 8x - 10}{x^{2} + 2x - 8} \end{align} \]

Now that we found \((f + g)(x)\), let’s evaluate it at \(x = -1\):

\[ \begin{align} (f + g)(-1) &= \frac{3(-1)^{2} + 8(-1) - 10}{(-1)^{2} + 2(-1) - 8} \\ &= \frac{3 - 8 - 10}{1-2-8} \\ &= \frac{-15}{-9} = \frac{5}{3} \end{align} \]

The answers match, as they should. Thus, \((f + g)(-1) = \frac{5}{3}\), and the mapping, therefore, is:

\[ \begin{align} (-1,(f+g)(-1)) \text{ or } \left(-1,\frac{5}{3}\right) \end{align} \]

It would be interesting to verify that \(x = 2\) and \(x = -4\) are not in the domain of \((f + g)(x) = \frac{3x^{2} + 8x - 10}{x^{2} + 2x - 8}\):

\[ \begin{align} (f + g)(2) &= \frac{3(2)^{2} + 8(2) - 10}{(2)^{2} + 2(2) - 8} \\ &= \frac{12 + 16 - 10}{4 + 4 - 8}\\ &= \frac{18}{0} \text{ UND} \\ \\ (f + g)(-4) &= \frac{3(-4)^{2} + 8(-4) - 10}{(-4)^{2} + 2(-4) - 8} \\ &= \frac{48 - 32 - 10}{16 - 8 - 8}\\ &= \frac{-6}{0} \text{ UND} \end{align} \]

Clearly, \(x = 2\) and \(x = -4\) are not in the domain of \((f + g)(x) = \frac{3x^{2} + 8x - 10}{x^{2} + 2x - 8}\).

Figure ??.?? shows the graph of the newly created function, \((f + g)(x) = \frac{3x^{2} + 8x - 10}{x^{2} + 2x - 8}\), which represents the sum of the outputs of the two individual functions, \(f(x)\) and \(g(x)\), for all \(x\) in the domain \((-\infty,-4) \cup (-4,2) \cup (2,\infty)\). The dashed vertical lines clearly show the restrictions on the domain. The mapping \((-1,(f+g)(-1)) =\left(-1,\frac{5}{3}\right)\) is also shown on the graph.


Example ??.4

Given \(f(x) = \frac{x+1}{x-1}\) and \(g(x) = \sqrt{2x -3}\), find \((f + g)(-1)\) and \((f + g)(2)\)

Solution

Before beginning to answer this type of question, it is always recommended, if it is not explicitly asked, to verify that the number at which to evaluate the function is in the function’s domain.

The domain of \(f(x)\) is all real numbers except \(x = 1\). The domain of \(g(x)\) is all real numbers greater than or equal to \(\frac{3}{2}\). Therefore, the function that adds the output of the two individual functions is the intersection of these two domains which is all real numbers greater than or equal to \(\frac{3}{2}\), or in interval notation, \(\left[\frac{3}{2},\infty\right]\).

First find \((f + g)(-1)\): Since the asked for value, \(x = -1\), is not in the domain, \((f + g)(-1)\) is undefined.

Next, find \((f + g)(2)\): \(x = 2\) is in the domain, so a solution is possible. Evaluating the two functions individually at \(x = 2\):

\[ \begin{align} f(2) &= \frac{(2) + 1}{(2)-1} \\ &= 3 \\ g(2) = \sqrt{2(2) - 3} \\ &= \sqrt{4 - 3} = 1 \end{align} \]

Thus, \((f + g)(2) = f(2) + g(2) = 3 + 1 = 4\). One can always verify his/her answer by actually taking both approaches. Let’s then find the actual function, \((f + g)(x)\), and then evaluate it at \(x = 2\):

\[ \begin{align} (f + g)(x) &= f(x) + g(x)\\ &= \frac{x+1}{x-1} + \sqrt{2x -3} \end{align} \]

Now that we found \((f + g)(x)\), let’s evaluate it at \(x = 2\):

\[ \begin{align} (f + g)(2) &= \frac{(2) + 1}{(2)-1} + \sqrt{2(2) - 3} \\ &= \frac{3}{1} + \sqrt{4-3} \\ &= 3 + 1 = 4 \end{align} \]

The answers match, as they should. Thus, \((f + g)(2) = 4\) and the mapping, therefore, is:

\[ \begin{align} (2,(f+g)(2)) \text{ or } \left(2,4\right) \end{align} \] Return To Table Of Contents


??.2 The Arithmetic Operation of the Subtraction of Two or More Functions

The second arithmetic way to combine two or more functions is with the operation of subtraction. For two functions, \(f(x)\) and \(g(x)\), this would be \((f - g)(x) = f(x) - g(x)\). This newly created function is simply the function \(g(x)\) subtracted from \(f(x)\).

The same conceptual understanding for the addition of two function still applies here: this new function, \((f - g)(x) = f(x) - g(x)\), represents the difference between the output of \(f(x)\) and \(g(x)\) (i.e, the output of \(g(x)\) subtracted from the output of \(f(x)\)) for all \(x\) in the domain of \((f + g)(x)\) which would be the intersection of the domains of the two individual functions \(f(x)\) and \(g(x)\).


CONCEPT: The new function generated by the arithmetic combination of subtraction of the two functions, \(f(x)\) and \(g(x)\) represents the difference the outputs of each individual function for all \(x\) within the domain of the intersection of the domains of each of the individual functions.


Let’s look at some examples.


Example ??.x

Using the two simple functions presented in Example ??.1, \(f(x) = x - 1\) and \(g(x) = 2x + 4\), find the new function created by the arithmetic operation of subtraction, \((f - g)(x)\) and what its output would be for \(x = -3\).

Solution

Before beginning to answer this type of question, it is always recommended, even if it is not explicitly asked, to verify that the number at which to evaluate the function is in the function’s domain. Since \(f(x)\) and \(g(x)\) are both polynomials (which have a domain of all real numbers), the new function created represents the sum of the outputs of each function for all \(x\) and has a domain of all real numbers. Hence, the value \(x = -3\) is in the domain.

Let’s first find the new function created by the arithmetic combination of subtraction, \((f - g)(x)\):

\[ \begin{align} (f - g)(x) &= f(x) - g(x) \\ &= (x - 1) - (2x + 4) \\ &= -x - 5 \end{align} \]

Thus \((f - g)(x) = -x - 5\). Evaluating this newly created function at \(x = -3\):

\[ \begin{align} (f - g)(-3) &= -(-3) - 5 \\ &= 3 - 5 \\ &= -2 \end{align} \]

Thus \((f - g)(-3) = -2\). Now, let’s evaluate the two individual functions at \(x = -3\) and then subtract their respective outputs:

\[ \begin{align} f(-3) &= (-3) - 1 = -4 \\ g(-3) &= 2(-3) + 4 = -2 \\ (f - g)(-3) &= f(-3) - g(-3) \\ &= -4 - -2 = -2 \end{align} \]

The mapping, therefore, that occurs when \(x = -3\) is the input to \((f - g)(x)\) is \((-3,(f - g)(-3))\), or \((-3,-2)\).

\(\textbf{Note: This example is explored further in Appendix ??, Arithmetic Combination of Functions.}\)


As this example showed, the two approaches, finding the new function first then evaluating it at \(x = -3\) or evaluating the two individual functions at \(x = -3\) produced the same result: \((f - g)(-3) = -2\). This agrees with the idea that the new function, \((f - g)(x) = -x - 5\), represents the difference of the outputs of each function for all \(x\) within its domain which is all real numbers.


Example ??.4

Given \(f(x) = 2x^{2} - 3x + 7\) and \(g(x) = -x^{2} - x + 6\), then the function \((f - g)(x)\) is:

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

Thus the newly created function \((f - g)(x)\) is \(3x^{2} - 2x + 1\). Now, let’s evaluate this function at \(x = -1\) (since the two functions are both polynomials, the domain of \((f - g)(x)\) would be all real numbers, thus \(x = -1\) is in the domain):

\[ \begin{align} (f - g)(-1) &= 3(-1)^{2} - 2(-1) + 1 \\ &= 3 + 2 + 1 \\ &= 6 \end{align} \]

To see that this is the same as first evaluating the two individual functions at \(x = -1\) then taking their difference:

\[ \begin{align} f(-1) &= 2(-1)^{2} - 3(-1) + 7 \\ &= 2 + 3 + 7 \\ &= 12 \\ g(-1) &= -(-1)^{2} - (-1) + 6 \\ &= -1 + 1 + 6 \\ &= 6 \end{align} \]

thus

\[ \begin{align} (f - g)(-1) &= f(-1) - g(-1) \\ &= 12 - 6 \\ &= 6 \end{align} \]

The newly created function \((f - g)(x) = 3x^{2} - 2x + 1\) evaluated at \(x = -1\) was 6. The difference between the two functions evaluated at \(x = -1\) was \(f(-1) - g(-1) = 12 - 6 = 6\). The answers match, as they should and the mapping, therefore, is:

\[ \begin{align} (-1,(f-g)(-1)) \text{ or } \left(-1,6\right) \end{align} \]


When there are more than two functions, these functions can be combined using a combination of addition and subtraction. The same conceptual idea of adding or subtracting individual function outputs still holds but the way they are combined depends on whether they are being added or subtracted. It is also useful to note that should one prefer, the addition and subtraction of functions can always be turned into just the addition of these functions by recalling that any subtraction problem can be turned into an addition problem such as \((10 - 3 = 10 + -3 = 7)\).


Example ??.5

Given the same three functions from Example ??.1, \(f(x) = x^{2}\), \(g(x)= x+1\), and \(h(x)=-x+4\), find \((f - g + h)(x)\), then evaluate it at \(x = -1\):

\[ \begin{align} (f - g + h)(x) &= f(x) - g(x) + h(x) \\ &= (x^{2}) - (x+1) + (-x+4) \\ &= x^{2} - x - 1 -x + 4 \\ &= x^{2} - 2x + 3 \end{align} \]

Thus the newly created function \((f - g + h)(x) = x^{2} - 2x + 3\). Now, let’s evaluate this function at \(x = -1\) (since the three functions are polynomials, the domain of \((f - g + h)(x)\) would be all real numbers, thus \(x = -1\) is in the domain):

\[ \begin{align} (f - g + h)(-1) &= (-1)^{2} - 2(-1) + 3 \\ &= 1 + 2 + 3 \\ &= 6 \end{align} \]

Thus, \((f - g + h)(-1) = 6\). Now, let’s find \((f - g + h)(-1)\) by first evaluating each individual function at \(x = -1\):

\[ \begin{align} f(-1) &= (-1)^{2} \\ &= 1 \\ \\ g(-1) &= (-1) + 1 \\ &= 0 \\ \\ h(-1) &= -(-1) + 4 \\ &= 1 + 4 \\ &= 5 \end{align} \]

Thus \((f - g + h)(-1) = f(-1) - g(-1) + h(-1) = 1 - 0 + 5 = 6\). The answers from the two approaches match, as they should, and the mapping, therefore, is:

\[ \begin{align} (-1,(f - g + h)(-1)) \text{ or } \left(-1,6\right) \end{align} \]


As this example shows, the means of evaluating the new function created by the adding and/or subtracting two or more functions together can be done either by finding the new function first and then evaluating it at the value of \(x\) of interest, or the individual functions can be evaluated individually at the value of \(x\) of interest and then their outputs arithmetically combined together. The following figure (GIVE NUMBER) reflects this idea for the functions used in the above example.

Each of the three individual functions are plotted: \(f(x)\) in red, \(g(x)\) in blue, and \(h(x)\) in green. The output of each function evaluated at \(x = -1\) is highlighted on the graph: \(f(-1) = 1\), \(g(-1) = 0\), and \(h(-1) = 5\). The graph of the newly found function, \((f - g + h)(x) = x^{2} - 2x + 3\) is also plotted (in purple). The output of \((f - g + h)(-1) = 6\) is plotted on the curve. It is clear, then, that this output value, 6, is the sum/difference of the outputs of the three individual functions evaluated at \(x = -1\).

Thus, the new function created by the adding and/or subtracting two or more functions together represents the sum and/or subtraction of the individual function outputs for all \(x\).


CONCEPT: The new function generated by the arithmetic combination of addition and subtraction of the two or more functions represents the sum/difference the outputs of each individual function for all \(x\) within the domain of the intersection of the domains of each of the individual functions.



Return To Table Of Contents

??.3 The Arithmetic Operation of the Multiplication of Two or More Functions

The third arithmetic way to combine two or more functions is with the operation of multiplication. For two functions, \(f(x)\) and \(g(x)\), this would be \((fg)(x) = f(x)g(x)\). This newly created function is simply the functions \(f(x)\) and \(g(x)\) multiplied together. The function created via the multiplication of \(n\) functions is

\[ (f_{1} \cdot f_{2} \cdot f_{3} \cdots f_{n})(x) = f_{1}(x)f_{2}(x)f_{3}(x) \cdots f_{n}(x) \]


CONCEPT: The new function generated by the arithmetic combination of multiplication of two or more functions represents the multiplication of the outputs of each individual function for all \(x\) within the domain of the intersection of the domains of each of the individual functions.


As was the case with just two functions, the evaluation of this new function, \((f_{1} \cdot f_{2} \cdot f_{3} \cdots f_{n})(x)\), at a particular input, say \(x_{1}\), can be found by either first finding what this new function is and then evaluating it at \(x_{1}\) or by evaluating each function individually at \(x_{1}\) and then multiplying the individual outputs.


Example ??.x

Using the two simple functions presented in Example ??.1, \(f(x) = x - 1\) and \(g(x) = 2x + 4\), find the new function created by the arithmetic operation of multiplication, \((fg)(x)\) and what its output would be for \(x = -3\).

Solution

Before beginning to answer this type of question, it is always recommended, even if it is not explicitly asked, to verify that the number at which to evaluate the function is in the function’s domain. Since \(f(x)\) and \(g(x)\) are both polynomials (which have a domain of all real numbers), the new function created represents the sum of the outputs of each function for all \(x\) and has a domain of all real numbers. Hence, the value \(x = -3\) is in the domain.

Let’s first find the new function created by the arithmetic combination of multiplication, \((fg)(x)\):

\[ \begin{align} (fg)(x) &= f(x)g(x) \\ &= (x - 1)(2x + 4) \\ &= 2x^{2} + 2x - 4 \end{align} \]

Thus \((fg)(x) = 2x^{2} + 2x - 4\). Evaluating this newly created function at \(x = -3\):

\[ \begin{align} (fg)(-3) &= 2(-3)^{2} + 2(-3) - 4 \\ &= 18 - 6 - 4 \\ &= 8 \end{align} \]

Thus \((fg)(-3) = 8\). Now, let’s evaluate the two individual functions at \(x = -3\) and then multiply their respective outputs:

\[ \begin{align} f(-3) &= (-3) - 1 = -4 \\ g(-3) &= 2(-3) + 4 = -2 \\ (fg)(-3) &= f(-3)g(-3) \\ &= -4(-2) = 8 \end{align} \]

The mapping, therefore, that occurs when \(x = -3\) is the input to \((fg)(x)\) is \((-3,(fg)(-3))\), or \((-3,8)\).

\(\textbf{Note: This example is explored further in Appendix ??, Arithmetic Combination of Functions.}\)


As this example showed, the two approaches, finding the new function first then evaluating it at \(x = -3\) or evaluating the two individual functions at \(x = -3\) produced the same result: \((fg)(-3) = 8\). This agrees with the idea that the new function, \((fg)(x) = 2x^{2} + 2x - 4\), represents the product of the outputs of each function for all \(x\) within its domain which is all real numbers.


Example ??.6

Given the same three functions from Example ??.1, \(f(x) = x^{2}\), \(g(x)= x+1\), and \(h(x)=-x+4\), find \((fgh)(x)\), then evaluate it at \(x = -2\):

\[ \begin{align} (fgh)(x) &= f(x)g(x) h(x) \\ &= (x^{2})(x+1)(-x+4) \\ &= (x^{3} + x^{2})(-x + 4) \\ &= -x^{4} + 4x^{3} - x^{3} + 4x^{2} \\ &= -x^{4} + 3x^{3} + 4x^{2} \end{align} \]

Thus the newly created function \((fgh)(x) = -x^{4} + 3x^{3} + 4x^{2}\). Now, let’s evaluate this function at \(x = -2\) (since the three functions are polynomials, the domain of \((fgh)(x)\) would be all real numbers, thus \(x = -2\) is in the domain):

\[ \begin{align} (fgh)(-2) &= -(-2)^{4} + 3(-2)^{3} + 4(-2)^{2} \\ &= -16 - 24 + 15 \\ &= -24 \end{align} \]

Thus, \((fgh)(-2) = -24\). Now, let’s find \((fgh)(-2)\) by first evaluating each individual function at \(x = -2\):

\[ \begin{align} f(-2) &= (-2)^{2} \\ &= 4\\ \\ g(-2) &= (-2) + 1 \\ &= -1 \\ \\ h(-2) &= -(-2) + 4 \\ &= 2 + 4 \\ &= 6 \end{align} \]

Thus \((fgh)(-2) = f(-2)g(-2)h(-2) = (4)(-1)(6) = -24\). The answers from the two approaches match, as they should, and the mapping, therefore, is:

\[ \begin{align} (-2,(fgh)(-2)) \text{ or } \left(-2,-24\right) \end{align} \]


As this example shows, the means of evaluating the new function created by the multiplication of two or more functions together can be done either by finding the new function first and then evaluating it at the value of \(x\) of interest, or the individual functions can be evaluated individually at the value of \(x\) of interest and then their outputs arithmetically combined together. The following figure (GIVE NUMBER) reflects this idea for the functions used in the above example.

Each of the three individual functions are plotted: \(f(x)\) in red, \(g(x)\) in blue, and \(h(x)\) in green. The output of each function evaluated at \(x = -2\) is highlighted on the graph: \(f(-2) = 4\), \(g(-2) = -1\), and \(h(-2) = 6\). The graph of the newly found function, \((fgh)(x) = -x^{4} + 3x^{3} + 4x^{2}\) is also plotted (in purple). The output of \((fgh)(-2) = -24\) is plotted on the curve. It is clear, then, that this output value, -24, is the product of the outputs of the three individual functions evaluated at \(x = -2\).

Thus, the new function created by the multiplication of two or more functions together represents the product of the individual function outputs for all \(x\).


Example ??.7

Given three functions: \(f(x) = \frac{x^{2} + x -2}{x+1}\), \(g(x) = \frac{x-3}{x+4}\), and \(h(x) = \frac{x^{2} - x - 12}{x^{2} - 2x}\), find \((fgh)(1)\).

Solution

Before beginning to answer this type of question, it is always recommended, if it is not explicitly asked, to verify that the number at which to evaluate the function is in the function’s domain. The domain of \(f(x)\) is all real numbers except \(x = -1\). The domain of \(g(x)\) is all real numbers except \(x = -4\). The domain of \(h(x)\) is all real numbers except \(x = 0\) and \(x = 2\). The intersection of these three domains is, in interval notation: \((-\infty,-4) \cup (-4,-1) \cup (-1,0) \cup (0,2) \cup (2,\infty)\). Thus the given value of \(x = 1\) is in the domain of \((fgh)(x)\)

The question just asked what is the newly created function evaluated at \(x = 1\). Since no specific approach was required, let’s find the solution by evaluating each of the three individual functions at \(x = 1\) and then take their product.

\[ \begin{align} f(1) &= \frac{(1)^{2} + (1) - 2}{(1)+1} \\ &= \frac{2 - 2}{2} \\ &= \frac{0}{1} = 0 \\ \\ g(1) &= \frac{(1) - 3}{(1) + 4} \\ &= \frac{-2}{5} \\ h(1) &= \frac{(1) - (1) - 12}{(1)^{2} - 2(1)} \\ &= \frac{-12}{-1} \\ &= 12 \end{align} \]

Thus, \((fgh)(1) = f(1)(g(1))(h(1)) = 0\left(\frac{-2}{5}\right)(12) = 0\).

It is always a good idea to verify the answer, so let’s actually find the new function \((fgh)(x)\):

\[ \begin{align} (fgh)(x) &= f(x)g(x)h(x) \\ &= \left(\frac{x^{2} + x -2}{x+1}\right)\left(\frac{x-3}{x+4}\right)\left(\frac{x^{2} - x - 12}{x^{2} - 2x}\right) \\ \\ &= \left(\frac{x^{3} - 2x^{2} - 5x + 6}{x^{2} + 5x + 4}\right)\left(\frac{x^{2} - x - 12}{x^{2} - 2x}\right) \\ \\ &= \frac{x^{5}-3x^{4} - 15x^{3} + 35x^{2} + 54x - 72}{x^{4} + 3x^{3} - 6x^{2} - 8x} \end{align} \]

Now that \((fgh)(x)\) has been found, let’s evaluate it at \(x = 1\):

\[ \begin{align} (fgh)(1) &= \frac{(1)^{5} - 3(1)^{4} - 15(1^{3}) + 35(1)^{2} + 54(1) - 72}{(1)^{4} + 3(1)^{3} - 6(1)^{2} - 8(1)} \\ \\ &= \frac{1 -3 - 15 + 35 + 54 - 72}{1 + 3 - 6 - 8} \\ \\ &= \frac{0}{-10} = 0 \end{align} \]

The two answers match, as they should, thus the mapping is

\[ \begin{align} \left(1,(fgh)(1)\right) &= (1,0) \end{align} \]

Note: This is a good example of if given the choice of how to evaluate a newly created function at a given input value, it can be considerably easier to first evaluate the individual functions at the input value and then arithmetically combine them versus first finding the new function then evaluating it at the input value!

It was stated that \(x = -1\) was not in the domain of \((fgh)(x)\), let’s verify that using the newly created function:

\[ \begin{align} (fgh)(1) &= \frac{(-1)^{5} - 3(-1)^{4} - 15(-1^{3}) + 35(-1)^{2} + 54(-1) - 72}{(-1)^{4} + 3(-1)^{3} - 6(-1)^{2} - 8(-1)} \\ \\ &= \frac{-1 - 3 + 15 + 35 - 54 - 72}{1 - 3 - 6 + 8} \\ \\ &= \frac{-80}{0} \text{ UND} \end{align} \]

It is left to the reader to verify the other input values not in the domain.

Figure ??.?? shows the graph of the newly created function, \((fgh)(x) = \frac{x^{5}-3x^{4} - 15x^{3} + 35x^{2} + 54x - 72}{x^{4} + 3x^{3} - 6x^{2} - 8x}\), which represents the product of the outputs of the three individual functions, \(f(x)\), \(g(x)\), and \(h(x)\), for all \(x\) in the domain \((-\infty,-4) \cup (-4,-1) \cup (-1,0) \cup (0,2) \cup (2,\infty)\). The dashed vertical lines clearly show the restrictions on the domain. The mapping \(\left(1,(fgh)(1)\right) = (1,0)\) is also shown on the graph.


Return To Table Of Contents

??.4 The Arithmetic Operation of the Division of Two or More Functions

The fourth arithmetic way to combine two or more functions is with the operation of division. For two functions, \(f(x)\) and \(g(x)\), this would be \(\left(\frac{f}{g}\right)(x) = \frac{f(x)}{g(x)}\). The domain of this function, at first glance, is the intersection of the domain of the function in the numerator, \(f(x)\), and the function the function in the denominator, \(g(x)\). However, of the four arithmetic operations looked at, this arithmetic operation is the only one which imposes its own restriction on input values into the newly created function. That restriction is that any input value, \(x\), can not cause the function in the denominator to be zero. This adds an additional restriction on the domain of \(\left(\frac{f}{g}\right)(x)\): The domain must also include any input, or inputs, which would cause \(g(x)\) to be zero. Thus we say \(\left(\frac{f}{g}\right)(x) = \frac{f(x)}{g(x)}\text{, } g(x) \ne 0\).


CONCEPT: The new function generated by the division of the two functions \(f(x)\) and \(g(x)\) is the quotient of the outputs for all \(x\) in the intersection of the domains of \(f(x)\) and \(g(x)\) except any value of \(x\) which would cause the denominator to be zero. That is \(\left(\frac{f}{g}\right)(x) = \frac{f(x)}{g(x)} \text{, } g(x) \ne 0\).


To explore this concept, let’s start with a simple example.


Example ??.x

Using the two simple functions presented in Example ??.1, \(f(x) = x - 1\) and \(g(x) = 2x + 4\), find the new function created by the arithmetic operation of division, \((fg)(x)\) and what its output would be for \(x = -3\).

Solution

Before beginning to answer this type of question, it is always recommended, even if it is not explicitly asked, to verify that the number at which to evaluate the function is in the function’s domain. Since \(f(x)\) and \(g(x)\) are both polynomials they both have a domain of all real numbers when taken individually. However, since we are dividing by \(g(x)\), we must make sure that no input to \(\left(\frac{f}{g}\right)(x)\) would cause \(g(x)\) to be zero. It is clear that \(x = -2\) would cause \(g(x)\) to be zero, hence the domain of \(\left(\frac{f}{g}\right)(x)\) is all real numbers except \(x = -2\), or in interval notation \((-\infty,-2) \cup (-2,\infty)\). The value to evaluate the function in this problem was \(x = -3\), which is in the domain of \(\left(\frac{f}{g}\right)(x)\).

Let’s first find the new function created by the arithmetic combination of multiplication, \(\left(\frac{f}{g}\right)(x)\):

\[ \begin{align} \left(\frac{f}{g}\right)(x) &= \frac{f(x)}{g(x)} \\ &= \frac{x - 1}{2x + 4} \\ \end{align} \]

Thus \(\left(\frac{f}{g}\right)(x) = \frac{x - 1}{2x + 4}\). Evaluating this newly created function at \(x = -3\):

\[ \begin{align} \left(\frac{f}{g}\right)(-3) &= \frac{(-3) - 1}{2(-3) + 4} \\ &= \frac{-4}{-2} = 2 \\ \end{align} \]

Thus \(\left(\frac{f}{g}\right)(-3) = 2\). Now, let’s evaluate the two individual functions at \(x = -3\) and then divide their respective outputs:

\[ \begin{align} f(-3) &= (-3) - 1 = -4 \\ g(-3) &= 2(-3) + 4 = -2 \\ \left(\frac{f}{g}\right)(-3) &= \frac{f(-3)}{g(-3)} \\ &= \frac{-4}{-2} = 2 \end{align} \]

The mapping, therefore, that occurs when \(x = -3\) is the input to \(\left(\frac{f}{g}\right)(x)\) is \(\left(-3,\left(\frac{f}{g}\right)(x)\right)\), or \((-3,2)\).

\(\textbf{Note: This example is explored further in Appendix ??, Arithmetic Combination of Functions.}\)


The two approaches, finding the new function first then evaluating it at \(x = -3\) or evaluating the two individual functions at \(x = -3\) produced the same result: \(\left(\frac{f}{g}\right)(-3) = 2\). This agrees with the idea that the new function, \(\left(\frac{f}{g}\right)(x) = \frac{x - 1}{2x + 4}\), represents the quotient of the outputs of each function for all \(x\) within its domain which is all real numbers except \(x = -2\).

Let’s continue with more examples.

Example ??.8

Given \(f(x) = 3x - 1\) and \(g(x) = -2x + 3\), find \(\left(\frac{f}{g}\right)(x)\) at \(x=-1\).

Solution

Before beginning to answer this type of question, it is always recommended, if it is not explicitly asked, to verify that the number at which to evaluate the function is in the function’s domain. The domain of \(f(x)\) is all real numbers. The domain of \(g(x)\) is all real numbers except \(x = \frac{3}{2}\) since that would cause \(g(x)\) to be zero. The intersection of these two domains is, in interval notation: \((-\infty,3/2) \cup (3/2,\infty)\). Thus the given value of \(x = -1\) is in the domain of \(\left(\frac{f}{g}\right)(x)\).

The question just asked what is the newly created function evaluated at \(x = -1\). Since no specific approach was required, let’s find the solution by evaluating each of the two individual functions at \(x = -1\) and then take their quotient.

\[ \begin{align} f(-1) &= 3(-1) - 1 \\ &= -4 \\ \\ g(-1) &= -2(-1) + 3 \\ &= 2 + 3 \\ &= 5 \end{align} \]

Therefore,

\[ \begin{align} \left(\frac{f}{g}\right)(-1) &= \frac{f(-1)}{g(-1)} \\ &= \frac{-4}{5} \end{align} \]

Verify this answer by actually finding the newly created function:

\[ \begin{align} \left(\frac{f}{g}\right)(x) &= \frac{3x - 1}{-2x + 3} \end{align} \]

and then evaluate it at \(x = -1\):

\[ \begin{align} \left(\frac{f}{g}\right)(-1) &= \frac{3(-1) - 1}{-2(-1) + 3} \\ &= \frac{-3 - 1}{2 + 3} \\ &= \frac{-4}{5} \end{align} \]

The two answers match, as they should, thus the mapping is

\[ \begin{align} \left(-1,\left(\frac{f}{g}\right)(-1)\right) &= \left(-1,\frac{-4}{5}\right) \end{align} \]


Now let’s consider a more complex example.


Example ??.8

Given \(f(x) = \frac{2x - 1}{x-2}\) and \(g(x) = \frac{x+3}{x+4}\), find \(\left(\frac{f}{g}\right)(x)\) at \(x=-1\).

Solution

Before beginning to answer this type of question, it is always recommended, if it is not explicitly asked, to verify that the number at which to evaluate the function is in the function’s domain. The domain of \(f(x)\) is all real numbers except \(x = 2\). The domain of \(g(x)\) is all real numbers except \(x = -4\). But we must also consider that an input that would \(g(x)\) to be zero must be excluded from the domain. Let’s find if there are any such values of \(x\):

\[ \begin{align} g(x) &= 0 \\ \frac{x+3}{x+4} &= 0 \\ x + 3 &= 0 \\ x &= -3 \end{align} \]

Thus, the domain is all real numbers except \(x = -4\), \(x = -3\), and \(x = 2\) which in interval notation is: \((-\infty,-4) \cup (-4,-3) \cup (-3,2) \cup (2,\infty)\).

The question asked what is the newly created function evaluated at \(x = -1\). Since no specific approach was required, let’s find the solution by evaluating each of the two individual functions at \(x = -1\) and then take their quotient.

\[ \begin{align} f(-1) &= \frac{2(-1) - 1}{(-1) - 2} \\ &= \frac{-2 - 1}{-3} \\ &= \frac{-3}{-3} \\ &= 1 \\ \\ g(-1) &= \frac{(-1) + 3}{(-1) + 4} \\ &= \frac{2}{3} \end{align} \]

From this we then have

\[ \begin{align} \left(\frac{f}{g}\right)(-1) &= \frac{f(-1)}{g(-1)} \\ &= \frac{1}{\frac{2}{3}} \\ &= \frac{3}{2} \end{align} \]

Verify this answer by actually finding the newly created function:

\[ \begin{align} \left(\frac{f}{g}\right)(x) &= \frac{f(x)}{g(x)} \\ \\ &= \frac{\frac{2x - 1}{x-2}}{\frac{x+3}{x+4}} \\ \\ &= \left(\frac{2x - 1}{x-2}\right)\left(\frac{x+4}{x+3}\right) \\ \\ &= \frac{2x^{2} + 7x - 4}{x^{2}+x-6} \end{align} \]

and then evaluate it at \(x = -1\):

\[ \begin{align} \left(\frac{f}{g}\right)(-1) &= \frac{2(-1)^{2} + 7(-1) - 4}{(-1)^{2} + (-1) - 6} \\ \\ &= \frac{2 - 7 - 4}{1 - 1 - 6} \\ \\ &= \frac{-9}{-6} \\ \\ &= \frac{3}{2} \end{align} \]

The two answers match, as they should, thus the mapping is

\[ \begin{align} \left(-1,\left(\frac{f}{g}\right)(-1)\right) &= \left(-1,\frac{3}{2}\right) \end{align} \]

Now that the newly created function has been found, \(\left(\frac{f}{g}\right)(x) = \frac{2x^{2} + 7x - 4}{x^{2}+x-6}\), let’s evaluate it at \(x = -3\), \(x = 2\), and \(x = -4\) to verify the domain:

\[ \begin{align} \left(\frac{f}{g}\right)(-3) &= \frac{2(-3)^{2} + 7(-3)-4}{(-3)^{2} + (-3) - 6} \\ &= \frac{18 - 21 -4}{9 - 3 - 6} \\ &= \frac{-7}{0} \text{ UND} \\ \\ \left(\frac{f}{g}\right)(2) &= \frac{2(2)^{2} + 7(2)-4}{(2)^{2} + (2) - 6} \\ &= \frac{8 + 14 - 4}{4 + 2 - 6} \\ &= \frac{18}{0} \text{ UND} \\ \\ \left(\frac{f}{g}\right)(-4) &= \frac{2(-4)^{2} + 7(-4)-4}{(-4)^{2} + (-4) - 6} \\ &= \frac{32 - 28 - 4}{16 - 4 - 6} \\ &= \frac{0}{6} = 0 \end{align} \]

Clearly, \(x = -3\) (the value of \(x\) which would cause \(g(x)\) to be zero) was correctly determined to not be in the domain. Likewise, \(x = 2\) (value of \(x\) which would cause \(f(x)\) to be undefined) was also correctly determined to not be in the domain. But, it appears that \(x = -4\) was incorrectly stated to not be in the domain for it produces an output of zero, which in this case would mean that the point \((-4,0)\) would be an x-intercept of the function \(\left(\frac{f}{g}\right)(x)\).

Were we wrong? No! Simply stated, the algebra which found the function \(\left(\frac{f}{g}\right)(x)\) brought the term \((x + 4)\) up into the numerator (see above). This removed the issue that \(x = -4\) would be problematic for the function. However, this was the result of an algebraic manipulation and did NOT remove the fact that \(x = -4\) is invalid for the original function (before manipulation). It turns out that there would be hole there instead of a vertical asymptote. And, technically, this hole would be known as a removable discontinuity. The concepts of a hole and vertical asymptotes will be discussed further in Chapter ??. The concept of removable discontinuity, and other related topics, will be thoroughly explored in upper level classes of mathematics (e.g., calculus).

Figure ??.?? shows the graph of the newly created function, \(\left(\frac{f}{g}\right)(x) = \frac{2x^{2} + 7x - 4}{x^{2}+x-6}\), which represents the quotient of the outputs of the two individual functions, \(f(x)\) and \(g(x)\), for all \(x\) in the domain \((-\infty,-4) \cup (-4,-3) \cup (-3,2) \cup (2,\infty)\). The dashed vertical lines clearly show the restrictions on the domain. Notice that there is a hole at \(x = -4\). The mapping \(\left(-1,\left(\frac{f}{g}\right)(-1)\right) = \left(-1,\frac{3}{2}\right)\) is also shown on the graph.

\(\textbf{Note: This example is explored further in Appendix ??, Arithmetic Combination of Functions.}\)


Besides the introduction of a hole, there is another lesson to be learned here which is certainly worth mentioning.


CONCEPT: The means by which we determined the domain of the function \(\left(\frac{f}{g}\right)(x)\) in the above example were correct. It can often be risky to rely solely on just what the domain appears to be of the newly found function.


We will encounter this idea again in the next chapter on composite functions.


Return To Table Of Contents

??.5 Combining Arithmetic Operations of Two or More Functions

The examples in the above section on the arithmetic operation of division focused on the quotient of only two functions. As was the case of the subtraction of two or more functions, examples of this kind are best explored when the arithmetic combination of addition, subtraction, multiplication, and division are combined all together.

Let us explore this idea in the following example.


Example ??.9

Given the following six functions: \(f(x) = x - 2\), \(g(x) = x + 2\), \(h(x) = x -1\), \(j(x) = x + 1\), \(k(x) = x - 3\), and \(p(x) = x + 3\). Find \(\left(fg + \frac{h}{j} - \frac{k}{p}\right)(1)\).

Solution

Before beginning to answer this type of question, it is always recommended, if it is not explicitly asked, to verify that the number at which to evaluate the function is in the function’s domain. All these functions are polynomials so taken individually their domains are all real numbers. However given that \(j(x)\) and \(p(x)\) are in the denominators, the values of \(x = -1\) and \(x = -3\) must be excluded. Therefore, the domain of \(\left(fg + \frac{h}{j} - \frac{k}{p}\right)(x)\) is all real numbers except \(x = -1\) and \(x = -3\), or in interval notation \((-\infty,-3) \cup (-3,-1) \cup (-1, \infty)\). So, the given input of \(x = 1\) is in the domain.

The question asked what is the newly created function evaluated at \(x = 1\). Since no specific approach was required, let’s find the solution by evaluating each of the si individual functions at \(x = 1\) and then take their arithmetic combination.

\[ \begin{align} f(1) &= (1) - 2 = -1 \\ g(1) &= (1) + 2 = 3 \\ h(1) &= (1) - 1 = 0 \\ j(1) &= (1) + 1 = 2 \\ k(1) &= (1) - 3 = -2 \\ p(1) &= (1) + 3 = 4 \end{align} \]

From this we then have

\[ \begin{align} \left(fg + \frac{h}{j} - \frac{k}{p}\right)(1) &= f(1)g(1) + \frac{h(1)}{j(1)} - \frac{k(1)}{p(1)} \\ \\ &= (-1)(3) + \frac{0}{2} - \frac{-2}{4} \\ &= -3 + 0 + \frac{1}{2} \\ &= \frac{-5}{2} \end{align} \]

Verify this answer by actually finding the newly created function:

\[ \begin{align} \left(fg + \frac{h}{j} - \frac{k}{p}\right)(x) &= f(x)g(x) + \frac{h(x)}{j(x)} - \frac{k(x)}{p(x)} \\ \\ &= (x-2)(x+2) + \frac{x-1}{x+1} - \frac{x-3}{x+3} \\ \\ &= x^{2} - 4 + \frac{(x-1)(x+3) - (x+1)(x-3)}{(x+1)(x+3)} \\ \\ &= x^{2} - 4 + \frac{x^{2} + 2x - 3 - (x^{2} - 2x -3)}{x^{2} + 4x + 3} \\ \\ &= x^{2} - 4 + \frac{4x}{x^{2} + 4x + 3} \\ \\ &= \frac{(x^{4} - 4)(x^{2} + 4x + 3) + 4x}{x^{2} + 4x + 3} \\ \\ \left(fg + \frac{h}{j} - \frac{k}{p}\right)(x) &= \frac{x^{4} + 4x^{3} - x^{2} - 12x - 12}{x^{2} + 4x + 3} \end{align} \]

and then evaluate it at \(x = 1\):

\[ \begin{align} \left(fg + \frac{h}{j} - \frac{k}{p}\right)(1) &= \frac{(1)^{4} + 4(1)^{3} - (1)^{2} - 12(1) - 12}{(1)^{2} + 4(1) + 3} \\ &= \frac{1 + 4 - 1 - 12 -12}{1 + 4 + 3} \\ &= \frac{-20}{8} \\ &= \frac{-5}{2} \end{align} \]

The two answers match, as they should, thus the mapping is

\[ \begin{align} \left(1,\left(fg + \frac{h}{j} - \frac{k}{p}\right)(1)\right) &= \left(1,\frac{-5}{2}\right) \end{align} \]

Now that the newly created function has been found, \(\left(fg + \frac{h}{j} - \frac{k}{p}\right)(x) = \frac{x^{4} + 4x^{3} - x^{2} - 12x - 12}{x^{2} + 4x + 3}\), let’s evaluate it at \(x = -1\), and \(x = -3\) to verify the domain:

\[ \begin{align} \left(fg + \frac{h}{j} - \frac{k}{p}\right)(-1) &= \frac{(-1)^{4} + 4(-1)^{3} - (-1)^{2} - 12(-1) - 12}{(-1)^{2} + 4(-1) + 3} \\ \\ &= \frac{1 - 4 - 1 + 12 - 12}{1 - 4 + 3} \\ \\ &= \frac{-4}{0} \text{ UND} \\ \\ \left(fg + \frac{h}{j} - \frac{k}{p}\right)(-3) &= \frac{(-3)^{4} + 4(-3)^{3} - (-3)^{2} - 12(-3) - 12}{(-3)^{2} + 4(-3) + 3} \\ \\ &= \frac{81 - 108 - 9 + 36 -12}{9 - 12 + 3} \\ \\ &= \frac{-12}{0} \text{ UND} \end{align} \]

The domain has been verified.

Figure ??.?? shows the graph of the newly created function, \(\left(fg + \frac{h}{j} - \frac{k}{p}\right)(x) = \frac{x^{4} + 4x^{3} - x^{2} - 12x - 12}{x^{2} + 4x + 3}\), which represents the arithmetic combinations of the outputs of the six individual functions in the domain \((-\infty,-3) \cup (-3,-1) \cup (-1, \infty)\). The dashed vertical lines clearly show the restrictions on the domain. The mapping \(\left(1,\left(fg + \frac{h}{j} - \frac{k}{p}\right)(1)\right) = \left(1,\frac{-5}{2}\right)\) is also shown on the graph.


??.6 Why You Should Care

In this Why You Should Care we will venture into the world of calculus to see how what we learned in this chapter is very relevant to higher levels of mathematics.

Consider the function, \(f(x) = x^{4} - 2x^{3} + 4x^{2}\). At first glance this is a mere degree four polynomial. What’s interesting is that upon closer inspection, \(f(x)\) is actually the sum of three individual functions, \(f_{1}(x) = x^{4}\), \(f_{2}(x) = -2x^{3}\), and \(f_{3}(x) = 4x^{2}\). Or \(f(x) = (f_{1} + f_{2} + f_{3})(x)\). In other words \(f(x)\) is a function formed by the summing of three individual functions. Functions like \(f(x) = x^{4} - 2x^{3} + 4x^{2}\) are not usually thought of in this context, but as we’ll see it is exactly thinking in these terms that form elementary, yet extremely important, mathematical properties. (Actually even the three individual functions can be broken down further but this break down will suffice for the purposes herein.)

From what we learned in this chapter, \(f(x)\) evaluated at \(x = 1\) should equal the sum of the three individual functions evaluated at \(x = 1\). Let’s see if this is true. First, let’s find \(f(1)\):

\[ \begin{align} f(1) &= (1)^{4} - 2(1)^{3} + 4(1)^{2} \\ &= 1 - 2 + 4 = 3 \end{align} \]

Now, let’s find each of the individual functions evaluated at \(x = 1\):

\[ \begin{align} f_{1}(1) &= (1)^{4} \\ &= 1 \\ f_{2}(1) &= -2(1)^{3} \\ &= -2 \\ f_{3}(1) &= 4(1)^{2} \\ &= 4 \end{align} \]

Finding the sum of these three individual functions evaluated at \(x = 1\):

\[ \begin{align} f_{1}(1) + f_{2}(1) + f_{3}(1) &= 1 - 2 + 4 = 3 \end{align} \]

This sum, 3, equals \(f(1)\), thus \(f(1) = f_{1}(1) + f_{2}(1) + f_{3}(1)\); or in general \(f(x) = f_{1}(x) + f_{2}(x) + f_{3}(x)\) which, therefore, yields \(f(x) = (f_{1} + f_{2} + f_{3})(x)\).


CONCEPT: A function that is the sum of \(N\) terms is actually the sum of \(N\) individual functions, one per term.


(The same can be true for the subtraction, product, or quotient of terms, but we’ll stick with just addition which should be sufficient to get the point across.)

As mentioned, this idea that a function such as \(f(x) = x^{4} - 2x^{3} + 4x^{2}\) is actually the sum of two or more individual functions, though often overlooked or not understood) is at the heart of many key properties in mathematics. One such property is differentiation which is one of two central parts of calculus (the other being integration). We can use this as a good example of how what you’re learning right is preparing you for higher level mathematics.

Without going into all the intimate details, let’s assume that, given a function, \(f(x)\), there exists another function, \(f'(x)\), (read as f prime of x), which yields the slope of the tangent line at any point, \(x\), on the curve of \(f(x)\), the original function. This function, \(f'(x)\), is known as the derivative of \(f(x)\). So, for our function, \(f(x) = x^{4} - 2x^{3} + 4x^{2}\), the derivative would be \(f'(x) = 4x^{3} - 6x^{2} + 8x\). Notice that this function, \(f'(x)\), can also be thought of as the sum of three individual functions, \(f'_{1}(x) = 4x^{3}\), \(f'_{2}(x) = -6x^{2}\), and \(f'_{3}(x) = 8x\).

Knowing that \(f'(x)\) gives the slope of the tangent line of any point on \(f(x)\), let’s find what that slope would be at \(x = 1\):

\[ \begin{align} f'(1) &= 4(1)^{3} - 6(1)^{2} + 8(1) \\ &= 4 - 6 + 8 = 6 \end{align} \]

Since we’re at it, let’s find what the equation of this tangent line is. Recall the equation of a line \((y - y_{0}) = m(x - x_{0})\), where \(m\) is the slope of the line and \((x_{0},y_{0})\) is a point on the line. So, for this case: \(y_{0} = f(1) = 1 - 2 + 4 = 3\), \(m = f'(1) = 6\), and \(x_{0} = 1\), the point of interest. Thus, the equation of the tangent line at \(x = 1\) on \(f(x)\) is:

\[ \begin{align} (y - y_{0}) &= m(x - x_{0}) \\ (y - 3) &= 6(x - 1) \\ y - 3 &= 6x - 6 \\ y &= 6x - 3 \end{align} \]

Here is the graph of \(f(x) = x^{4} - 2x^{3} + 4x^{2}\) with the tangent line at \(x = 1\):

Let’s focus on the derivative function of \(f(x)\), \(f'(x) = 4x^{3} - 6x^{2} + 8x\). Given that \(f'(x) = f'_{1}(x) + f'_{2}(x) + f'_{3}(x)\) and that \(f(x) = f_{1}(x) + f_{2}(x) + f_{3}(x)\), it would make sense that \(f'_{1}(x)\) is the derivative function of \(f_{1}(x)\), that \(f'_{2}(x)\) is the derivative function of \(f_{2}(x)\), and that \(f'_{3}(x)\) is the derivative function of \(f_{3}(x)\). Therefore, we should be able to produce the equation of the tangent line at \(x = 1\) on \(f(x)\), \(y = 6x - 3\), from these three individual functions.

Let’s first consider the individual function \(f_{1}(x) = x^{4}\) and \(f'_{1}(x) = 4x^{3}\). The slope of the tangent line at \(x = 1\) on the curve of \(f_{1}(x)\) is \(f'_{1}(1) = 4(1)^{3} = 4\). The equation of this tangent line would then be:

\[ \begin{align} (y - f_{1}(1)) &= f'_{1}(1)(x - 1) \\ y - 1 &= 4(x - 1) \\ y - 1 &= 4x - 4 \\ y &= 4x - 3 \end{align} \]

Let’s call this equation \(y_{1}\) to represent the equation of the tangent on on \(f_{1}(x)\). Thus, \(y_{1} = 4x - 3\).

Next, let’s consider the second individual function \(f_{2}(x) = -2x^{3}\) and \(f'_{2}(x) = -6x^{2}\). The slope of the tangent line at \(x = 1\) on the curve of \(f_{2}(x)\) is \(f'_{2}(1) = -6(1)^{2} = -6\). The equation of this tangent line would then be:

\[ \begin{align} (y - f_{2}(1)) &= f'_{2}(1)(x - 1) \\ y - -2 &= -6(x - 1) \\ y + 2 &= -6x + 6 \\ y &= -6x + 4 \end{align} \]

Let’s call this equation \(y_{2}\) to represent the equation of the tangent on on \(f_{2}(x)\). Thus, \(y_{2} = -6x + 4\).

And lastly, let’s consider the third individual functions \(f_{3}(x) = 4x^{2}\) and \(f'_{3}(x) = 8x\). The slope of the tangent line at \(x = 1\) on the curve of \(f_{3}(x)\) is \(f'_{3}(1) = 8(1) = 8\). The equation of this tangent line would then be:

\[ \begin{align} (y - f_{3}(1)) &= f'_{3}(1)(x - 1) \\ y - 4 &= 8(x - 1) \\ y - 4 &= 8x - 8 \\ y &= 8x - 4 \end{align} \]

Let’s call this equation \(y_{3}\) to represent the equation of the tangent on on \(f_{3}(x)\). Thus, \(y_{3} = 8x - 4\)

Let’s recap. The function, \(f(x) = x^{4} - 2x^{3} + 4x^{2}\) is known to have a derivative function, \(f'(x) = 4x^{3} - 6x^{2} + 8x\). The derivative function, \(f'(x)\), yields the slope of the tangent line at any point, \(x\), on \(f(x)\). At \(x = 1\), it was determined that this slope was \(6\) and the associated equation of the tangent line was \(y = 6x - 3\).

The function, \(f(x) = x^{4} - 2x^{3} + 4x^{2}\), can be thought of as being the arithmetic sum of three individual functions, \(f_{1}(x)\), \(f_{2}(x)\), and \(f_{2}(x)\), where \(f_{1}(x) = x^{4}\), \(f_{2}(x) = -2x^{3}\), and \(f_{3}(x) = 4x^{2}\). Thus \(f(x) = (f_{1} + f_{2} + f_{3})(x)\).

Likewise, \(f'(x) = 4x^{3} - 6x^{2} + 8x\), can be thought of as being the arithmetic sum of three individual functions, \(f'_{1}(x)\), \(f'_{2}(x)\), and \(f'_{3}(x)\), where \(f'_{1}(x) = 4x^{3}\), \(f'_{2}(x) = -6x^{2}\), and \(f'_{3}(x) = 8x\). Thus \(f'(x) = (f'_{1} + f'_{2} + f'_{3})(x)\).

Since we have three functions (which make up \(f(x)\)), \(f_{1}(x)\), \(f_{2}(x)\), and \(f_{3}(x)\), each with its own derivative \(f'_{1}(x)\), \(f'_{2}(x)\), and \(f'_{3}(x)\), we found the slopes and equation of the tangent lines for \(x = 1\) for each of these individual functions. These slopes for each are 4, -6, and 8, respectively. The corresponding equations for the tangent lines are \(y_{1} = 4x - 3\), \(y_{2} = -6x + 4\), and, \(y_{3} = 8x - 4\).

If we add the three slopes together, we get: \(4 + -6 + 8 = 6\). This is the slope of the tangent line at \(x = 1\) on \(f(x)\)!. If we add the three tangent line equations together, we get:

\[ \begin{align} y_{1} &= 4x - 3 \\ y_{2} &= -6x + 4 \\ y_{3} &= 8x - 4 \\ \text{---} &= \text{---------} \\ y &= 6x - 3 \end{align} \]

This is the equation of the tangent line at \(x = 1\) on \(f(x)\) we found above!!!! Amazing.

Here are the graphs of each function, \(f(x)\), \(f_{1}(x)\), \(f_{2}(x)\), and \(f_{3}(x)\) along with the respective tangent lines at \(x = 1\) which, when summed, equal the tangent line at \(x = 1\) on \(f(x)\):

What was discovered with just a small amount of help (e.g., what the derivative function for our example function, \(f(x)\) was) is a key property of differentiation which basically states that given a function which is the sum of other functions, the derivative of this function is the sum of the derivatives of each of the other functions. This is known as the sum rule of differentiation, which basically says given

\[ \begin{align} f(x) &= (f_{1} + f_{2} + f_{3} + \cdots + f_{n})(x) \\ &= f_{1}(x) + f_{2}(x) + f_{3}(x) + \cdots + f_{n}(x) \end{align} \]

then

\[ \begin{align} f'(x) &= (f_{1} + f_{2} + f_{3} + \cdots + f_{n})'(x) \\ &= f'_{1}(x) + f'_{2}(x) + f'_{3}(x) + \cdots + f'_{n}(x) \end{align} \]


CONCEPT: Given \(f(x) = (f_{1} + f_{2} + f_{3} + \cdots + f_{n})(x) = f_{1}(x) + f_{2}(x) + f_{3}(x) + \cdots + f_{n}(x)\), then its derivative is the sum of the derivatives of each of the individual functions: \(f'(x) = f'_{1}(x) + f'_{2}(x) + f'_{3}(x) + \cdots + f'_{n}(x)\)!


Think about what was just accomplished. Using only our knowledge and understanding of the arithmetic combination of functions along with the idea that a function comprised of individual terms summed together can be expressed as the sum of individual functions, and a little background information, a key property in calculus was discovered. Granted, what we did was not a formal proof of the sum rule by any stretch, it is still a major accomplishment. And, this idea of expressing any function in terms of the sum of individual functions plays a key role in many, many other definitions, properties, rules, etc. in mathematics. That is Why You Should Care!

So, CONGRATULATIONS!!!!

(You’ll smile for sure when you encounter this property, and others, in calculus!)


Return To Table Of Contents

??.7 Chapter Review

This chapter presented an in depth look at the arithmetic combination of functions which are a very powerful way to combine two or more functions together. The arithmetic combination of functions is the first of two ways we will explore to combine two or more functions together to form a new function. The second way is the composition of two or more functions which we will look at in the next chapter.

The arithmetic combination of two or more functions combines these functions under the arithmetic operations of addition, subtraction, multiplication, and division to form a new function. For the two function case, we have:

\[ \begin{align} (f + g)(x) &= f(x) + g(x) &\text{Addition} \\ (f - g)(x) &= f(x) - g(x) &\text{Subtraction}\\ (fg)(x) &= f(x)g(x) &\text{Multiplication} \\ \left(\frac{f}{g}\right)(x) &= \frac{f(x)}{g(x)},\text{ }g(x)\ne0 &\text{Division}\\ \end{align} \]

Key to understanding these functions is to recognize that the input to the function, \(x\), goes into each of the individual functions simultaneously and the outputs of each are combined under the specified arithmetic operation. In other words, each of the individual functions operates on the same input value. Quite useful in internalizing this idea is the following schematic for the arithmetic combination of two functions which can be easily extended to the \(n\) function case:

To find what the newly created function is one would algebraically combine the individual functions under the specified arithmetic operation. For example, to find the new function, \((f + g)(x)\) would algebraically add the functions \(f(x)\) and \(g(x)\) together. That is: \((f + g)(x) = f(x) + g(x)\).

Should want to evaluate the newly created function at a particular input \(x\), one could first find the newly created function and then evaluate it at the given \(x\). Or, one could evaluate the individual functions at the given \(x\) and then combine these outputs under the specified arithmetic operation. The latter can be more expedient depending on the functions given or the context of the problem. Thus newly created function represents the output of each of the individual functions for all \(x\) in its domain.

The domain of the newly created function is the intersection of the domains of the individual functions for, remember, the input, \(x\), goes into each of the individual functions so, therefore, it must be valid (or in the domain) of each of the individual functions. There is another restriction on the domain imposed only on the arithmetic operation of division, \(\left(\frac{f}{g}\right)(x)\). In this case, since \(g(x)\) is in the denominator any input, \(x\), which would cause \(g(x)\) to produce a zero must also be excluded from the domain.


??.8 Exercises

Problem ??-1. Given \(f(x) = -3x^{2} - 2x + 1\) and \(g(x) = 4x - 3\). Find \((f+g)(x)\), \((f-g)(x)\), \((fg)(x)\), and \(\left(\frac{f}{g}\right)(x)\). Find \((f+g)(-1)\), \((f-g)(-1)\), \((fg)(-1)\), and \(\left(\frac{f}{g}\right)(-1)\) y first evaluating the two functions individually and by evaluating the combined function. Compare your answers.

Problem ??-2. Given \(f(x) = \frac{2x-3}{x+1}\) and \(g(x) = \frac{x-1}{-x+2}\). Find \((f+g)(x)\), \((f-g)(x)\), \((fg)(x)\), and \(\left(\frac{f}{g}\right)(x)\). Find \((f+g)(-1)\), \((f-g)(-1)\), \((fg)(-1)\), and \(\left(\frac{f}{g}\right)(-1)\) y first evaluating the two functions individually and by evaluating the combined function. Compare your answers.

Problem ??-3. Given \(f(x) = x^{2} + x - 3\), \(g(x) =2x^{2} - 4x + 7\), and \(h(x) = 2x^{3} + 3x^{2} + 4x - 1\). Find \((fgh)(x)\).

Problem ??-4. Given \(f(x) = 2x^{3} + 3x^{2} + 4x - 1\), \(g(x) =2x^{2} - 4x + 7\). Find \(\left(\frac{f}{g}\right)(x)\). Verify your answer for \(x = 1\).

Return To Table Of Contents


.

Chapter ??

Composite Functions

In the last chapter we looked at how to combine two or more functions together via the arithmetic operations of addition, subtraction, multiplication, and division to form a new function and what that newly found function represented. In this chapter we will look at another way of combining two or more functions together to form a new function; that way is via the composition of functions, or the idea of a composite function.

Composite Functions play an important role in mathematics, calculus being just one example. They are also at the heart of many real-world applications, AI (Neural Networks in particular) being one key example. To see why this is, let’s first explore what is a composite function, how it works, and how it differs from the arithmetic combination of functions discussed in the last chapter.


??.1 The Composite Function

What is a composite function? A (very) simple answer might be that the composite function is composed of two or more individual functions which are put together in such a way so as to form the new function. An analogy could a brick, or really any other physical object. The brick is made up of many different materials which are blended together, hardened, etc., such that the result is the brick. Sounds good, but what is the in such a way in which the two or more individual functions are put together?

The use of only two functions will help understand what this “in such a way” is. Suppose we have two functions, \(f(x)\) and \(g(x)\), and connect them together such that the output of \(g(x)\) for some input \(x\), becomes the input to the second function, \(f(x)\). Figure ??.1 is the schematic that illustrates this idea:

Clearly we see that the input, \(x\) goes first into the function, \(g(x)\). \(g(x)\) will use the input \(x\) to perform its function duties and will produce the output, \(g(x)\). This output then becomes the input to \(f(x)\). \(f(x)\) will use this input, \(g(x)\), and produce the output \(f(g(x))\). Thus, the output of the first function becomes the input to the second function.

Looking at the output produced, \(f(g(x))\), we can communicate this as \(f\) of \(g\) of \(x\). That’s what the notation \(f(g(x))\) means. The succinct mathematical notation for this is \((f \circ g)(x)\), where the \(\circ\) operator implies the composite of \(f\) and \(g\), or the composite function.


CONCEPT: The new function generated by having the output of one function becoming the input to another function is called the composite function. With the first function being \(g(x)\) and the second function being \(f(x)\), then the composite function is \((f \circ g)(x)\) and is defined to be \((f \circ g)(x) = f(g(x))\).


An important thing to note that \((f \circ g)(x)\) is a composite function! It is like any other function in the sense that it will have a domain and all the other characteristics that make up a function. And, this includes mapping. As you will recall, a function, \(f\), for example, maps an input to a unique output thus creating the mapping \((x,f(x))\). Well, since the composite function, \((f \circ g)(x)\), is a function it, too, will take an input, \(x\), and map it to a unique output. The mapping will be \(\left(x,(f \circ g)(x)\right)\).


CONCEPT: The composite function, \((f \circ g)(x)\), and will take an input, \(x\), and map it to a unique output. The mapping will be \(\left(x,(f \circ g)(x)\right)\).


Since \(f(x)\) and \(g(x)\) are functions, we can, in theory, switch them around. That is, we can have \(f(x)\) be the first function and \(g(x)\) be the second function. Thus, for a given input, \(x\), it would first go into \(f\) which would produce the output, \(f(x)\). The second function, \(g(x)\) would output would take \(f(x)\) as its input and produce \(g(f(x))\), or \(g\) of \(f\) of \(x\). This is the composite function, \((g \circ f)(x) = g(f(x))\). Figure ??.2 is the schematic that illustrates this idea:


CONCEPT: The new function generated by having the output of one function becoming the input to another function is called the composite function. With the first function being \(f(x)\) and the second function being \(g(x)\), then the composite function is \((g \circ f)(x)\) and is defined to be \((g \circ f)(x) = g(f(x))\). This composite function will take an input, \(x\), and map it to a unique output. The mapping will be \(\left(x,(g \circ f)(x)\right)\)


It was mentioned above that since \(f(x)\) and \(g(x)\) are functions, we can, in theory, switch them around. Why in theory? The reversal of the functions is in many cases an academic exercise, albeit a very important one. But within the context of a real-world application the two functions would be used for specific purposes, meaning that the switching them around would make no sense.

As an very simple example of both the value of a composite function and how switching the two functions around would not make sense, consider a manufacturing company which manufactures widgets. The manufacturing floor manager has a model, \(f(x)\), which he uses to determine the number of widgets produced over some period of time. In other words, he puts into his model some value of \(x\) and the output tells him how many widgets are produced. The business office manager has her own model, \(g(x)\), which takes the number of widgets produced and determines the profit made. To run her model, she has to call the manufacturing floor manager to get the number of widgets produced. A two step process which is not very efficient. The technical engineer of the company decides that it would be a lot more efficient if the two models are combined in such a way that the output of the manufacturing floor manager’s model is fed directly into the business officer’s model. That is, the output of \(f(x)\), the number of widgets produced, becomes the into to \(g(x)\) which then outputs profit. Thus, the technical engineer created the composite function \((g \circ f)(x)\). The input to this composite function is \(x\) which represents time, the output of \(f(x)\) is the number of widgets produced. This becomes the input to \(g(x)\) - thus \(g(x)\) is expecting number of widgets as its input - and produces profit as the output. Can these two functions be switched to form \((f \circ g)(x)\)? No, they cannot. In this case the input \(x\) would represent number of widgets produced (what the business manager’s model is expecting as its input) and the output, thus the input to \(f(x)\), would be profit, but \(f(x)\) was expecting time as the input. So, switching the two functions in this composite function would not make sense.

Unlike the commutative property of multiplication where \(ab = ba\), the two composite functions, \((f \circ g)(x)\) and \((g \circ f)(x)\), are usually not equal. That is \((f \circ g)(x) \ne (g \circ f)(x)\) in most cases. They can be equal, but the majority of the time they are not, thus the order in which two functions are connected usually produces two (very) different composite functions. We will see later in the next chapter, that there is one case, however, where they must be equal, the case where \(f(x)\) and \(g(x)\) are Inverse Functions.

One final note is that a composite function, \((f \circ g)(x)\), for example, is composed of two individual functions, \(f\) and \(g\). These two functions are individual in the sense that they can stand on their own, completely independent of each other. The two models reference in the widget example above is an example of this. Likewise, the composite function once created, albeit via the composition of the two functions \(f\) and \(g\), is itself a stand-alone function to be used within whatever context is appropriate.


Return To Table Of Contents

??.2 Undertstanding The Composite Function Schematic

Above we saw the two individual schematics for \((f \circ g)(x)\) and \((g \circ f)(x)\). (We will see this expanded to more than two functions later.) From these we see that the input to the composite function, \(x\), goes only into the first function, \(g(x)\) for \((f \circ g)(x)\) or \(f(x)\) for \((g \circ f)(x)\). The input never gets to the second function. It is the output of the first function which becomes the input to the second function. This is an extremely important idea!

Figure ??.? below, combines these two schematics into one to illustrate how composite functions work. The understanding of how a composite function works is critical and will be at the heart of what is to follow.


CONCEPT: The understanding of the composite function schematic is key to the understanding of composite functions.


What if we have more than two functions? Consider the three functions, \(f(x)\), \(g(x)\) and \(h(x)\) connected in such a way that the input, \(x\), goes first into the function \(h\); the output of \(h\), \(h(x)\), goes into the function \(g\); the output of \(g\), \(g(h(x))\), then goes into the function \(f\); the output of \(f\) then is \(f(g(h(x)))\). This is the composite function \((f \circ g \circ h)(x)\) or \(f\) of \(g\) of \(h\) of \(x\). The schematic for this composite function is:

There can be as many functions combined in this way as desired or needed within a given context. For example, if there were \(n\) functions, \(f_{1}, f_{2}, \cdots, f_{n-1},f_{n}\), then we could form the composite function, \((f_{n} \circ f_{n-1} \circ \cdots \circ f_{2} \circ f_{1})(x)\), or \((f_{n}(f_{n-1}(\cdots f_{2}(f_{1}(x))))(x)\). Note, this is just but one way these \(n\) functions could be combined.

An observation that can be made by studying the schematic is that the functions which compose the composite function are chained together. The chain begins with the first function and ends with the last, where the chaining together of these functions is done such that the output of one function in the chain becomes the input to the next function in the chain. This is an important idea, and is at the heart of one of the key differentiation principles in calculus, The Chain Rule.


CONCEPT: A composite function can be thought of as the chaining together functions in such a way that the output of one function in the chain becomes the input to the next function in the chain.


To see how this works, and to understand how the new function formed by taking the composite of two or more functions differs from the arithmetic combination of two or more functions, refer back to the composite function \((f \circ g \circ h)(x)\) shown in Figure ??.?? above. Let’s follow the path of the input, \(x\). The first function that \(x\) goes into is \(h\) which operates on it to produce the output \(h(x)\). This output then becomes the input to the second function, \(g\), which operates on it to produce the output \(g(h(x))\). This output then becomes the input to the last function, \(f\), which operates on it to produce the output \(f(g(h(x)))\), or \((f \circ g \circ h)(x)\).

From this, we see that the input, \(x\), only directly enters the first function. This is a significant difference from the way the arithmetic combination of functions work. It the latter case, the latter case, the input, \(x\), went into each function simultaneously. In a composite function, the input, \(x\), only directly enters the first function. Obviously, the input affects the output of the composite function, but it is a significant difference between a composite function and a function formed by the arithmetically combining two or more functions. This will play a key role in the determination of the domain of a composite function as we’ll see in section ??.??.


CONCEPT: The input to a composite function only directly enters the first function in the composite function.


One final point. The schematic shows the flow of an input, \(x\), in the composite function going from left to right. The notation for a composite function represents this idea from right to left. Referring again to composite function \((f \circ g \circ h)(x)\) shown in Figure ??.?? above it was seen that the input, \(x\), when first into the function \(h\). In the notation, \((f \circ g \circ h)(x)\), and in the communicating this in words that the composite function is \(f\) of \(g\) of \(h\) of \(x\), the input \(x\) first enter \(h\) on the right, then the output \(h(x)\) enters \(g\) and then the output \(g(h(x))\) enters \(f\) to produce the output \(f(g(h(x)))\). The flow in the notation is from right to left.

Again, it cannot be overstated that the understanding of the schematic of a composite function is key to understanding composite functions.


??.3 Finding The Composite Function

Before exploring the workings of a composite function in detail, we must first understand how a composite function is actually found. Let’s begin with the following example using two simple functions.


Example ??.1

Consider the two functions, \(f(x) = x^{2} - 3x + 4\) and \(g(x) = -x + 2\). Find the composite functions \((g \circ f)(x)\) and \((f \circ g)(x)\).

Solution

First find the composite function \((g \circ f)(x)\):

\[ \begin{align} (g \circ f)(x) &= g(f(x)) \\ &= g(x^{2} - 3x + 4) \\ &= -(x^{2} - 3x + 4) + 2 \\ &= -x^{2} + 3x - 4 + 2 \\ &= -x^{2} + 3x - 2 \end{align} \]

Thus, the newly formed composite function, \((g \circ f)(x)\) is \((g \circ f)(x) = -x^{2} + 3x - 2\).

Next, find the composite function \((f \circ g)(x)\):

\[ \begin{align} (f \circ g)(x) &= f(g(x)) \\ &= (-x+2)^{2} - 3(-x+2) + 4 \\ &= x^{2} - 4x + 4 + 3x - 6 + 4 \\ &= x^{2} - x + 2 \end{align} \]

Thus, the newly formed composite function, \((f \circ g)(x)\) is \((f \circ g)(x) = x^{2} - x + 2\).


Looking closely at this example, we see that to find \((g \circ f)(x)\) we use the definition that \((g \circ f)(x) = g(f(x))\). What this means is that we evaluate the function, \(g(x)\) at \(f(x)\). This now becomes a function evaluation problem. That is, everywhere we see an \(x\) in the function, \(g\), we substitute it with \(f(x)\), which is \(x^{2} - 3x + 4\). Using algebraic manipulation, we arrive at \((g \circ f)(x) = -x^{2} + 3x - 2\).

Similarly, to find \((f \circ g)(x)\), we use the definition that \((f \circ g)(x) = f(g(x))\). Thus we evaluate the function, \(f(x)\), at \(g(x)\). That is, everywhere we see an \(x\) in the function, \(f\), we substitute it with \(g(x)\), which is \(-x + 2\). Using algebraic manipulation, we arrive at \((f \circ g)(x)\) is \((f \circ g)(x) = x^{2} - x + 2\).


CONCEPT: The finding of a composite function becomes a function evaluation problem.


The other thing we can glean from this example is that \((f \circ g)(x) \ne (g \circ f)(x)\) which, as was mentioned, is usually the case.

Now, let’s look at a more interesting example.


Example ??.2

Consider the two functions, \(f(x) = \frac{x+2}{x-1}\) and \(g(x) = \frac{-2x - 3}{x+1}\). Find the composite functions \((g \circ f)(x)\) and \((f \circ g)(x)\).

Solution

First find the composite function \((f \circ g)(x)\):

\[ \begin{align} (f \circ g)(x) &= f(g(x)) \\ \\ &= f\left(\frac{-2x - 3}{x+1}\right) \\ \\ &= \frac{\left(\frac{-2x - 3}{x+1}\right) + 2}{\left(\frac{-2x - 3}{x+1}\right) - 1} \\ \\ &= \frac{\frac{-2x - 3 + 2(x+1)}{x+1}}{\frac{-2x-3-(x+1)}{x+1}} \\ \\ &= \frac{\frac{-2x - 3 + 2x + 2}{x+1}}{\frac{-2x - 3 - x -1}{x+1}} \\ \\ &= \frac{-1}{-3x + 4} \end{align} \]

Thus, the newly formed composite function, \((f \circ g)(x)\) is \((f \circ g)(x) = \frac{-1}{-3x + 4}\).

Next, find the composite function \((g \circ f)(x)\):

\[ \begin{align} (g \circ f)(x) &= g(f(x)) \\ \\ &= g\left(\frac{x+2}{x-1}\right) \\ \\ &= \frac{-2\left(\frac{x+2}{x-1}\right) - 3}{\left(\frac{x+2}{x-1}\right) + 1} \\ \\ &= \frac{\frac{-2(x+2) - 3(x-1)}{x-1}}{\frac{x + 2 + (x - 1)}{x-1}} \\ \\ &= \frac{\frac{-2x - 4 - 3x +3}{x-1}}{\frac{x+2 + x - 1}{x-1}} \\ \\ &= \frac{-5x - 1}{2x + 1} \end{align} \]

Thus, the newly formed composite function, \((g\circ f)(x)\) is \((g \circ f)(x) = \frac{-5x - 1}{2x + 1}\).


As in the previous example, take note that \((f \circ g)(x) \ne (g \circ f)(x)\) which, again, is usually the case. And also take note that to find the composite function requires function evaluation.


Return To Table Of Contents

??.4 A Closer Look At The Composite Function

The previous chapter showed that for, say two functions, \(f(x)\) and \(g(x)\), if the question asked was (only) to evaluate the new function at a particular input value, \(x\), there were two ways to answer this question. One was was to first find the new function and then evaluate it at the given input value. The second way was to evaluate each function individually at the given input value and then combine the outputs using the specified arithmetic operation. For example, if the question was to find \((f+g)(-1)\) given two functions, \(f(x)\) and \(g(x)\). One approach would be find \((f+g)(x)\) then evaluate it at \(x = -1\). The other approach would be to find \(f(-1)\) and \(g(-1)\) and then add the two outputs together (for the arithmetic operation specified was the operation of addition). Usually the second approach is simpler.

What about for composite functions? Given two functions, \(f(x)\) and \(g(x)\), and the question was (only) to find \((f \circ g)(1)\), there are still two ways to answer the question. The first way would be to first find the composite function itself and then evaluate it at \(x = 1\). The following example illustrates this first approach for the two functions, \(f(x) = \frac{x+2}{x-1}\) and \(g(x) = \frac{-2x - 3}{x+1}\) seen in the previous example.


Example ??.3

Given the two functions, \(f(x) = \frac{x+2}{x-1}\) and \(g(x) = \frac{-2x - 3}{x+1}\), find \((f \circ g)(1)\).

Solution

One approach to answering the question is to first find the composite function and then evaluate it at \(x = 1\). From Example ??.2 it was found that \((f \circ g)(x) = \frac{-1}{-3x + 4}\). Evaluating this newly formed composite function at \(x=1\) yields:

\[ \begin{align} (f \circ g)(1) &= \frac{-1}{-3(1) -4} \\ &= \frac{-1}{-7} = \frac{1}{7} \end{align} \]


The mapping, therefore, is \(\left(1,-\frac{1}{7}\right)\).

Is there an alternative approach? Yes, but it is not the evaluation of the two individual functions at \(x = 1\) and then combining their outputs together somehow as it was for the arithmetic combination of two functions! The approach would be to use the composite function schematic! The following example illustrates this idea.


Example ??.4

Given the two functions, \(f(x) = \frac{x+2}{x-1}\) and \(g(x) = \frac{-2x - 3}{x+1}\), find \((f \circ g)(1)\).

Solution

An alternative approach to the one used in Example ??.3 to answering this question, find \((f \circ g)(1)\), is to use the composite function schematic. Since the question was to find \((f \circ g)(1)\), recall the schematic for \((f \circ g)(x)\):

The input, \(x = 1\) first goes into the function \(g\) which would output \(g(1)\). Let’s evaluate \(g(1)\):

\[ \begin{align} g(1) &= \frac{-2(1) - 3}{(1) + 1} \\ &= \frac{-5}{2} \end{align} \]

Following the chain, this output of \(g\), \(g(1)\), then becomes the input to the function \(f\). This means that \(f\) would take this value as its input, apply its function definition to it, to produce the output \(f\left(\frac{-5}{2}\right)\). Let’s see what this output is:

\[ \begin{align} f\left(\frac{-5}{2}\right) &= \frac{\left(\frac{-5}{2}\right) + 2}{\left(\frac{-5}{2}\right) - 1} \\ \\ &= \frac{\frac{-1}{2}}{\frac{-7}{2}} \\ \\ &= \frac{1}{7} \end{align} \]

Here is the illustration of showing the progression through the composite function schematic for \(x = 1\):

The answer found, \((f \circ g)(1) = \frac{1}{7}\), is the same as the answer found in Example ??.3 which first found the composite function and then evaluated it at \(x = 1\). The mapping, therefore, is also the same: \(\left(1,-\frac{1}{7}\right)\).


This approach of using the composite function schematic is a powerful one. Finding the composite function can, in many cases, be algebraically difficult and is avoidable in problems like this where it was not necessary to find. The use of the composite function can also be used to verify the answer found by evaluating the composite function if it was used; or the other way around. As we’ll see, the using of the composite function schematic will be very useful in finding the domain of a composite function.


CONCEPT: The using of the composite function schematic is powerful and can eliminate the need to actually find the composite function at all for certain types of problems or can be used to verify an answer found directly from using the composite function.


The concept of a composite function is predicated on the idea that functions are chained together is such a way that the output of one function in the chain of functions becomes the input to the next function in the chain. The composite function schematic clearly illustrates this idea.

Example ??.5 provides another visualization of the concept of the output of one function becoming the input to another.


Example ??.5

Given the two functions \(f(x) = -x^{2} - x + 5\) and \(g(x) = -\frac{1}{2}x - 2\), find \((f \circ g)(1)\).

Solution

First, let’s find the composite function, \((f \circ g)(x)\):

\[ \begin{align} (f \circ g)(x) &= f(g(x)) \\ \\ &= f\left(-\frac{1}{2}x - 2\right) \\ \\ &= -\left(-\frac{1}{2}x - 2\right)^{2} - \left(-\frac{1}{2}x - 2\right) + 5 \\ \\ &= -\left(\frac{1}{4}x^{2} + 2x + 4\right) + \frac{1}{2}x + 2 + 5 \\ \\ &= -\frac{1}{4}x^{2} - 2x - 4 + \frac{1}{2}x + 7 \\ \\ &= -\frac{1}{4}x^{2} - \frac{3}{2}x + 3 \end{align} \]

Thus, \((f \circ g)(x) = -\frac{1}{4}x^{2} - \frac{3}{2}x + 3\). Now let’s evaluate it at \(x = 1\):

\[ \begin{align} (f \circ g)(1) &= -\frac{1}{4}(1)^{2} - \frac{3}{2}(1) + 3 \\ &= -\frac{1}{4} - \frac{3}{2} + 3 \\ &= -\frac{1}{4} - \frac{6}{4} + \frac{12}{4} \\ &= \frac{5}{4} \end{align} \]

The solution found via first finding the composite function, \((f \circ g)(x)\), then evaluating it at \(x = 1\) is \((f \circ g)(1) = \frac{5}{4}\). The mapping, therefore, is \(\left(1,\frac{5}{4}\right)\).

Figure ??.?? illustrates this approach. The newly found composite function, \((f \circ g)(x) = -\frac{1}{4}x^{2} - \frac{3}{2}x + 3\), is plotted. The desired input, \(x = 1\), is shown rising up to intersect the composite function at the point \(\left(1,\frac{5}{4}\right)\), thus verifying that \((f \circ g)(1) = \frac{5}{4}\). This is basic function evaluation when the function is known.

Now let’s explore the use of the composite function schematic. This was already explored in Example ??.4 but will revisit it here again.

The input \(x = 1\) goes into \(g(x)\) first which produces the output \(g(1) = -\frac{5}{2}\). This then becomes the input to \(f(x)\) which produces the output \(f\left(-\frac{5}{2}\right) = \frac{5}{4}\), the same as was found when evaluating the composite function itself at \(x = 1\). The mapping, therefore, is \(\left(1,\frac{5}{4}\right)\) is also the same.

The composite function schematic is the ideal way to understand the idea that the output of one function becomes the input to the next function in a chain of functions. Though not as succinct in showing this idea as the schematic, one can actually create a plot of the two individual functions forming the composite function and then show that the output of the first function if inputted into the second function is actually the output of the composite function formed by these two functions for a given input, \(x\). Such a plot is given below in Figure ??.?? for the functions used in this example.

As the plot shows, when \(g\) is evaluated at the input, \(x = 1\), \(g\) produces the output of \(-\frac{5}{2}\) which is the point \(\left(1,-\frac{5}{2}\right)\) on the plot of \(g(x)\). To visualize that this output becomes the input to \(f\), the y-coordinate is slid over to where it intersects the line \(y = x\), at the point \(\left(-\frac{5}{2},-\frac{5}{2}\right)\). The x-coordinate then becomes the input to the function, \(f(x)\), which then produces the point \(\left(-\frac{5}{2},\frac{5}{4}\right)\) on the graph of \(f\). This represents the output of the composite function \((f \circ g)(x)\) evaluated at \(x = 1\).


The above examples showed how given two functions, \(f(x)\) and \(g(x)\), to not only find the composite function \((f \circ g)(x)\) or \((g \circ f)(x)\), but to evaluate it at a given input, \(x\). Several approaches to the evaluation of a composite function at a given input \(x\) were explored, all intended to enhance the understanding of composite functions. Of these approaches, the use of the composite function schematic is, in this author’s most humble opinion, the most powerful and beneficial choice.


CONCEPT: There are various ways to understand a composite function, how it works, and how to evaluate it at a given input, \(x\). Of them all, the composite function schematic remains the most powerful and beneficial choice.


In the next section, we will take a look at another very important component to a composite function, and that is its domain.


Return To Table Of Contents

??.5 The Domain Of The Composite Function

In the previous chapter we saw that the domain of a function formed by the arithmetic combination of two or more functions was the intersection of the domains of each of the individual functions. This was a consequence of the fact that a given input, \(x\), went into each of the functions simultaneously. What is the domain of a function formed as the composite of two or more functions?

To begin to answer this question we will use two simple functions, \(f(x)\) and \(g(x)\), to form the composite function \((f \circ g)(x)\).


Example ??.6

Given the two functions \(f(x) = 2x^{2} - x + 1\) and \(g(x) = -3x + 2\), find the domain of \((f \circ g)(x)\).

Solution

An intuitive approach to answer this question is to first find the composite function \((f \circ g)(x)\), and then determine its domain:

\[ \begin{align} (f \circ g)(x) &= f(g(x)) \\ &= f(-3x + 2) \\ &= 2(-3x + 2)^{2} - (-3x + 2) +1 \\ &= 2(9x^{2} - 12x + 4) + 3x - 2 + 1 \\ &= 18x^{2} - 24x + 8 + 3x -1 \\ &= 18x^{2} - 21x + 7 \end{align} \]

Thus, \((f \circ g)(x) = 18x^{2} - 21x + 7\). Since this is a polynomial we conclude, then, that the domain of \((f \circ g)(x)\) is all real numbers which expressed in interval notation is \((-\infty,\infty)\).


This example seems to indicate that to find the domain of a composite function, one should first find the composite function itself and then find the domain of it. Before we can draw this conclusion that this is true for all cases, let’s explore another example.


Example ??.7

Given the two functions \(f(x) = \frac{x+4}{3x+2}\) and \(g(x) = 2x + 1\), find the domain of \((f \circ g)(x)\).

Solution

First, let’s find the composite function \((f \circ g)(x)\):

\[ \begin{align} (f \circ g)(x) &= f(g(x)) \\ \\ &= f(2x + 1) \\ \\ &= \frac{(2x + 1) + 4}{3(2x + 1) + 2} \\ \\ &= \frac{2x + 5}{6x + 3 + 2} \\ \\ &= \frac{2x + 5}{6x + 5} \end{align} \]

Thus, \((f \circ g)(x) = \frac{2x + 5}{6x + 5}\). From this we determine that the domain of the composite function, \((f \circ g)(x)\), is all real numbers except \(x = -\frac{5}{6}\), or in interval notation \(\left(-\infty,-\frac{5}{6}\right) \cup \left(-\frac{5}{6},\infty\right)\).

Let’s explore the answer to the original question: “Given the two functions \(f(x) = \frac{x+4}{3x+2}\) and \(g(x) = 2x + 1\), find the domain of \((f \circ g)(x)\) using the composite function schematic, which for \((f \circ g)(x)\) is:

From the schematic we see that the first function the input, \(x\), enters is the function \(g(x)\). This means that the input, \(x\), must be valid for \(g(x)\), or said another way, must be in domain of \(g(x)\). So, what is the domain of \(g(x)\)? Since \(g(x)\) is a polynomial, its domain is all real numbers, so there is no input \(x\) that would be invalid for \(g(x)\).

Following the path that the schematic shows, the output of \(g\) becomes the input to the function, \(f(x)\). This means that the output of \(g\), \(g(x)\), must be in the domain of \(f(x)\). So, what is the domain of \(f(x)\)? Well, \(f(x)\) is a polynomial, so its domain, by itself, is all real numbers, but it is in the denominator which means \(3x + 2\) cannot equal zero. What is the value of \(x\) which causes \(3x + 2\) to equal zero? Clearly, \(x \ne \frac{-2}{3}\). So, the domain of \(f(x)\) is all real numbers except \(x = \frac{-2}{3}\)

What this means is that the output of \(g\) must not produce \(\frac{-2}{3}\) for this number would enter \(f\) but is invalid for \(f\) (not in its domain). The question then becomes: What input, \(x\), would cause \(g\) to produce an output of \(\frac{-2}{3}\)? We must find what this input is:

\[ \begin{align} 2x + 1 &= \frac{-2}{3} \\ \\ 2x &= \frac{-2}{3} - 1 \\ \\ 2x &= -\frac{5}{3}\\ \\ x &= -\frac{5}{6} \end{align} \]

Thus, to find the domain of the composite function we would take the intersection of the domain of \(g\) and any input number that would cause \(g(x)\) to produce an output not in the domain of \(f\). Doing this we conclude that the domain of the composite function \((f \circ g)(x)\) is all real numbers except \(x = -\frac{5}{6}\), or in interval notation \(\left(-\infty,-\frac{5}{6}\right) \cup \left(-\frac{5}{6},\infty\right)\).

\(\textbf{Note: This example is explored further in Appendix ??, Composite Functions.}\)


This example again showed that the domain of the composite function can be determined by first finding the composite function and determining its domain, but is there sufficient evidence to definitely conclude that the domain of the composite function itself is the answer to the question, “What is the domain of \((f \circ g)(x)\)?” We will need to continue to methodically explore this.

Before, moving on to another example, it is important to point out that this example also showed how the domain of the composite function can be found using the composite function schematic without having to first find the composite function itself. This is a very important idea.


CONCEPT: The domain of the composite function can be found using the composite function schematic without having to first find the composite function itself.


To continue our quest to determine if the domain of the composite function completely answers the question “What is the domain of \((f \circ g)(x)\)?” in all cases, let’s look at another example.


Example ??.8

Given the two functions \(f(x) = \frac{1}{3}x - 2\) and \(g(x) = \frac{x - 7}{x+6}\), find the domain of \((f \circ g)(x)\).

Solution

First, let’s find the composite function \((f \circ g)(x)\):

\[ \begin{align} (f \circ g)(x) &= f(g(x)) \\ \\ &= f\left(\frac{x - 7}{x+6}\right) \\ \\ &= \frac{1}{3}\left(\frac{x - 7}{x+6}\right) - 2 \\ \\ &= \frac{\frac{1}{3}(x-7) - 2(x + 6)}{x + 6} \\ \\ &= \frac{\frac{1}{3}x - \frac{7}{3} - 2x - 12}{x+6} \\ \\ &= \frac{-\frac{5}{3}x - \frac{43}{3}}{x+6} \end{align} \]

Thus, \((f \circ g)(x) = \frac{-\frac{5}{3}x - \frac{43}{3}}{x+6}\). From this we determine that the domain of the composite function, \((f \circ g)(x)\), is all real numbers except \(x = -6\), or in interval notation \(\left(-\infty,-6\right) \cup \left(-6,\infty\right)\).

Let’s explore the answer to the original question: “Given the two functions \(f(x) = \frac{1}{3}x - 2\) and \(g(x) = \frac{x - 7}{x+6}\), find the domain of \((f \circ g)(x)\) using the composite function schematic, which for \((f \circ g)(x)\) is:

From the schematic we see that the first function the input, \(x\), enters is the function \(g(x)\). This means that the input, \(x\), must be valid for \(g(x)\), or said another way, must be in domain of \(g(x)\). So, what is the domain of \(g(x)\)? It is clear that its domain is all real numbers except \(x = -6\), thus \(x = -6\) is not valid for the composite function. This input would not make it past the function \(g\).

Now what about \(f\)? Well, any other input other that \(x = -6\) is in the domain of \(g\) which means \(g\) would produce the output \(g(x)\). This output, \(g(x)\), now becomes the input to \(f(x)\) which means that the output, \(g(x)\), must be in the domain of \(f\). What is the domain of \(f\)? since \(f(x) = \frac{1}{3}x - 2\) it is a polynomial so its domain is all real numbers. What this means is that there no input value, \(x\), that would cause \(g\) to produce an output, \(g(x)\), that would be invalid for \(f\).

Taking the intersection, therefore, of the invalid inputs to \(g\) (those not in the domain of \(g\), \(x = -6\) in this case) and the input values that would cause \(g\) to produce an output which would be invalid for \(f\) (there aren’t any in this case) we can conclude that the domain of the composite function, \((f \circ g)(x)\), all real numbers except \(x = -6\), or in interval notation \(\left(-\infty,-6\right) \cup \left(-6,\infty\right)\).

This again matched that of the domain of the composite function itself. Are we safe to conclude that the answer to the question, “Can the domain of \((f \circ g)(x)\) be found just by finding the domain of the composite function?” Not quite.


Before going any further, let’s recap. The above two examples taught us some things. First that the composite schematic is an excellent tool available for finding the domain of a composite function. It eliminates the need to first find the composite function itself. Second, that one has to consider what are the valid inputs (i.e., the domain) of the first function in the composite chain (\(g\) in this case) along what are the inputs to the composite function which would cause the first function in the composite chain (\(g\) in this case) to produce output which are invalid to the second function in the composite chain (\(f\) in this case). The taking of the intersection of these limitations results in the domain of the composite function.


CONCEPT: The domain of the composite function is the intersection of the inputs invalid for the first function in the composite chain and the inputs which would cause the first function to produce outputs which are invalid for the second function in the composite chain.


Now let’s consider this last example which, hopefully, will answer the question “Can the domain of \((f \circ g)(x)\) be found just by finding the domain of the composite function?”


Example ??.9

Given the two functions seen in examples ??.3 and ??.4: \(f(x) = \frac{x-2}{3x+1}\) and \(g(x) = \frac{x+1}{x-1}\), find the domain of \((f \circ g)(x)\).

Solution

It was determined in the examples ??.3 and ??.4 that the composite function \((f \circ g)(x)\) was \((f \circ g)(x) = \frac{-x+3}{4x+2}\). Using the composite function only, the immediate response to the question what is the domain of \((f \circ g)(x)\) would be that the domain is all real numbers except \(x = -\frac{1}{2}\), or \(\left(-\infty,-\frac{1}{2}\right) \cup \left(-\frac{1}{2},\infty\right)\).

Now let’s use the composite function schematic and the lessons learned from the previous examples. For convenience, here is the composite function schematic:

From the schematic we see that the first function the input, \(x\), enters is the function \(g(x)\). This means that the input, \(x\), must be valid for \(g(x)\), or said another way, must be in domain of \(g(x)\). So, what is the domain of \(g(x)\)? It is clear that its domain is all real numbers except \(x = 1\), thus \(x = 1\) is not valid for the composite function. This input would not make it past the function \(g\).

Now what about \(f\), the second function in the composite function chain. It is clear that its domain is all real numbers except \(x = -\frac{1}{3}\). What this means, is that the output of \(g\), \(g(x)\), cannot produce an output of \(g(x) = -\frac{1}{3}\). So, the question then becomes, what \(x\) (the input) would cause \(g\) to produce the output \(g(x) = -\frac{1}{3}\)? We can find the answer to this question algebraically:

\[ \begin{align} \frac{x+1}{x-1} &= -\frac{1}{3} \\ x + 1 &= -\frac{1}{3}(x - 1) \\ x + 1 &= -\frac{1}{3}x + \frac{1}{3} \\ x + \frac{1}{3}x &= \frac{1}{3} - 1 \\ \frac{4}{3}x &= -\frac{2}{3} \\ x &= -\frac{2}{3}\left(\frac{3}{4}\right) \\ x &= -\frac{1}{2} \end{align} \]

Taking the intersection of these two limitations, \(x \ne -\frac{1}{2}\) and \(x \ne 1\), we conclude that the domain of the composite function is all real numbers except \(x = -\frac{1}{2}\) and \(x - 1\), or in interval notation \(\left(-\infty,-\frac{1}{2}\right) \cup \left(-\frac{1}{2},1\right) \cup \left(1,\infty\right)\).

Notice something interesting here? The domain of the composite function itself, \((f \circ g)(x) = \frac{-x+3}{4x+2}\), was found to be \(\left(-\infty,-\frac{1}{2}\right) \cup \left(-\frac{1}{2},\infty\right)\). Yet when we used the composite function schematic it was seen that the domain actually was \(\left(-\infty,-\frac{1}{2}\right) \cup \left(-\frac{1}{2},1\right) \cup \left(1,\infty\right)\). See the difference? The value \(x = 1\) was missed when looking just at the composite function itself!

Why is this? When we consider just the composite function itself to determine the domain of the composite function as a whole, we are looking only at the input values which would cause \(g\) to produce an output, \(g(x)\), which would be invalid for \(f\). In this case, there is only one input value, \(x = -\frac{1}{2}\). This caused \(g\) to produce the output \(g\left(-\frac{1}{2}\right) = -\frac{1}{3}\) which is not in the domain of \(f\). This is captured in finding the domain of the composite function itself (all real numbers except \(x = -\frac{1}{2}\)).

All this is fine except by just looking at the domain of the composite function itself, we were working just considering the output of \(g\). In other words, we were making the assumption that \(g\) itself would always produce an output. That is what is being missed. It may not. We also have to consider any value of the input which would be invalid for \(g\) to begin with. In this case, it was \(x = 1\). This is the key message.

The curious and observant student might say wait a minute, \((f \circ g)(x)\) evaluated at \(x = 1\) has a solution:

\[ \begin{align} (f \circ g)(1) &= \frac{-(1) + 3}{4(1) + 2} \\ &= \frac{2}{6} = \frac{1}{3} \end{align} \]

And it does, at least as far as this algebra would seem to indicate. The problem, however, is that \((f \circ g)(1) = f(g(1))\) which means that the value \(x = 1\) must be valid for \(g\), which it is not as the following composite schematic clearly shows:


Let’s summarize the above examples:

  • Example ??.6: The domain of the computed composite function was indeed the true domain of the composite function. This was because the domains of \(g\) and \(f\) were all real numbers so there were no domain restrictions imposed by either \(g\) or \(f\).
  • Example ??.7: The domain of the computed composite function was indeed the true domain of the composite function. This was because the domain of \(g\) was all real numbers. (Note, this example, as in the subsequent ones, show how powerful the composite function schematic is to find the domain of the composite function without first having to find the composite function itself!)
  • Example ??.8: The domain of the computed composite function was indeed the true domain of the composite function. This was because the domain of \(f\) was all real numbers. The restriction imposed by \(g\)’s domain was not lost in the algebraic computation of the composite function.
  • Example ??.9: The domain of the computed composite function was only partially correct. The restriction imposed by \(g\)’s domain was lost in the algebraic computation of the composite function. This cannot be ignored. The true domain of the composite function is the intersection of the domain of \(g\) and the input values that would cause \(g\) to produce an output that is not in the domain of \(f\).

CONCEPT: The true domain of the composite function is the intersection of the domain of \(g\) and the input values that would cause \(g\) to produce an output that is not in the domain of \(f\). The understanding of the composite function schematic makes this absolutely clear.


Based on the above discussion, we can establish the following procedure to find the true domain of the composite function \((f \circ g)(x)\):

  • First find the domain of the two functions, \(g\) and \(f\), individually.
  • Any limitations on the domain of \(g\) are also limitations on the domain of \((f \circ g)(x)\).
  • Algebraically determine what input values would cause \(g\) to produce an output, \(g(x)\), that is not in the domain of \(f\).
  • Take the intersection of these limitations to produce the true domain of \((f \circ g)(x)\).

Though having a process might be useful to some, having a thorough understand of the composite function schematic makes having a procedure completely unnecessary.


All of the above examples looked at \((f \circ g)(x)\). Though it is exactly the same thought process, an example of \((g \circ f)(x)\) is presented.


Example ??.10

Given the two, \(f(x) = \frac{-4x + 3}{2x - 5}\) and \(g(x) = \frac{3x - 1}{-x + 4}\), find the domain of \((g \circ f)(x)\).

Solution

We will first find the composite function \((g \circ f)(x)\):

\[ \begin{align} (g \circ f)(x) &=g\left(f(x)\right) \\ \\ &= g\left(\frac{-4x + 3}{2x - 5}\right) \\ \\ &= \frac{3\left(\frac{-4x + 3}{2x - 5}\right)-1}{-\left(\frac{-4x + 3}{2x - 5}\right)+4} \\ \\ &= \frac{\frac{3(-4x + 3) - (2x-5)}{2x-5}}{\frac{-(-4x+3) + 4(2x-5)}{2x-5}} \\ \\ &= \frac{-12x + 9 - 2x + 5}{4x - 3 + 8x - 20} \\ \\ &= \frac{-14x + 14}{12x - 23} \end{align} \]

Thus, \((g \circ f)(x) = \frac{-14x + 14}{12x - 23}\). The domain of the composite function based on this is all real numbers except \(x = \frac{23}{12}\), or in interval notation, \(\left(-\infty,\frac{23}{12}\right) \cup \left(\frac{23}{12},\infty\right)\).

Now let’s use the composite function schematic and the lessons learned from the previous examples. For convenience, here is the composite function schematic:

The domains of the individual functions are: domain of \(f\) is all real numbers except \(x = \frac{5}{2}\); the domain of \(g\) is all real numbers except \(x = \frac{5}{2}\). So, right away we know that the domain of the composite function has to include the fact that the input, \(x\), cannot equal 4. We also now know the output of \(f\) cannot produce a number that is not in the domain of \(g\), thus \(f(x) \ne 4\). Solving for the value of \(x\) algebraically:

\[ \begin{align} \frac{-4x + 3}{2x - 5} &= 4 \\ -4x + 3 &= 4(2x-5) \\ -4x + 3 &= 8x - 20 \\ -12x &= -23 \\ x &= \frac{23}{12} \end{align} \]

Thus \(x = \frac{23}{12}\) must be excluded from the domain of the composite function. Taking the intersection of this limitation with the limitation that \(x\) cannot equal \(\frac{5}{2}\), the true domain of the composite function \((g \circ f)(x)\) is \(\left(-\infty,\frac{23}{12}\right) \cup \left(\frac{23}{12},\frac{5}{2}\right) \cup \left(\frac{5}{2},\infty\right)\). The fact that \(x = \frac{5}{2}\) needed to be excluded from the domain was missed by just finding the domain of the composite function itself.


All of the functions consider thus far included polynomials, whether it be the function itself or its components being polynomials. It is worth briefly exploring what if this was not the case.


Example ??.11

Given the two functions, \(f(x) = \frac{1}{x - 2}\) and \(g(x) = \sqrt{x + 4}\), find the domain of \((f \circ g)(x)\).

Solution

We will first find the composite function \((f \circ g)(x)\):

\[ \begin{align} (f \circ g)(x) &=f\left(g(x)\right) \\ \\ &= f\left(\sqrt{x + 4}\right) \\ \\ &= \frac{1}{\sqrt{x + 4} - 2} \end{align} \]

Thus, \((f \circ g)(x) = \frac{1}{\sqrt{x + 4} - 2}\). To find the domain of the composite function we must consider two things: first that what we are taking the square root of cannot be zero; and second that the denominator cannot be zero. For the first, this means that \(x + 4 \ge 0\), or \(x \ge -4\). For the second this means:

\[ \begin{align} \sqrt{x + 4} - 2 &= 0 \\ \sqrt{x + 4} &= 2 \\ x + 4 &= 4 \\ x &= 0 \end{align} \]

Combining these two conditions, we get the domain to be all real numbers greater than or equal to -4 except 0. In interval notation this would be \([-4,0) \cup (0,\infty)\).

Now, let’s use the composite function schematic for \((f \circ g)(x)\):

As usual, we know that the input, \(x\), must be valid for the first function in the chain, \(g\). What is the domain of \(g\)? Since \(g(x) = \sqrt{x + 4}\), the domain would be all real numbers greater than or equal to -4.In interval notation this is \([-4,\infty)\). Following the path that an input would take, we know that the output of \(g\) cannot produce a number that is not in domain of \(f\). What is the domain of \(f\). It is clear that that the domain of \(f\) is all real numbers except 2. That is, \(x \ne 2\). So what would the input be that would cause \(g\) to produce an ouput of 2:

\[ \begin{align} \sqrt{x + 4} &= 2 \\ x + 4 &= 4 \\ x &= 0 \end{align} \]

Combining these two limitations together we get the domain of the composite function to be all real numbers greater than or equal to -4 except 0. In interval notation this would be \([-4,0) \cup (0,\infty)\), which is what was found above.

Two things to note: In this case the domain of the composite itself matched that found by using the composite function schematic, but as we have seen this may or may not be the true domain. Second, the finding of the domain using the composite function schematic was (much) easier than finding the domain of the composite function itself (or least that is the author’s opinion).


One final example to complete this section.


Example ??.12

Given the two functions, \(f(x) = \sqrt{x + 2}\) and \(g(x) = \sqrt{3 - x}\), find the domain of \((f \circ g)(x)\).

Solution

The solution will be found only via the use of the composite function schematic for \((f \circ g)(x)\):

As usual, the input, \(x\), goes into the first function in the chain, \(g\), which means it must be in the domain of \(g\). What is the domain of \(g\)?

\[ \begin{align} 3 - x &\ge 0 \\ -x &\ge -3 \\ x &\le 3 \end{align} \]

Thus, the domain of \(g\) is \((-\infty,3]\). The thing to note here is that for any \(x\) in the domain of \(g\), the output of \(g\) will always be zero or positive for that was the condition used to determine the domain.

We also know that \(g\) must produce an output that is valid for \(f\). What is the domain of \(f\)?

\[ \begin{align} x + 2 &\ge 0 \\ x &\ge -2 \end{align} \]

So, any output of \(g\) that is greater than or equal to \(-2\) is valid for \(f\). Well, as was indicated above, any input valid for \(g\) will always produce an output of zero or greater. This means, therefore, that no matter what the input is to the composite function, as long as its valid for \(g\), will produce an output valid for \(f\). The domain of the composite function, then, is all real numbers less than or equal to 3, or in interval notation \((\infty,3]\).


Return To Table Of Contents

??.6 The Composite Function Of More Than Two Functions

All of the examples presented thus far have concerned a composite function composed of only two functions. The thorough understanding of what a composite function is, how to find it, and how it works, easily transfers to composite functions composed of more than two functions. For example, if there were \(n\) functions, \(f_{1}, f_{2}, \cdots, f_{n-1},f_{n}\), then we could form the composite function, \((f_{n} \circ f_{n-1} \circ \cdots \circ f_{2} \circ f_{1})(x)\), or \((f_{n}(f_{n-1}(\cdots f_{2}(f_{1}(x))))(x)\). Note, this is just but one way these \(n\) functions could be combined.

In this section, however, we will limit our discussion to composite functions composed of three functions, \(f(x)\), \(g(x)\), and \(h(x)\). These three functions can be combined in any order so long as the output of one becomes the input to the next function in the composite function chain. As is the case with the composite function of just two functions, the composite function of one combination most likely will not equal the composite function of another combination.

For the three functions, \(f(x)\), \(g(x)\), and \(h(x)\), let’s focus on the composite function \((f \circ g \circ h)(x)\). This newly formed function, \((f \circ g \circ h)(x)\), given an input, \(x\), will produce the mapping \((x,(f \circ g \circ h)(x))\). And here is the composite function schematic for \((f \circ g \circ h)(x)\):


Example ??.13

Given the three functions, \(f(x) = x^{2} - x + 1\), \(g(x) = 2x+3\), and \(h(x) = x - 1\) find the composite function \((f \circ g \circ h)(x)\).

Solution

As composite function schematic for \((f \circ g \circ h)(x)\) showed,

\[ (f \circ g \circ h)(x) = f(g(h(x))) \]

The first thing that needs to be found is \(g(h(x))\):

\[ \begin{align} g(h(x)) &= g(x - 1) \\ &= 2(x - 1) + 3 \\ &= 2x - 2 + 3 \\ &= 2x + 1 \end{align} \]

Now that we have \(g(h(x))\), which is the input to \(f(x)\), we can find \(f(g(h(x)))\):

\[ \begin{align} f(g(h(x))) &= f(2x + 1) \\ &= (2x + 1)^{2} - (2x + 1) + 1 \\ &= 4x^{2} + 4x + 1 - 2x - 1 + 1 \\ &= 4x^{2} + 2x + 1 \end{align} \]

Thus, \((f \circ g \circ h)(x) = 4x^{2} + 2x + 1\).


As this example showed, the finding of the composite function of more than two functions is no different than that for just two functions. It just has a deeper nesting of functions chained together, with any one function being evaluated at the output of the one before it in the chain.


CONCEPT: The finding of the composite function of more than two functions is no different than that for just two functions. It just has a deeper nesting of functions chained together, with any one function being evaluated at the output of the one before it in the chain.


As is always the case, we are often interested in knowing what any function’s output would be for a given input, \(x\). This is no different than what we’ve seen before. Let’s explore how this would work for the composite function found in the above example, Example ??.13.


Example ??.14

Given the three functions, \(f(x) = x^{2} - x + 1\), \(g(x) = 2x+3\), and \(h(x) = x - 1\) find \((f \circ g \circ h)(1)\).

Solution

As we’ve seen many times, the first way to answer the question what is \((f \circ g \circ h)(1)\) is to evaluate the composite function itself. We know that the composite function \((f \circ g \circ h)(x) = 4x^{2} + 2x + 1\), so we can simply evaluate it at \(x = 1\):

\[ \begin{align} (f \circ g \circ h)(1) &= 4(1)^{2} + 2(1) + 1 \\ &= 4 + 2 + 1 \\ &= 7 \end{align} \]

Thus, \((f \circ g \circ h)(1) = 7\) with a mapping of \((1,7)\).

The alternative way to answer the question is to use the composite function schematic directly which, as we know, would not require knowing the actual composite function itself. Here is the composite function schematic for \((f \circ g \circ h)(x)\) when the input is \(x = 1\):

So, the first thing we need to do is find \(h(1)\) where \(h(x) = x - 1\):

\[ \begin{align} h(1) &= (1) - 1 \\ &= 0 \end{align} \]

Following the path through the composite function schematic, this output of \(h\), \(h(1) = 0\), now becomes the input to the function \(g\). So, now we need to find \(g(0)\) where \(g(x) = 2x+3\):

\[ \begin{align} g(0) &= 2(0) + 3 \\ &= 3 \end{align} \]

Continuing along the path, this output of \(g\), \(g(0) = 3\), now becomes the input to the function \(f\). Let’s see what that output would be for \(f(x) = x^{2} - x + 1\):

\[ \begin{align} f(3) &= (3)^{2} - (3) + 1 \\ &= 9 - 3 + 1 \\ &= 7 \end{align} \]

Thus, using the composite function schematic only we found that for \(x = 1\), the output of the composite function is \((f \circ g \circ h)(1) = 7\) and has a mapping of \((1,7)\).

This is the same answer that was found when we first found the composite function itself and then evaluated it at \(x = 1\), as it should be.


As this example showed, the evaluation of a composite function of more than two functions at a particular input, \(x\), is no different than for two functions. The actual composite function can be found first, then it can be evaluated at the specified input value. Or the composite function schematic can be used without the need to have ever found the actual composite function. As the depth of functions increases in the composite function, the use of the composite function schematic to find the output for a given input is the preferred way, at least in this author’s opinion, for the finding of the composite function can be challenging.


CONCEPT: The evaluation of a composite function of more than two functions at a particular input, \(x\), is no different than for two functions, find the composite function first or use the composite function schematic. As the depth of functions increases in the composite function, the use of the composite function schematic to find the output for a given input is the preferred way for the finding of the composite function can be challenging.


Now, let’s look at a more detailed example of not only finding the composite function but also finding the domain of a composite function formed by the composition of three functions.


Example ??.15

Given the three functions, \(f(x) = \frac{x+3}{x-2}\), \(g(x) = \frac{x-1}{x-3}\), and \(h(x) = \frac{x-4}{x+5}\) find \((f \circ g \circ h)(x)\), the function \((f \circ g \circ h)(x)\) evaluated at \(x = -1\), and the domain of \((f \circ g \circ h)(x)\).

Solution

Let’s find the composite function itself, \((f \circ g \circ h)(x) = f(g(h(x)))\). First, we need to find \(g(h(x))\):

\[ \begin{align} g(h(x)) &= g\left(\frac{x-4}{x+5}\right) \\ \\ &= \frac{\left(\frac{x-4}{x+5}\right) - 1}{\left(\frac{x-4}{x+5}\right) - 3} \\ \\ &= \frac{\frac{x-4 - (x+5)}{x+5}}{\frac{x-4 - 3(x+5)}{x+5}} \\ \\ &= \frac{\frac{x-4-x-5}{x+5}}{\frac{x-4-3x-15}{x+5}} \\ \\ &= \frac{-9}{-2x-19} \end{align} \]

Now that we know that \(g(h(x)) = \frac{-9}{-2x-19}\), we can proceed to find \(f(g(h(x)))\), the composite function itself.

\[ \begin{align} f(g(h(x))) &= f\left(\frac{-9}{-2x-19}\right) \\ \\ &= \frac{\left(\frac{-9}{-2x-19}\right) + 3}{\left(\frac{-9}{-2x-19}\right)- 2} \\ \\ &= \frac{\frac{-9 + 3(-2x-19)}{-2x - 19}}{\frac{-9 - 2(-2x -19)}{-2x-19}} \\ \\ &= \frac{-9 - 6x - 57}{-9 + 4x + 38} \\ \\ &= \frac{-6x - 66}{4x + 29} \end{align} \]

Thus, the composite function formed by the composition of these three function in such a way that the output of \(h\) becomes the input to \(g\) whose output then becomes the input to \(f\) is \((f \circ g \circ h)(x) = \frac{-6x - 66}{4x + 29}\).

To find what the composite function’s value would be when evaluated at \(x = -1\), we can use the composite function itself:

\[ \begin{align} (f \circ g \circ h)(-1) &= \frac{-6(-1) - 66}{4(-1) + 29} \\ &= \frac{-60}{25} = -\frac{12}{5} \end{align} \]

Thus, \((f \circ g \circ h)(-1) = -\frac{12}{5}\) with the mapping \(\left(-1,-\frac{12}{5}\right)\).

The alternative way to answer the question, what is \((f \circ g \circ h)(-1)\), would have been to use the composite function schematic, which, of course, would have not required the first finding of the composite function itself:

Following the path that the input, \(x = -1\), we first have to find \(h(-1)\):

\[ \begin{align} h(-1) &= \frac{(-1) - 4}{(-1)+5} = -\frac{5}{4} \end{align} \]

This output of \(h(-1)\) then becomes the input to \(g\), meaning that we have to find \(g\left(-\frac{5}{4}\right)\):

\[ \begin{align} g(h(-1)) &= g\left(-\frac{5}{4}\right) \\ \\ &= \frac{\left(\frac{-5}{4}\right) - 1}{\left(\frac{-5}{4}\right) - 3} \\ &= \frac{\frac{-5 - 4}{4}}{\frac{-5 - 3(4)}{4}} \\ &= \frac{\frac{-9}{4}}{\frac{-17}{4}} = \frac{9}{17} \end{align} \]

This output of \(g(h(-1))\) now becomes the input to \(f\), thus allowing us to find \(f(g(h(-1)))\):

\[ \begin{align} f(g(h(-1))) &= f\left(\frac{9}{17}\right) \\ \\ &= \frac{\left(\frac{9}{17}\right) + 3}{\left(\frac{9}{17}\right) - 2} \\ \\ &= \frac{\frac{9 + 3(17)}{17}}{\frac{9 - 2(17)}{17}} \\ \\ &= \frac{60}{-25} = -\frac{12}{5} \end{align} \]

Using the composite function schematic only we found that \((f \circ g \circ h)(-1) = -\frac{12}{5}\) with the mapping \(\left(-1,-\frac{12}{5}\right)\). The answer we got by first finding the composite function itself \((f \circ g \circ h)(x) = \frac{-6x - 66}{4x + 29}\) and then evaluating it at \(x = -1\) was \(-\frac{12}{5}\). The two answers match, as they should.

Granted, this problem did ask to find the composite function \((f \circ g \circ h)(x)\) so once it was known, evaluating it at \(x = -1\) was no big deal. But, it is obvious (or should be) that had we not been asked to find the composite function, \((f \circ g \circ h)(x)\), and only asked to find \((f \circ g \circ h)(-1)\), using the composite function schematic was much simpler (and perhaps less error prone).

Now on to finding the domain of \((f \circ g \circ h)(x)\).

Given that \((f \circ g \circ h)(x) = \frac{-6x - 66}{4x + 29}\) our first assumption might be that the domain of \((f \circ g \circ h)(x)\) is all real numbers except \(x = -\frac{29}{4}\), but as we now know, that might not be the whole story. Let’s look at the composite function itself as seen through the lens of the composite function schematic:

The first thing we should do is find what the domains are of each of the three individual functions, \(f\), \(g\), and \(h\), which make up the composite function \((f \circ g \circ h)(x)\). Using the notation \(D_{F}\) to indicate the domain of the function, \(F\), we find:

\[ \begin{align} D_{f} &: \text{all real numbers except } x = 2 \\ D_{g} &: \text{all real numbers except } x = 3 \\ D_{h} &: \text{all real numbers except } x = -5 \\ \end{align} \]

Now, let’s follow the path that the input, \(x\), takes. It is clear that the input, \(x\), first enters the function, \(h\), which means that it must be valid for the function \(h\). Therefore the domain of the composite function must include the fact that \(x\) cannot equal \(-5\).

Following the path, the output of \(h\), \(h(x)\), then enters the function \(g\). This means that \(h\) cannot produce an output of \(3\) for that would be invalid for \(g\). We need to determine what input, \(x\), would cause \(h\) to produce an output of \(3\); that is when \(h(x) = 3\):

\[ \begin{align} h(x) &= 3 \\ \frac{x-4}{x+5} &= 3 \\ x-4 &= 3(x+5) \\ x- 4 &= 3x + 15 \\ x - 3x &= 15 + 4 \\ -2x &= 19 \\ x &= -\frac{19}{2} \end{align} \]

Thus, the domain of the composite function must include the fact that \(x\) cannot equal \(-\frac{19}{2}\).

The last part of the path through the composite function schematic is that the output of \(g\), \(g(h(x))\), enters the function \(f\). This means that the output of \(g\) cannot produce an output that would be invalid for \(f\); that is when \(g(h(x)) = 2\). We need to determine what input, \(x\), would cause \(g(h(x))\) to produce a \(2\). To begin to answer this question, we first need to determine what input to \(g\) would cause it to output a \(2\):

\[ \begin{align} g(x) &= 2 \\ \frac{x-1}{x-3} &= 2 \\ x- 1 &= 2(x-3) \\ x - 1 &= 2x - 6 \\ x - 2x &= -6 + 1 \\ -x &= -5 \\ x &= 5 \end{align} \]

This tells us that \(g\) cannot receive an input of \(5\), which then begs the question, what input to \(h\) would cause it to output a \(5\):

\[ \begin{align} h(x) &= 5 \\ \frac{x-4}{x+5} &= 5 \\ x - 4 &= 5(x+5) \\ x - 4 &= 5x + 25 \\ x - 5x &= 25 + 4 \\ -4x &= 29 \\ x &= -\frac{29}{4} \end{align} \]

Thus, the domain of the composite function must include the fact that \(x\) cannot equal \(-\frac{29}{4}\). This value of \(x = -\frac{29}{4}\) is, of course, the value of the input which was not in the domain of \((f \circ g \circ h)(x)\) we found above!! So, now we need to take the intersection of all these exclusions to the domain of \((f \circ g \circ h)(x)\) we found by analyzing the path that the input \(x\) took through the composite function schematic which are:

\[ \begin{align} \text{all real numbers except } x &= -5 \\ \text{all real numbers except } x &= -\frac{19}{2}\\ \text{all real numbers except } x &= -\frac{29}{4} \\ \end{align} \]

Thus, the domain of \((f \circ g \circ h)(x)\), in interval notation, is \(\left(-\infty,\frac{-19}{2}\right) \cup \left(\frac{-19}{2},\frac{-29}{4}\right) \cup \left(\frac{-29}{4},-5\right) \cup \left(-5,\infty\right)\)

\(\textbf{Note: This example is explored further in Appendix ??, Composite Functions.}\)


The above examples showed that the finding of a composite function of more than two functions algebraically is no different than that for a composite function of only two functions. That said, the algebra involved will be more involved as the number of functions increases, but the process is the same. The evaluation of a composite function of more than two functions at a particular input value, \(x\), is also no different. Once the composite function itself is found, it can be evaluated at the particular input value. Or, and perhaps the simpler way especially as the number of functions increases, the composite function schematic can be used by following the path taken through the schematic (chain) a particular input value, \(x\), takes. And, finally, the finding of the domain of a composite function of more than two functions has the same logical thought process as that of a composite function with only two functions. The domain of the composite function itself will most likely not tell the whole story. The composite function schematic is the recommended way to be sure that all inputs that effect the domain are discovered. This last detail leads to the last concept of this section.


CONCEPT: The finding of the domain of a composite function of more than two functions. The domain of the composite function itself will most likely not tell the whole story. The composite function schematic is the recommended way to be sure that all inputs that effect the domain are discovered.


It is highly recommended that the student become intimately familiar with all the concepts presented, discussed, and shown examples of, in this section


Return To Table Of Contents

??.7 Decomposing A Composite Function

This chapter has, up to this point, been concerned about the conceptual understanding, the finding and evaluating, and the finding of the domain of a composite function of two or more functions. This section will present the idea of, if given a function, decompose it into simpler functions, if possible. The ability to recognize a function is actually a composite function and to decompose it into two simpler functions will prove quite useful in upper level mathematics, especially calculus.

To explore this idea, consider the composite function of the two functions, \(f(x)\) and \(g(x)\), This is the function \((f \circ g)(x) = f(g(x))\). Looking at \(f(g(x))\) it is clear that of the two functions, \(f\) and \(g\), \(f\) is the function being evaluated at the function \(g(x)\). The function, \(g\), can be thought of as being inside the function \(f\). For this reason \(g\) is oft-times referred to as the inner function and \(f\) is referred to as the outer function of the composite function \((f \circ g)(x) = f(g(x))\). So, if we have a function, \(h(x) = (f \circ g)(x)\) we want to find the two individual functions, \(f(x)\) and \(g(x)\) such that \(h(x) = f(g(x))\).


CONCEPT: The composite function \(f(g(x))\) can be thought of as having an inner function, \(g(x)\) and an outer function, \(f(x)\). This is a helpful idea in the decomposition of a composite function.


Let’s explore a simple example.


Example ??.16

Given \(f(x) = (x - 2)^{2}\), decompose it into simpler functions.

Solution:

To accomplish this, it must be first recognized that the function, \(f(x)\), is actually a composite function. Once recognized as such, we want to determine what the individual functions are that, when put together, form the composite function, \(f(x)\).

Looking at \(f(x) = (x - 2)^{2}\), it is clear that the quantity \(x - 2\) is being squared. We can represent this quantity as the function \(g(x) = (x-2)\). Since this quantity (function) is being squared, \(g(x)\), is the inner function to another function that is actually doing the squaring. If we let this other function be \(h(x) = x^{2}\), then it is clear that \(h(g(x)) = h(x - 2) = (x-2)^{2}\).

Thus, the function \(f(x) = (x - 2)^{2}\) can be decomposed into the inner function, \(g(x) = x-2\), and the outer function, \(h(x) = x^{2}\).


Consider the following example which illustrates an interesting point.


Example ??.17

Given \(f(x) = \sqrt{x-3} - 10\), decompose it into simpler functions.

Solution:

At first glance we could let \(g(x) = x-3\) and \(h(x) = \sqrt{x} - 10\). Thus \(f(x) = h(g(x)) = h(x-3) = \sqrt{x-3} - 10\). Thus, the function \(f(x) = \sqrt{x-3} - 10\) can be decomposed into the inner function, \(g(x) = x-3\), and the outer function, \(h(x) = \sqrt{x} - 10\).

An alternative solution could be to let \(g(x) = \sqrt{x-3}\) and \(h(x) = x - 10\). Then \(f(x) = h(g(x)) = h(\sqrt{x-3}) = \sqrt{x-3} - 10\). Thus, the function \(f(x) = \sqrt{x-3} - 10\) can be decomposed into the inner function, \(g(x) = \sqrt{x-3}\), and the outer function, \(h(x) = x - 10\).


This example shows that there may be more than one way to decompose a composite function. The idea, however, is to find the one solution that produces the two functions in their simpler form that best serves the intended purpose.

This last example shows that little thought might be required.


Example ??.18

Given \(f(x) = (x + 4)^{2} - 3(x+4) - 5\), decompose it into simpler functions.

Solution:

We let \(g(x) = x+ 4\) and \(h(x) = x^{2} - 3x -5\). Thus \(f(x) = h(g(x)) = h(x+4) = (x + 4)^{2} - 3(x+4) - 5\). Thus, the function \(f(x) = (x + 4)^{2} - 3(x+4) - 5\) can be decomposed into the inner function, \(g(x) = x + 4\), and the outer function, \(h(x) = x^{2} - 3x -5\).


Return To Table Of Contents

??.8 Why You Should Care

In this Why You Should Care we will venture into the world of Artificial Intelligence (AI) and, in particular, neural networks to see how what we learned in this chapter is very relevant to one of the emerging technologies of the day.

Composite functions play an important role in mathematics, thus the understanding of, and the ability to work with, them is crucial. Besides being at the heart of one the most fundamental differentiation rules in calculus, the chain rule, composite functions are vital to many real world applications or technologies. An example of such a technology which is in vogue today is AI (Artificial Intelligence) in general, and neural networks in particular.

Though it would be impossible to discuss neural networks in depth here, the following diagram provides good intuitive insight into a neural network.

A neural network is, in essence, nothing more than a collection of nodes, or neurons, organized into layers and which are fully connected to every other neuron in a previous and subsequent layer. The term neuron is meant to have an association with the structure of the brain which consists of neurons. The connections between the neurons are loosely equivalent to the synapses which connect the neurons in the brain. In a neural network, these connections are assigned weights. Within each neuron is an activation function which determines how, or if, a neuron will fire, again an analogy to the understanding of how the brain works. The weights of the connections going into a node, along with the specific activation function used, play a significant role in the output of the node, or the firing of the neuron. There is also a bias term that is an input to each node. The bias term also plays a role in the firing of a neuron. There is a long history behind neural networks, complete with just how true it is to say that such a network does indeed model the brain. The history and the relevance to the workings of the brain are quite fascinating and will not be presented here, yet for the curious student it is truly worth reading about.

The role of composite functions in neural networks cannot be over stated. To get a sense of why this is true, please see Appendix ??, Neural Networks which contains relevant excerpts of the research paper Introduction To AI and Neural Networks; The Mathematics, Model Implementation, And The Universal Approximation Theorem1 authored by myself and two of my students, Kaelynn Jackson and Lily Patullo, in 2025, which speaks to the idea that a neural network is basically one big composite function.

After reading Appendix ??, Neural Networks you will, without doubt, see how exciting it is that the mathematics you are studying play such an important role in current technologies such as neural networks and, by extension, AI!

That is Why You Should Care!


Return To Table Of Contents

??.9 Chapter Review

Composite functions play an important role in mathematics, thus the understanding of, and the ability to work with, them is crucial. Besides being at the heart of one the most fundamental differentiation rules in calculus, the chain rule, composite functions are vital to many real world applications or technologies.

This chapter presented an in depth look at composite functions which are a very powerful way to combine two or more functions together. The composition of two or more functions is the second of two ways to combine two or more functions together. The first was the arithmetic combination of two or more functions was studied in the previous chapter. It is important to understand the main difference between these two ways. In the arithmetic combination of functions the input \(x\), goes into each function simultaneously and the outputs of each are combined under the specified arithmetic operation. For a composite function, the input, \(x\), only goes into the first function in the chain of functions where the output of a function in the chain becomes the input to the next function in the chain.

To really understand how composite functions work and to discern their characteristics such as domains, it is imperative to understand the composite function schematic. The composite function schematic can be used directly to evaluate the composite function at given input value without first finding what actual composite function. And perhaps more importantly, the use of the composite function schematic reveals the true domain of the composite function, which can be often missed when just finding the domain of the composite function itself. Given the importance of the composite function schematic, it is worth restating them again.

For two functions, \(f(x)\) and \(g(x)\), the composite function schematics for \((f \circ g)(x)\) and \((g \circ f)(x)\) are:

For three functions, \(f(x)\), \(g(x)\), and \(h(x)\), the composite function schematic for \((f \circ g \circ h)(x)\), just one way to combine these three functions, is:

A composite function is indeed a function, which therefore implies that it shares the same attributes of a function. One such attribute is that a composite function maps an input, \(x\), to a unique output. For the composite function, \((f \circ g)(x)\), the mapping would be \((x,(f \circ g)(x))\). Another, of course, is that a composite function has a domain which, as was seen, needs to take into account the domains of the individual functions of the chain of functions making up the composite function (again, the composite function schematic is the best tool to use to find the domain). And, finally, the finding of the actual composite function, \((f \circ g)(x))\) in a two function case or \((f \circ g \circ h)(x)\) in a three function case, is an exercise in function evaluation and can require strong algebraic skills.


??.10 Exercises


Return To Table Of Contents


.

Chapter ??

Inverse Functions

In this chapter we will explore inverse functions which, in my most humble opinion, are very important yet tend to be overlooked and/or brushed over. An inverse function has a unique relationship to another function, yet, interestingly, not every function has an inverse. This chapter will explore this idea along with how to find an inverse function to a given function if it has one, along with many other important concepts. But first, let’s begin by getting a general sense of what an inverse function is.

??.1 Function / Inverse Function Mappings

To get an initial sense of what an inverse function is, consider this simple scenario that most should be familiar with.

Here in the United States we measure temperature in degrees Fahrenheit, \(^{o}F\). In many other countries, temperature is measured in degrees Celsius, , \(^{\circ}C\). This can be problematic if, say, you are planning to visit one of those countries and need to interpret what it means when you hear that the temperature is \(25^{\circ}C\). Fortunately, there is a (simple) formula to make the conversion from degrees Celsius to degrees Fahrenheit:

\[ ^{o}F = \frac{9}{5}(^{\circ}C) + 32 \]

Using this formula you can covert \(25^{\circ}C\) to degrees Fahrenheit:

\[ \begin{align} ^{\circ}F &= \frac{9}{5}(^{\circ}C) + 32 \\ &= \frac{9}{5}(25) + 32 \\ &= 45 + 32 \\ &= 77 \end{align} \]

Thus, 25 degrees Celsius is 77 degrees Fahrenheit. Let’s look at this formula as a function. If we let \(x\) be the temperature in degrees Celsius, then we can define a function, \(F(x) = \frac{9}{5}x + 32\) as the function which, when given a temperature in degrees Celsius, outputs the equivalent temperature in degrees Fahrenheit. As we all know, a function maps an input to a unique output. The mapping, therefore, for this function in general is \(\left(x,F(x)\right)\), and for this example is \((25,77)\).

Now, let’s go in the opposite direction. Say a visitor from a country which measures temperature in degrees Celsius is visiting the United States and upon arrival hears on the radio that the temperature is 77 degrees. Of course the radio announcer does not add that that is in degrees Fahrenheit, so the visitor must do a conversion. Fortunately, there is a formula to make the conversion from degrees Fahrenheit to degrees Celsius:

\[ ^{\circ}C = \frac{5}{9}\left(^{\circ}F - 32\right) \]

Using this formula, the visitor finds:

\[ \begin{align} ^{\circ}C &= \frac{5}{9}\left(^{\circ}F - 32\right) \\ &= \frac{5}{9}\left(77 - 32\right) \\ &= \frac{5}{9}(45) \\ &= 5(5) = 25 \end{align} \]

Thus, 77 degrees Fahrenheit is 25 degrees Celsius. Like we did before,Let’s look at this formula as a function. If we let \(x\) be the temperature in degrees Fahrenheit, then we can define a function, \(C(x) = \frac{5}{9}\left(x - 32\right)\) as the function which, when given a temperature in degrees Fahrenheit, outputs the equivalent temperature in degrees Celsius. The mapping for this function in general, then, is \(\left(x,C(x)\right)\), and for this example is \((77,25)\).

If we look closely at the two mappings for the two functions, \(F(x)\) and \(C(x)\), we see that the first mapping from the function \(F(x)\) was \((25,77)\) while the second mapping from the function \(C(x)\) was \((77, 25)\). Do you see what’s going on here? The function \(C(x)\) undid the mapping that made by the function \(F(x)\). This is exactly what an inverse function does: it undoes the mapping that the other function made.


CONCEPT: An inverse function undoes the mapping of the function of which it is the inverse.


If we call the first function \(f(x)\), then the inverse function would be \(f^{-1}(x)\) (read \(f\) inverse of \(x\)). Note that this is the notation for an inverse function. It is not the function \(f\) raised the negative one power which, we know from the laws of exponents, would imply \(\frac{1}{f(x)}\).


CONCEPT: For a function, \(f(x)\), its inverse function, should one exist, is \(f^{-1}(x)\).


Now that we have a general sense of what an inverse is and does, let’s continue our exploration, first by recognizing an interesting relationship between a function and its inverse,


Return To Table Of Contents

??.2 Inverse Functions As Composite Functions

Let’s consider two functions, \(f(x)\) and \(g(x)\). Looking first at the function schematic for \(f(x)\):

We know that for the input \(x\), the function, \(f\), mapping is \((x,f(x))\). If we then look at the function schematic for \(g(x)\):

We know that for the input \(x\), the function, \(g\), mapping is \((x,g(x))\).

If we assume that the function, \(g\), is the inverse function to \(f\), then we know that it undoes the mapping made by \(f\) which was \((x,f(x))\). In order to do this, \(g\), must take as its input the output of \(f\) so as to produce the mapping \((f(x),x)\). Does the idea of one function’s input is the output of another function sound familiar? It should. This is how a composite function works as we saw in the last chapter. In this case, where \(g\) is taking output of \(f\), we have the composite function \((g \circ f)(x)\). Since we are assuming that \(g(x)\) is the inverse of the function \(f(x)\), we can rename it to be \(f^{-1}(x)\) we have the composite function \((f^{-1} \circ f)(x)\) which has the schematic:

As the schematic shows, the input, \(x\), first gets mapped by \(f\) thus forming \((x,f(x))\). Since \(f(x)\) is the input to \(f^{-1}(x)\), the mapping would be \((f(x),x)\).

Since these two functions are inverses of each other, it really doesn’t matter their order. In our example, we converted degrees Fahrenheit to degrees Celsius, and we converted degrees Celsius to degrees Fahrenheit. This means that we could also form the composite function \((f \circ f^{-1})(x)\), which has the composite function schematic:

As the schematic shows, the input, \(x\), first gets mapped by \(f^{-1}\) thus forming \((x,f^{-1}(x))\). Since \(f^{-1}(x)\) is the input to \(f(x)\), the mapping would be \((f^{-1}(x),x)\).

What has been seen here that for a function, \(f(x)\), and it’s inverse, \(f^{-1}(x)\), each undoes the mapping of the other. And, that we can connect them such that the output of one becomes the input to the other, thus forming the two composite functions, \((f \circ f^{-1})(x)\) and \((f^{-1} \circ f)(x)\), and that the output of each is the very input to the composite function, \(x\). This is very important to understand.


CONCEPT: A function, \(f(x)\), and its inverse, \(f^{-1}(x)\), when combined as composite functions, \((f \circ f^{-1})(x)\) and \((f^{-1} \circ f)(x)\) both output the initial input to the composite function. That is \((f \circ f^{-1})(x) = x\) and \((f^{-1} \circ f)(x) = x\).


Let’s look at an example using the two temperature conversion functions Section ??.1, calling one \(f(x)\) and the other \(f^{-1}(x)\).


Example ??.1

Consider the two functions believed to be inverses of each other, \(f(x) = \frac{9}{5}x + 32\) and \(f^{-1}(x) = \frac{5}{9}\left(x - 32\right)\). Find the composite functions \((f \circ f^{-1})(x)\) and \((f^{-1} \circ f)(x)\).

Solution

First consider \((f \circ f^{-1})(x)\):

\[ \begin{align} (f \circ f^{-1})(x) &= f(f^{-1}(x)) \\ &= f\left(\frac{5}{9}\left(x - 32\right)\right) \\ &= \frac{9}{5}\left(\frac{5}{9}\left(x - 32\right)\right) + 32 \\ &= x - 32 + 32 \\ &= x \end{align} \]

Next consider \((f^{-1} \circ f)(x)\):

\[ \begin{align} (f^{-1} \circ f)(x) &= f^{-1}(f(x)) \\ &= f^{-1}\left(\frac{9}{5}x + 32\right) \\ &= \frac{5}{9}\left(\left(\frac{9}{5}x + 32\right) - 32\right) \\ &= \frac{5}{9}\left(\frac{9}{5}x\right) \\ &= x \end{align} \]

Thus, we see that both \((f \circ f^{-1})(x) = (f^{-1} \circ f)(x) = x\).


In the last chapter, it was said that \((f \circ g)(x) \ne (g \circ f)(x)\) in most cases, which is very true. It also said that there is one case, however, where they must be equal, the case where \(f(x)\) and \(g(x)\) are Inverse Functions. And, this is that case. \((f \circ f^{-1})(x) = (f^{-1} \circ f)(x) = x\). This fact is crucial in the verification that two functions are indeed inverses of each other.


Return To Table Of Contents

??.3 Function / Inverse Function Verification

The two functions we saw above for the conversion of temperature between degrees Fahrenheit and degrees Celsius were said to be inverses of each other. This conclusion was made via the example using actual temperatures produced the mappings \((25,77)\) and \((77,25)\), which is what would be required if the functions are inverses. However, to be definitively sure that two functions are indeed inverses of each other it NOT sufficient to use a numeric example, you could have just gotten lucky in your choice of numbers. It must be shown that \((f \circ f^{-1})(x) = (f^{-1} \circ f)(x) = x\). By doing so shows that the mapping of one function undoes the mapping of the other for all \(x\), not just for any one particular numeric example, and is true regardless of which function is labeled as the original function and which one is labeled as the inverse function. Then, and only then, can it be said that the two functions are inverses of each other. (Note, when we say “for all \(x\)” we have to be cognizant of domains, which we will discuss later.)


CONCEPT: To conclusively show that two functions believe to be inverses of each other, \(f(x)\) and \(f^{-1}(x)\), it must be shown that \((f \circ f^{-1})(x) = (f^{-1} \circ f)(x) = x\). Both composite functions must equal \(x\); it is not sufficient to verify one or the other, both must be verified. This shows that the mapping of one function undoes the mapping of the other for all \(x\), not just for any one particular numeric example, and is true regardless of which function is labeled as the “original” function and which one is labeled as the “inverse” function.


Example ??.1 did indeed show that \((f \circ f^{-1})(x) = (f^{-1} \circ f)(x) = x\) so now, and only now, can be absolute in our conclusion that these two temperature conversion functions are indeed inverses of each other.

These were two relatively simple functions. As the functions we will encounter become more complex the required algebra will get more complex as well. That is, since the verification that two functions are inverses of each other involves composite functions, this, like finding a composite function as we saw in the last chapter, becomes a function evaluation problem and, as usual, will require strong algebraic skills.

Let’s look at another example, though not terribly complex, does illustrate this point.


Example ??.2

Consider the two functions believed to be inverses of each other, \(f(x) = \frac{-x + 3}{3x + 2}\) and \(f^{-1}(x) = \frac{3 - 2x}{3x + 1}\). Show conclusively that these two functions are indeed inverses of each other.

Solution

Let’s first verify that these two functions are inverse by using a numeric example, say \(x = -1\). We will use the composite function \((f^{-1} \circ f)(x)\) to do this (though we could have used the other one as well). That is, we want to evaluate \(f(-1)\) then use that result to evaluate \(f^{-1}(x)\) and see if we get \(-1\). In other words, we want to see if the mapping produced by \(f\) is undone by \(f^{-1}\).

Let’s first evaluate \(f(x)\) at \(x = -1\):

\[ \begin{align} f(-1) &= \frac{-(-1) + 3}{3(-1) + 2} \\ &= \frac{1 + 3}{-3 + 2} = -4 \end{align} \]

Thus, the function, \(f(x)\), maps \(x = -1\) to \(-4\), or \((-1,-4)\). Next, let’s evaluate \(f^{-1}(x)\) at \(x = -4\), the output of \(f\):

\[ \begin{align} f^{-1}(-4) &= \frac{3 - 2(-4)}{3(-4) + 1} \\ &= \frac{3 + 8}{-12 + 1} \\ &= \frac{11}{-11} = -1 \end{align} \]

The function, \(f^{-1}(x)\), maps \(x = -4\) to \(-1\), or \((-4,-1)\). This mapping did indeed undo the mapping produced by \(f\), which is what we would expect. But can we conclude that these two functions are indeed inverses of each other? No, we cannot.To be definitively sure that two functions are indeed inverses of each other it NOT sufficient to use a numeric example, we could have just gotten lucky in our choice of \(x = -1\). Using another numerical example isn’t proof either, we could have gotten lucky with that one as well. It must be shown that \((f \circ f^{-1})(x) = x\) and \((f^{-1} \circ f)(x) = x\). Then, and only then, can we say that these two functions are inverses of each other. So, let’s do that, starting with \((f \circ f^{-1})(x)\):

\[ \begin{align} (f \circ f^{-1})(x) &= f\left(f^{-1}(x)\right) \\ \\ &= f\left(\frac{3 - 2x}{3x + 1}\right) \\ \\ &= \frac{-\left(\frac{3 - 2x}{3x + 1}\right) + 3}{3\left(\frac{3 - 2x}{3x + 1}\right) + 2} \\ \\ &= \frac{\frac{-(3-2x) + 3(3x+1)}{3x +1}}{\frac{3(3-2x) + 2(3x+1)}{3x+1}} \\ \\ &= \frac{\frac{-3 + 2x + 9x + 3}{3x+1}}{\frac{9 - 6x + 6x + 2}{3x+1}} \\ \\ &= \frac{\frac{11x}{3x + 1}}{\frac{11}{3x + 1}} \\ \\ &= \frac{11x}{11} \\ \\ &= x \end{align} \]

Thus, \((f \circ f^{-1})(x) = x\). Now, let’s do \((f^{-1} \circ f)(x)\):

\[ \begin{align} (f^{-1} \circ f)(x) &= f^{-1}\left(f(x)\right) \\ \\ &= f^{-1}\left(\frac{-x + 3}{3x + 2}\right) \\ \\ &= \frac{3 - 2\left(\frac{-x + 3}{3x + 2}\right)}{3\left(\frac{-x + 3}{3x + 2}\right)+1} \\ \\ &= \frac{\frac{3(3x+2) - 2(-x+3)}{3x+2}}{\frac{3(-x+3) + (3x+2)}{3x+2}} \\ \\ &= \frac{\frac{9x + 6 +2x - 6}{3x+2}}{\frac{-3x+9+3x+2}{3x+2}} \\ \\ &= \frac{\frac{11x}{3x+2}}{\frac{11}{3x+2}} \\ \\ &= \frac{11x}{11} \\ \\ &= x \end{align} \]

Thus, \((f^{-1} \circ f)(x) = x\). We have now shown that \((f \circ f^{-1})(x) = (f^{-1} \circ f)(x) = x\), so now we can conclude that these two functions, \(f(x) = \frac{-x + 3}{3x + 2}\) and \(f^{-1}(x) = \frac{3 - 2x}{3x + 1}\), are indeed inverses of each other.


This example was a bit more involved than in our first example algebraically, something you should be prepared for not only in this section but, since inverse functions are pervasive in mathematics, we will most definitely see them again.

There is a caution that must be stated. The verification of a function and what is deemed to be the inverse to that function requires the showing that \((f \circ f^{-1})(x) = x\) and \((f^{-1} \circ f)(x) = x\). Unlike finding the composite function of any two functions, \(f(x)\) and \(g(x)\), for example, what these two composite functions equal is known in advance (or at least what they should be). Because of this, there can be a strong temptation to take shortcuts in the algebraic verification process by assuming terms will cancel, etc. Resist this temptation! Your work must be methodical and algebraically correct.


CONCEPT: The verification of a function and another to be inverses of each other requires strong algebraic function evaluation skills and must be methodical and algebraically correct. Resist the temptation to take shortcuts.


Well, now that we have a general sense of what an inverse function is (there is still a lot more to be learned and discovered about inverse function), there is one question that I’m sure you, the reader, has, and that is: “How do I go about finding the inverse of a given function”. An excellent question, which will be answered in the next section.


Return To Table Of Contents

??.4 Finding The Inverse Function

The question “How do I go about finding the inverse of a given function”, is a good one, for sure, and to help explore further inverse functions, it is useful to answer it now. A process will be given for expediency in answering this question, but why this process works will become clear as we move through our study of inverse functions. (Note, we will assume for now that the function given has an inverse, which may or may not be true as we’ll see later.)

The process for finding the inverse to a given function, \(f(x)\):

  1. Set the function equal to \(y\) (this step would be unnecessary if the function was already expressed as \(y\))
  2. Switch the \(x\)’s and \(y\)’s. Everywhere there is an \(x\) replace it with a \(y\) and vice versa.
  3. Solve for \(y\). This is the hardest part.
  4. Set equal to \(f^{-1}(x)\).

To see this process in action, let’s use the simple temperature conversion formula from Celsius to Fahrenheit: \(f(x) = \frac{9}{5}x + 32\).

Step 1: Set equal to \(y\):

\[ y = \frac{9}{5}x + 32 \]

Step 2: Switch the \(x\)’s and the \(y\)’s:

\[ x = \frac{9}{5}y + 32 \]

Step 3: Solve for \(y\):

\[ \begin{align} x &= \frac{9}{5}y + 32 \\ x - 32 &= \frac{9}{5}y \\ \frac{5}{9}(x - 32)&= y \end{align} \]

Step 4: Set equal to \(f^{-1}(x)\):

\[ f^{-1}(x) = \frac{5}{9}(x - 32) \]

Of course, one should always verify that the inverse function found is indeed the inverse function by, as explained in Section ??.3 above, showing \((f \circ f^{-1})(x) = (f^{-1} \circ f)(x) = x\). This was already done in Section ??.2 so it will not be repeated here.


CONCEPT: Given a function, \(f(x)\), once you find what you believe to be the inverse function, \(f^{-1}(x)\), you should always verify that it is indeed the inverse by showing \((f \circ f^{-1})(x) = (f^{-1} \circ f)(x) = x\) even if it was not specifically asked for.


Now, let’s consider another example:


Example ??.3

Given \(f(x) = (x + 2)^{5} - 3\), find the inverse function, \(f^{-1}(x)\).

Solution:

Step 1: Set equal to \(y\):

\[ y = (x + 2)^{5} - 3 \]

Step 2: Switch the \(x\)’s and the \(y\)’s:

\[ x = (y + 2)^{5} - 3 \]

Step 3: Solve for \(y\):

\[ \begin{align} x &= (y + 2)^{5} - 3 \\ x + 3 &= (y + 2)^{5} \\ (x + 3)^{1/5} &= \left((y + 2)^{5}\right)^{1/5} \\ (x + 3)^{1/5} &= y + 2 \\ (x + 3)^{1/5} - 2 &= y \end{align} \]

Notice that we had to make use of a law of exponents in solving for \(y\)!

Step 4: Set equal to \(f^{-1}(x)\):

\[ f^{-1}(x) = (x + 3)^{1/5} - 2 \]

Thus, the inverse function is \(f^{-1}(x) = (x + 3)^{1/5} - 2\). And, now since it is always wise to do, verify that this is indeed the inverse function. We’ll do this first via a numeric example and then by the required showing that \((f \circ f^{-1})(x) = x\) and \((f^{-1} \circ f)(x) = x\):

As a numeric example verification, let’s choose \(x = -1\). First, let’s evaluate \(f(-1)\):

\[ \begin{align} f(-1) &= \left((-1) + 2\right)^{5} - 3 \\ &= (1)^{5} - 3 \\ &= 1 - 3 = -2 \end{align} \]

Thus, the function, \(f(x) = (x + 2)^{5} - 3\), maps \(-1\) to \(-2\), or \((-1,-2)\). If \(f^{-1}(x) = (x + 3)^{1/5} - 2\) is truly the inverse function then we would expect it to map \(-2\) back to \(-1\), or \((-2,-1)\). Let’s see it that is indeed the case:

\[ \begin{align} f^{-1}(-2) &= \left((-2) + 3\right)^{1/5} - 2 \\ &= (1)^{1/5} - 2 \\ &= 1 - 2 = -1 \end{align} \]

The mapping is as expected. \(f(x)\) for \(x = -1\) had a mapping of \((-1,-2)\); \(f^{-1}(x)\) mapped \(-2\) back to \(-1\), or \((-2,-1)\). This numeric example verified that these two functions are inverses, however, that is not sufficient, we need to show that \((f \circ f^{-1})(x) = x\) and \((f^{-1} \circ f)(x) = x\)

First, let’s verify that \((f \circ f^{-1})(x) = x\):

\[ \begin{align} (f \circ f^{-1})(x) &= f\left(f^{-1}(x)\right) \\ &= f\left((x + 3)^{1/5} - 2\right) \\ &= \left(\left((x + 3)^{1/5} - 2\right)+2\right)^{5} - 3 \\ &= \left((x+3)^{1/5}\right)^{5} - 3 \\ &= x + 3 - 3 \\ &= x \end{align} \]

\((f \circ f^{-1})(x) = x\) has been verified. Now, let’s verify \((f^{-1} \circ f)(x) = x\):

\[ \begin{align} (f^{-1} \circ f)(x) &= f^{-1}\left((x + 2)^{5} - 3\right) \\ &= \left(\left((x + 2)^{5} - 3\right) + 3\right)^{1/5} - 2 \\ &= \left((x+2)^{1/5}\right)^{1/5} - 2 \\ &= x + 2 - 2 \\ &= x \end{align} \]

\((f^{-1} \circ f)(x) = x\) have been verified. Thus, we can now conclude that \(f(x) = (x + 2)^{5} - 3\) and \(f^{-1}(x) = (x + 3)^{1/5} - 2\) are indeed inverses of each other.


The process for finding an inverse for a given function, \(f(x)\), is relatively straightforward. As stated in the process, the solving for \(y\) is the hardest part for it can require strong algebraic skills.

There is still an open question, however, “Does every function have an inverse?”. We will explore, and answer, this question in the next section.


Return To Table Of Contents

??.5 Does Every Function Have An Invervse?

All of the examples thus far, either gave a function and its inverse or gave a function and asked to find its inverse. Either way, this might have led to the assumption that every function has an inverse. Is this a valid assumption?

To help answer the question, “Does every function have an inverse?”, let’s consider the basic quadratic, \(f(x) = x^{2}\). For an input of \(x = 2\), then \(f(2) = (2)^{2} = 4\), with the associated mapping of \((2,4)\). For an input of \(x = -2\), then \(f(-2) = (-2)^{2} = 4\), with the associated mapping of \((-2,4)\). The graph of \(f(x) = x^{2}\) with these two mappings are shown in Figure ??.? below. Since two different inputs get mapped to the same output, the function, \(f(x) = x^{2}\), is a many-to-one function (as we already know).

Let’s recall the schematic for \((f^{-1} \circ f)(x)\):

Let’s track the input \(x = 2\) through the schematic in combination with based on our understanding of an inverse function. The input enters the function \(f\) and, as we’ve seen the output will be \(f(2) = 4\) and the mapping is \((2,4)\). Assuming that the inverse function, \(f^{-1}\), exists, this output,\(4\), will enter \(f^{-1}\) and the expectation is that it will produce an output of \(f^{-1}(4) = 2\) for it will undo the mapping of \((2,4)\) to \((4,2)\). So far so good.

Next, et’s track the input \(x = -2\) through the schematic in combination with based on our understanding of an inverse function. The input enters the function \(f\) and, as we’ve seen the output will be \(f(-2) = 4\) and the mapping is \((-2,4)\). Assuming that the inverse function, \(f^{-1}\), exists, this output,\(4\), will enter \(f^{-1}\) and the expectation is that it will produce an output of \(f^{-1}(4) = -2\) for it will undo the mapping of \((-2,4)\) to \((4,-2)\).

Do you see the problem? The output of \(f(x)\) was \(4\) for both inputs of \(2\) and \(-2\). But the information that the supposed inverse function has is a \(4\). To reverse the mapping it would to need to know how that \(4\) was produced. Was it by the \(x = 2\)? Or was it produced by the \(x = -2\)? That’s the problem. It would not know. This would be true for any many-to-one function. For any output that was produced by more than one input, the alleged inverse function would not be able to undo these mappings. Hence, we can conclude that many-to-one functions do not have inverses.


CONCEPT: Only one-to-one functions have inverses. Many-to-one functions do not have inverses.


What if you didn’t know that \(f(x) = x^{2}\) was a many-to-one function? What if you proceeded to follow the process to find the inverse? The following example will explore this.


Example ??.4

Given \(f(x) = x^{2}\), find the inverse function, \(f^{-1}(x)\).

Solution:

Step 1: Set equal to \(y\):

\[ y = x^{2} \]

Step 2: Switch the \(x\)’s and the \(y\)’s:

\[ x = y^{2} \]

Step 3: Solve for \(y\):

\[ \begin{align} x &= y^{2} \\ \pm \sqrt{x} &= y \end{align} \]

Step 4: Set equal to \(f^{-1}(x)\):

\[ f^{-1}(x) = \pm \sqrt{x} \]

Notice that there are two solutions for the inverse function: \(f^{-1}(x) = \sqrt{x}\) and \(f^{-1}(x) = -\sqrt{x}\). The fact that there are two solutions is indicative of the function \(f(x) = x^{2}\) being a many-to-one function, thus the inverse does not exist. (Note, this is basically the algebraic test to determine if a function is many-to-one where there are two inputs that produce the same output.) Of course you could have used the horizontal line test on \(f(x)\) to determine that it is many-to-one, but that is often not convenient or an available option; the algebraic test, as I call it, is the preferred way.


The fact that only one-to-one functions have inverses is quite problematic in mathematics. Besides the quadratic function, \(f(x) = x^{2}\), two fundamental trigonometric functions, the sine and cosine functions (which will be explored in Chapter ??) are but two other examples of functions that do not have inverses. Again, this is quite problematic for it often the case that we need an inverse to exist. This issue will be explored in Section ??.7 What To Do If A Many-To-One Function.


Return To Table Of Contents

??.6 Key Properties Of A Function And Its Inverse

Now that we have explored a function and its inverse at a high level, it’s time to dig a litter deeper. To begin, consider two functions, \(f(x)\) and \(f^{-1}\) which are known to be inverses of each other. What they are is not important right now. Figure ?? shows the graph of these two functions.

A lot can be gleaned from this one plot. Looking first at \(f(x)\), it is clear from the graph that its domain is all real numbers, \((-\infty,\infty)\), and its range is all real numbers greater than zero, \((0,\infty)\). Looking next at \(f^{-1}(x)\), it is clear that its domain is all real numbers greater than zero, \((0,\infty)\) and its range is all real numbers, \((-\infty,\infty)\). It turns out that what was observed is true for any function and its inverse: The domain of one becomes the range of the other; and, the range of one becomes the domain of the other.

Taking another look at the graph, we see that the y-intercept of \(f(x)\) is \((0,1)\). We also notice that the x-intercept of \(f^{-1}(x)\) is \((1,0)\). It also turns out that this observation holds for any function and its inverse: The x-intercept of one becomes the y-intercept of the other, with the x- and y-coordinates switched; and the y-intercept of one becomes the x-intercept of the other, with the x- and y-coordinates switched.

But, why is all this true? It turns out that a function and its inverse are reflections about the line \(y = x\) as also seen on the graph. What this implies, then, that any point, \((x,y)\), on \(f(x)\) becomes the point \((y,x)\) on \(f^{-1}(x)\), and conversely. The x- and y- coordinates switch as shown on the graph. From this idea alone we see that whatever the domain is of \(f(x)\) (i.e., the valid inputs for \(x\)) these \(x\) values become the \(y\) values for \(f^{-1}(x)\), or its range. And vice versa. It all makes sense.


CONCEPT: Given two functions which are inverses of each other the following properties are true:


From this observation that any point, \((x,y)\), on one becomes the point \((y,x)\) on the other (i.e., the x- and y-coordinates switch) is the reason why the process for finding the inverse to a function includes the step of switching the \(x\)’s and \(y\)’s.

Let’s consider an example.


Example ??.5

Consider \(f(x) = \frac{3x-1}{2x+5}\). a). Find \(f^{-1}(x)\) (there’s no need to verify it as part of this example, but you should anyway); b). Verify that the point \(\left(1,\frac{2}{7}\right)\) on \(f(x)\) becomes the point \(\left(\frac{2}{7},1\right)\) on \(f^{-1}(x)\); c). Find the domain, range, x-intercept, and y-intercept of \(f(x)\) and \(f^{-1}(x)\).

Solution:

a). Find \(f^{-1}(x)\): Here, let’s combine the four steps of the finding of the inverse process together:

\[ \begin{align} f(x) &= \frac{3x-1}{2x+5} \\ y &= \frac{3x-1}{2x+5} \\ x &= \frac{3y-1}{2y+5} \\ x(2y+5) &= 3y - 1 \\ 2xy + 5x &= 3y - 1 \\ 2xy - 3y &= -5x - 1 \\ (2x - 3)y &= -5x - 1 \\ y &= \frac{-5x - 1}{2x - 3} \\ f^{-1}(x) &= \frac{-5x - 1}{2x - 3} \end{align} \]

b). Verify that the point \(\left(1,\frac{2}{7}\right)\) on \(f(x)\) becomes the point \(\left(\frac{2}{7},1\right)\) on \(f^{-1}(x)\): First, let’s verify what the function, \(f\), evaluated at 1 is:

\[ \begin{align} f(1) &= \frac{3(1) - 1}{2(1) + 5} \\ &= \frac{2}{7} \end{align} \]

Thus, the mapping is \(\left(1,\frac{2}{7}\right)\). Since \(f^{-1}(x)\) is the inverse, it would take \(\frac{2}{7}\) as its input and would map it back to \(x = 1\), or \(\left(\frac{2}{7},1\right)\). Let’s verify that:

\[ \begin{align} f^{-1}\left(\frac{2}{7}\right) &= \frac{-5\left(\frac{2}{7}\right) - 1}{2\left(\frac{2}{7}\right) - 3} \\ &= \frac{\frac{-10 - 7}{7}}{\frac{4 - 21}{7}} \\ &= \frac{\frac{-17}{7}}{\frac{-7 - 10}{7}} \\ &= 1 \end{align} \]

The mapping is reversed. Hence, the point \(\left(1,\frac{2}{7}\right)\) on \(f(x)\) becomes the point \(\left(\frac{2}{7},1\right)\) on $f^{-1}(x)

c). Find the domain, range, x-intercept, and y-intercept of \(f(x)\) and \(f^{-1}(x)\)

Let’s first explore \(f(x) = \frac{3x-1}{2x+5}\). The domain of \(f(x)\) is all real number except \(x = -\frac{5}{2}\), or in interval notation, \(\left(-\infty,-\frac{5}{2}\right) \cup \left(-\frac{5}{2},\infty\right)\). The range of \(f(x)\) is all real numbers except \(y = \frac{3}{2}\), or in interval notation, \(\left(-\infty,\frac{3}{2}\right) \cup \left(\frac{3}{2},\infty\right)\). Finding \(f(0)\) shows the y-intercept to be \(\left(0,-\frac{1}{5}\right)\). Solving \(f(x) = 0\) yields the x-intercept to be \(\left(\frac{1}{3},0\right)\). Figure ??.?? shows the graph of \(f(x) = \frac{3x-1}{2x+5}\) which verifies our findings.

Next, let’s explore \(f^{-1}(x) = \frac{-5x - 1}{2x - 3}\). The domain of \(f^{-1}(x)\) is all real numbers except \(x = -\frac{5}{2}\), or in interval notation, \(\left(-\infty,\frac{3}{2}\right) \cup \left(\frac{3}{2},\infty\right)\). The range of \(f^{-1}(x)\) is all real numbers except \(y = \frac{3}{2}\), or in interval notation, \(\left(-\infty,-\frac{5}{2}\right) \cup \left(-\frac{5}{2},\infty\right)\). Finding \(f^{-1}(0)\) shows the y-intercept to be \(\left(0,\frac{1}{3}\right)\). Solving \(f^{-1}(x) = 0\) yields the x-intercept to be \(\left(-\frac{1}{5},0\right)\). Figure ??.?? shows the graph of \(f(x) = \frac{3x-1}{2x+5}\) which verifies our findings.

The following table summarizes the results:

\(f(x) = \frac{3x-1}{2x+5}\) \(f^{-1}(x) = \frac{-5x - 1}{2x - 3}\)
Domain \(\left(-\infty,-\frac{5}{2}\right) \cup \left(-\frac{5}{2},\infty\right)\) \(\left(-\infty,\frac{3}{2}\right) \cup \left(\frac{3}{2},\infty\right)\)
Range \(\left(-\infty,\frac{3}{2}\right) \cup \left(\frac{3}{2},\infty\right)\) \(\left(-\infty,-\frac{5}{2}\right) \cup \left(-\frac{5}{2},\infty\right)\)
x-intercept \(\left(\frac{1}{3},0\right)\) \(\left(-\frac{1}{5},0\right)\)
y-intercept \(\left(0,-\frac{1}{5}\right)\) \(\left(0,\frac{1}{3}\right)\)

It is clearly seen that the domain of \(f(x)\) becomes the range of \(f^{-1}(x)\) and the range of \(f(x)\) becomes the domain of \(f^{-1}(x)\). Also, the x- and y-intercepts switch as well with the condition that the x- and y-coordinates switch.

It should be noted that there was no real need to actually do the work to find the domain, range, and the x- and y-intercepts for \(f^{-1}(x)\) once it has been verified to be the inverse to \(f(x)\). You can use the facts that the domain of one becomes the range of the other, the range of one becomes the domain of the other, and the intercepts switch as well with the condition that the x- and y-coordinates switch. That said, it is always a good idea to do the work any way.

\(\textbf{Note: This example is explored further in Appendix ??, Inverse Functions.}\)


Example ??.6

Consider \(f(x) = \sqrt{x+2}\). a). Find \(f^{-1}(x)\) (there’s no need to verify it as part of this example, but you should anyway); b). Find the domain, range, x-intercept, and y-intercept of \(f(x)\) and \(f^{-1}(x)\).

Solution:

a). Find \(f^{-1}(x)\): Here, let’s combine the four steps of the finding of the inverse process together:

\[ \begin{align} f(x) &= \sqrt{x+2} \\ y &= \sqrt{x+2} \\ x &= \sqrt{y+2} \\ x^{2} &= y + 2 \\ x^{2} - 2 &= y \\ f^{-1}(x) &= x^{2} - 2 \end{align} \]

b). Find the domain, range, x-intercept, and y-intercept of \(f(x)\) and \(f^{-1}(x)\)

The domain of \(f(x)\) is all real numbers greater than or equal to \(-2\), or in interval notation, \([-2,\infty)\). The range of \(f(x)\) is all real numbers greater than or equal to zero, or in interval notation, \(\left(0,\infty\right)\). Finding \(f(0)\) shows the y-intercept to be \(\left(0,\sqrt{2}\right)\). Solving \(f(x) = 0\) yields the x-intercept to be \(\left(-2,0\right)\). Figure ??.?? shows the graph of \(f(x) = \sqrt{x+2}\) which verifies our findings.

To determine the domain, range, x-intercept, and y-intercept of the inverse function, \(f^{-1}(x) = x^{2} - 2\), let’s use the fact that a function and its inverse switch domains and ranges as well as x- and y-intercepts. Hence for the inverse function, \(f^{-1}(x) = x^{2} - 2\):

  • Domain: \([0,\infty)\)
  • Range: \([-2,\infty)\)
  • x-intercept: \((0,-2)\)
  • y-intercept: \((0,\sqrt{2})\)

The following table summarizes the results for both \(f(x)\) and \(f^{-1}(x)\):

\(f(x) = \sqrt{x + 2}\) \(f^{-1}(x) = x^{2} - 2\)
Domain \([-2,\infty)\) \((0,\infty)\)
Range \((0,\infty)\) \([-2,\infty)\)
x-intercept \(\left(-2,0\right)\) \(\left(\sqrt{2},0\right)\)
y-intercept \(\left(0,\sqrt{2}\right)\) \(\left(0,-2\right)\)

Again, the domain, range, x-intercept, and y-intercept of the inverse function, \(f^{-1}(x) = x^{2} - 2\), were found given that a function and its inverse switch domains and ranges as well as x- and y-intercepts.


This example presents something very interesting. Looking closely at the inverse function, \(f^{-1}(x) = x^{2} - 1\), we recognize that this is a quadratic which is a many-to-one function. From what we learned in the last section, many-to-one functions do not have inverses. So how could \(f(x) = \sqrt{x + 2}\) be the inverse of \(f^{-1}(x) = x^{2} - 1\)? What’s going on here? We will answer this question and revisit this example in the next section What To Do If A Many-To-One Function.


Return To Table Of Contents

??.7 What To Do If A Many-To-One Function

There are many important functions in mathematics that are many-to-one functions which, as we now know, do not, by definition, have inverses. The quadratic is one example. Two very important trigonometric functions, \(\cos(x)\) and \(\sin(x)\), are also examples. There are many others. The problem, however, is that these functions are pervasive in mathematics and it turns out there is a critical and practical need to somehow allow them to have inverses. The way to do this is to limit their domains which, when limited, the function becomes one-to-one.


CONCEPT: The domain of a many-to-one function may be limited such that this limited domain function becomes one-to-one. That is, it is a one-to-one function over that limited domain.


To get a sense of what this means, let’s revisit the quadratic, \(f(x) = x^{2}\). In Section ??.5 it was shown that this is a many-to-one function using the fact that \(x = 2\) and \(x = -2\) both produce the output of \(4\). The graph of this idea is represented here:

This means that we would not be able to determine whether it was the \(x = 2\) that generated the \(4\) or whether it was the \(x = -2\). But, what if we wanted to know what these two inputs were? We could limit the domain, but to what? Usually the best approach would be to limit the domain so as to take best advantage of the characteristics (or properties) of the function itself.

In this case, the domain of the quadratic function, \(f(x)\), is all real numbers, or in interval notation, \((-\infty,\infty)\). What if we were to limit the domain to only all numbers greater than or equal to zero, or in interval notation, \([0,\infty)\) which would produce the following graph:

What was a many-to-one function is now a one-to-one function with the limited domain. It is the right half of the quadratic. To take advantage of this limited domain, we realize that each quadratic has an axis-of-symmetry which is the (imaginary) vertical line through the vertex which becomes the line of reflection for one half of a quadratic to the other. So, since this domain limited function being one-to-one it has an inverse. That inverse, in this case would be \(f^{-1}(x) = \sqrt{x}\) (note the \(-\sqrt{x}\) case was eliminated). So, for \(x = 4\), \(f^{-1}(4) = \sqrt{4} = 2\). Now we can use the fact that the point \((2,4)\) reflected about the axis-of-symmetry (which in this case is the line \(x = 0\)) is the point \((-2,4)\). This tells us what the other input would be that produced the output \(4\). The following graph reflects (no pun intended) this idea.

Again, we were making use of our knowledge and understanding of the quadratic function and its properties and characteristics to choose a domain that will allow us to take full advantage of those properties and characteristics. Examples of what these properties and characteristics are that you might want to consider: is there an axis-of-symmetry; Whether the function is an even function; or, Whether the function is an odd function. There are others but these give a sense as to what to be thinking about.


CONCEPT: When limiting the domain of a function, choose a domain that takes the best advantage of the characteristics (properties) of the function itself.


Now that we have an understanding of what can be done if a function is one-to-one, let’s revisit Example ??.6 from the last section.


Example ??.7 (Example ??.6 Revisited)

Consider \(f(x) = \sqrt{x+2}\). a). Find \(f^{-1}(x)\) (there’s no need to verify it as part of this example, but you should anyway); b). Find the domain, range, x-intercept, and y-intercept of \(f(x)\) and \(f^{-1}(x)\).

Solution:

In Example ??.6 we found the inverse function of \(f(x) = \sqrt{x+2}\) to be \(f^{-1}(x) = x^{2} - 2\).The domain, range, x-intercept, and y-intercept of the inverse function, \(f^{-1}(x) = x^{2} - 2\), were found given that a function and its inverse switch domains and ranges as well as x- and y-intercepts. Using this fact, they were found to be:

  • Domain: \([0,\infty)\)
  • Range: \([-2,\infty)\)
  • x-intercept: \((0,-2)\)
  • y-intercept: \((0,\sqrt{2})\)

This posed an interesting question which basically asked how can this be given that \(f^{-1}(x) = x^{2} - 2\) which is a quadratic which is a many-to-one function and would, therefore, not have an inverse. Let’s take a look at the graph of \(f^{-1}(x) = x^{2} - 2\):

As expected, \(f^{-1}(x) = x^{2} - 2\) is many-to-one with the mappings \((-2,2)\) and \((2,2)\) verifying this. As we saw, a remedy to this problem of \(f^{-1}(x)\) not having an inverse would be to limit its domain so as to take advantage of the properties and characteristics of a quadratic. The vertex of the quadratic \(f^{-1}(x) = x^{2} - 2\) is at \((0,-2)\) (this function is just \(f(x) = x^{2}\) moved down 2 units) and has an axis-of-symmetry of \(x = 0\). As was discussed above, for a quadratic limiting the domain to either the left or right of the axis-of-symmetry would result in a one-to-one function thus giving it an inverse and from which we can use the symmetric properties of a quadratic to identify the multiple inputs that produce the same output. In this case, we will limit the domain to be to the right of the axis-of-symmetry, or \([0,\infty)\). The graph of this limited domain function capturing these ideas is shown below with the part of the function’s graph excluded by the limited domain grayed out:

If we look closely at just the limited domain, \([0,\infty]\), of \(f^{-1}(x) = x^{2} - 2\), as shown in the following graph, we see that the range is all real numbers greater than or equal to \(-2\), or in interval notation, \([-2,\infty)\), the x-intercept is \(\left(\sqrt{2},0\right)\), and the y-intercept is \((-2,0)\). These are the exact values that we found in Example ??.6!

And, finally, let’s look at both \(f(x) = \sqrt{x+2}\) and \(f^{-1}(x) = x^{2} - 2\) with its limited domain of \([0,\infty)\) on the same graph along with the line \(y = x\).

The graph verifies what we deduced concerning these two functions.


As mentioned there are many important functions in mathematics that are many-to-one functions which, do not, by definition, have inverses. This quite problematic for these functions are pervasive in mathematics and it turns out there is a critical and practical need to somehow allow them to have inverses. This section showed the way that this can be achieved, and that is, to limit their domains which, when limited, the function becomes one-to-one. How to limit their domains will depend on the function and how best to take advantage of the characteristics (properties) of the function itself.


Return To Table Of Contents

??.8 Why You Should Care

In this Why You Should Care we will venture into the world of Statistics. In particular, we will take a look at three key functions pervasive in, and fundamental to, statistics: the probability density function (PDF), the cumulative distribution function (CDF), and the quantile function. The focus will be on the latter two functions for they are examples of what this chapter has been all about. That said, what follows in not intended to be a tutorial on these important functions or statistics in general. Rather, the basics sufficient to understand the needed context will be presented, though it is hoped that perhaps your interest will be piqued and will want to learn more about them and/or statistics in general.

First a very brief definition of these three functions will be given so as to provide context; again, this is not intended to be a tutorial on these important functions or statistics in general. To accomplish this we will use the normal, or Gaussian, distribution for this distribution is one which most are aware of to some level. Once presenting the basics of these three very important functions, we will look at a specific example highlighting the concepts presented in this chapter. (Note: The APPENDIX: Inverse Functions will explore the normal distribution a bit more.)

A probability density function (PDF) is a function which describes how the probability of a continuous random variable is distributed over a range of values. To see what this means, let’s take a look at the PDF for the normal, or Gaussian distribution with a mean of zero and a variance of one (which is known as the standard normal distribution) which has the equation:

\[ f(x) = \frac{1}{\sqrt{2\pi}}e^{\frac{-x^{2}}{2}} \]

The graph of the standard normal (or any normal for that matter) distribution is the familiar bell curve:

The graph of a PDF provides a visualization of how the probability is distributed over a range of values, thus giving a sense of the width and shape of the distribution. That is, one can easily see the region(s) where the probability is most dense, or within what region the bulk of the probability lies. Said another way: The PDF shows the most likely values the observed random variable will take on. For the standard normal PDF it is clear that the density is greatest in the region about the mean (which is zero in this case).

A complementary function to a PDF is the cumulative distribution function (CDF) which yields the probability that a value of the continuous random variable will be less than or equal to some value. In other words, it accumulates the probability of all outcomes up to a given point. The graph of the CDF for the standard normal distribution is:

Notice that the range of the CDF is between zero and one. This is because probability is only between zero (no chance at all) and one (absolute certainty). Note also that the input to the CDF is a particular observed value of interest and the function returns the probability of all observed values less than or equal to the one of interest. That is, if \(X\) is the random variable describing the possible observed values and \(x\) is the one of interest, then the CDF will return the value \(P[X \le x]\) (the probability, \(P\), that \(X\) is less than or equal to \(x\)).

There is a relationship between the PDF and CDF. Mathematically the CDF is the area under the curve of the PDF, which implies that to find the cumulative probability up to a given point, the use of integration is required. If we let \(f(x)\) be a PDF then the corresponding CDF, \(F(x)\), is:

\[ F(x) = \int_{-\infty}^{x} f(t)dt \]

Don’t worry about the formalities of integration right now, you’ll learn all about this in calculus. The take away, however, is what’s important and that is that there exists a function, the CDF, which represents the cumulative probability of something occurring up to a given point. The showing the relationship between the PDF and CDF was for background purposes (though I do hope it has piqued your curiosity to pursue future study of statistics).

Along with the PDF and CDF, there is another function that is also of great interest, the quantile function. Simply stated, the quantile function accepts a probability and returns the associated observed value which produced this probability. To help understand what this means, think back to when you were young and the doctor told your parents that you were in the \(75^{th}\) percentile for height. This means that \(75\%\) of the population for your age were below your height. If you were to enter \(x = 0.75\) into the quantile function, it would return the height.

The graph of the quantile function for the standard normal distribution is:

Like the PDF and the CDF having a mathematical relationship, there is a mathematical relationship between the CDF and the quantile functions. They are inverse functions!!! This implies that whatever mapping is produced by the CDF is undone by the quantile function (or vice versa).


CONCEPT: The quantile function and the cumulative distribution function, CDF, are inverses of each other.


Now that the basics of these three very important functions is understood, we will look at a specific example to highlight these ideas, in particular the idea that the CDF and quantile functions are inverses of each other.

Example

Let’s define a very simple PDF, \(f(x) = 3x^{2}\). To be sure to meet the strict requirements a function must have to be a PDF, we will limit the domain to be \([0,1]\) by expressing the PDF as the piecewise function:

\[ f(x) = \begin{cases} 3x^2 & \text{if } 0 \le x \le 1 \\ 0 & \text{otherwise } \end{cases} \]

The graph of the PDF in \([0,1]\) is:

Recall that the CDF in the integral of the PDF, which when doing the integration becomes the function \(F(x) = x^{3}\):

\[ \begin{align} F(x) &= \int_{0}^{x} f(t)dt \\ &= \int_{0}^{x} 3t^{3} dt \\ &= x^{3} \end{align} \]

It too, will have a limited domain of \([0,1]\). To be more precise we define the CDF as:

\[ F(x) = \begin{cases} 0 & \text{if } x < 0 \\ x^3 & \text{if } 0 \le x \le 1 \\ 1 & \text{if } x > 1 \end{cases} \]

The graph of the CDF in \([0,1]\) is:

The quantile function, \(Q(x)\) is the inverse of the CDF. Let’s find what that inverse function, \(Q(x)\), is using the process we learned:

\[ \begin{align} y &= x^{3} \\ x &= y^{3} \\ x^{1/3} &= y \\ Q(x) &= x^{1/3} \end{align} \]

It too, will have a limited domain of \([0,1]\). To be more precise we define the quantile function, \(Q(x)\), as:

\[ Q(x) = \begin{cases} x^{1/3} & \text{if } 0 \le x \le 1 \\ 0 & \text{otherwise } \end{cases} \]

The graph of the quantile function in \([0,1]\) is:

(The reader should verify that these two functions are indeed inverses.)

As you recall, if \(f(x)\) and \(f^{-1}(x)\) are inverses, then the point \((x,y)\) on \(f(x)\) has the corresponding point \((y,x)\) on \(f^{-1}(x)\). Since the CDF and quantile functions are inverses, we would expect this to be true. Let’s see if this is the case.

If we were to evaluate the CDF at \(x = 0.793700526\), we would get:

\[ \begin{align} F(x) &= x^{3} \\ F(0.793700526) &= 0.793700526^{3} \\ &= 0.5 \end{align} \]

Thus, the mapping for \(x = 0.793700526\) by \(F(x)\) is \((0.793700526,0.5)\). The following graph shows this:

We would now expect that the quantile function, \(Q(x)\), would map \(0.5\) back to \(0.793700526\); i.e., the mapping would be \((0.5,0.793700526)\). Let’s see if this is the case.

\[ \begin{align} Q(x) &= x^{1/3} \\ Q(0.5) &= (0.5)^{1/3} \\ &= 0.793700526 \end{align} \]

The expected mapping occurred. The following graph shows this:

Our expectation of the mappings being reversed was met. We could also plot the two functions together to visually see that the two functions are reflections about the line \(y = x\).

The graph verifies what we deduced concerning these two functions, and that is that they are inverse functions.

The relationship between a PDF to a CDF and a CDF to a quantile function is amazing. Again, don’t worry if you don’t grasp all that that means rights now. A bit more about these functions will be discussed in the APPENDIX: Inverse Functions, and it is recommended you check it out. What is important, however, is that what we have been discussing, and what you have been learning, about a function and its inverse, has meaning in higher level mathematics, in this case statistics, and real-world applications. That is Why You Should Care!


Return To Table Of Contents

??.9 Chapter Review

This chapter presented the idea and mathematics of a function and its inverse function. A lot has been discussed. What follows is a summary of the main points presented in this chapter (not necessarily in any particular priority order):


??.10 Exercises


Return To Table Of Contents


.

Appendix ??

Arithmetic Combination of Functions

In Chapter ??, we explored the concepts of the arithmetic combination of two or more individual functions, how they are created, the various means to evaluate them, and, not least of all, how to find their domains. All this was explored from a mathematical (algebraic) perspective. In this appendix we will explore how some of these ideas are handled in a practical, applied sense as well as how they can be used to verify the concepts developed in the chapter.


??.1 The Arithmetic Combination Of Two Or More Functions, Definition And Evaluation

There are four ways that two or more functions can be combined under arithmetic operations: addition, subtraction, multiplication, and division. Any given input, \(x\), enters each function simultaneously and the output of each function is combined using the specified arithmetic operation(s). The newly created function represents the arithmetic combination of the individual functions for all \(x\) within the intersection of the domains of each of the individual functions.

First, let’s explore the arithmetic combination of just two functions which can then be extended to more than two functions. The schematic for the arithmetic combination of two functions is useful to help understand how this works and can be easily extended for more than two functions:

If we consider the arithmetic combination of two functions under the operation of addition, we see from the schematic that the input, \(x\), is split and enters both of the functions, \(f\) and \(g\), simultaneously, that is the two functions are evaluated at the same input value. Their outputs, \(f(x)\) and \(g(x)\), respectively, though are completely independent and can be used for whatever other purposes any contextual situation might require, are then combined to produce the outputs \(f(x) + g(x)\), \(f(x) - g(x)\), or \(f(x)g(x)\), or \(\frac{f(x)}{g(x)}\). Using the arithmetic operation of addition as an example, what this means is that the adding together of two functions is the sum of the two individual outputs for all inputs, \(x\), which are in their respective domains (we’ll discuss domains below in). The same result would be produced had the actual function created by the algebraic summing of the two functions was found and then evaluated at a given input, \(x\). This same conclusion results for the arithmetic operations of subtraction, multiplication, and division. Thus, given two functions, \(f\) and \(g\), \((f + g)(x) = f(x) + g(x)\), \((f - g)(x) = f(x) - g(x)\), \((fg)(x) = f(x)g(x)\), and \(\left(\frac{f}{g}\right)(x) = \frac{f(x)}{g(x)}\text{, } g(x) \ne 0\).

Let’s explore this idea with the two simple functions used in Examples ??.1, ??.?, ??.?, and ??.? in Chapter ??: \(f(x) = x - 1\) and \(g(x) = 2x + 4\). In these examples, we were asked to find the arithmetic combination of these two functions evaluated at \(x = -3\). Let’s first evaluate each function at \(x = -3\), starting with \(f(-3)\):

# define f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x - 1}
# evaluate it at x = -3, expressing the result as a fraction versus a decimal
fractions(fFunc(-3))
## [1] -4

Now, \(g(-3)\):

# define g(x) being sure to enter the function using ASCII notation
gFunc <- function(x){2*x + 4}
# evaluate it at x = -3, expressing the result as a fraction versus a decimal
fractions(gFunc(-3))
## [1] -2

Thus \(f(-3) = -4\) and \(g(-3) = -2\).

For the arithmetic operations of addition, subtraction, multiplication, and division we would then assert that:

\[ \begin{align} f(-3) + g(-3) &= -4 + -2 = -6 \\ f(-3) - g(-3) &= -4 - -2 = -2 \\ f(-3)g(-3) &= -4(-2) = 8 \\ \frac{f(-3)}{g(-3)} &= \frac{-4}{-2} = 2 \end{align} \]

To verify our assertions, let’s explore the actual functions formed by the algebraic combination of the two functions, \(f(x)\) and \(g(x)\), under the arithmetic operations of addition, subtraction, multiplication, and division. The algebraic sum of these two functions was found to be \((f + g)(x) = 3x + 3\). Evaluating \((f + g)(-3)\):

# define the sum function being sure to enter the function using ASCII notation
theSumFunction <- function(x){3*x + 3}
# evaluate it at x = -3, expressing the result as a fraction versus a decimal
fractions(theSumFunction(-3))
## [1] -6

Thus, \((f + g)(-3) = -6\), which matches our assertion. The algebraic difference of these two functions was found to be \((f - g)(x) = -x - 5\). Evaluating \((f - g)(-3)\):

# define the difference function being sure to enter the function using ASCII notation
theDiffFunction <- function(x){-x - 5}
# evaluate it at x = -3, expressing the result as a fraction versus a decimal
fractions(theDiffFunction(-3))
## [1] -2

Thus, \((f - g)(-3) = -2\), which matches our assertion. The algebraic product of these two functions was found to be \((fg)(x) = 2x^{2} + 2x - 4\). Evaluating \((fg)(-3)\):

# define the difference function being sure to enter the function using ASCII notation
theProdFunction <- function(x){2*x^2 + 2*x - 4}
# evaluate it at x = -3, expressing the result as a fraction versus a decimal
fractions(theProdFunction(-3))
## [1] 8

Thus, \((fg)(-3) = 8\), which matches our assertion. The algebraic quotient of these two functions was found to be \(\left(\frac{f}{g}\right)(x) = \frac{x-1}{2x+4}\). Evaluating \(\left(\frac{f}{g}\right)(-3)\):

# define the difference function being sure to enter the function using ASCII notation
theQuotFunction <- function(x){(x - 1) / (2*x + 4)}
# evaluate it at x = -3, expressing the result as a fraction versus a decimal
fractions(theQuotFunction(-3))
## [1] 2

Thus, \(\left(\frac{f}{g}\right)(-3) = 2\), which matches our assertion.

Using the input, \(x = -3\), our assertion that \((f + g)(x) = f(x) + g(x)\), \((f - g)(x) = f(x) - g(x)\), \((fg)(x) = f(x)g(x)\), and \(\left(\frac{f}{g}\right)(x) = \frac{f(x)}{g(x)}\text{, } g(x) \ne 0\) was verified. And, this example also highlights the fact that when asked to evaluate an arithmetically combined function at a particular input value, you don’t necessarily need to find what this newly created function is, you can just evaluate the individual functions at the particular input value then combine them together under the specified arithmetic operation(s).

To show that this example was not a one-off, a routine, verifyArithComboFunctions.R was self developed to verify the arithmetic combination of two functions, \(f\) and \(g\). It first evaluates the two functions, \(f\) and \(g\), individually for a series of inputs then sums, subtracts, multiplies, and divides them. The routine then takes the arithmetically combined functions, \((f + g)(x)\), \((f -g)(x)\), \((fg)(x)\), and \(\left(\frac{f}{g}\right)(x)\) and evaluates each at the same input values. The results of the adding, subtracting, multiplying, and dividing the outputs of the individual function outputs should match the outputs of the respective newly created functions outputs. The routine produces a table of the results. Let’s see how this works for these two functions, \(f(x) = x - 1\) and \(g(x) = 2x + 4\):

df <- verifyArithComboFunctions('x-1',             # f(x)
                                '2*x+4',           # g(x)
                                '3*x+3',           # (f + g)(x)
                                '-x-5',            # (f - g)(x)
                                '2*x^2 + 2*x - 4', # (fg)(x)
                                '(x-1)/(2*x+4)',   # (f/g)(x)
                                -5,-3,0.5)
kbl(df,
    caption = "Table Verifying The Arithmetic Combination Of Functions", booktabs = TRUE) %>% kable_paper()
Table Verifying The Arithmetic Combination Of Functions
x fOfx gOfx outSum outDiff outProd outDiv Add Sub Prod Div
-5.0 -6.0 -6 -12.0 0.0 36.0 1.00 -12.0 0.0 36.0 1.00
-4.5 -5.5 -5 -10.5 -0.5 27.5 1.10 -10.5 -0.5 27.5 1.10
-4.0 -5.0 -4 -9.0 -1.0 20.0 1.25 -9.0 -1.0 20.0 1.25
-3.5 -4.5 -3 -7.5 -1.5 13.5 1.50 -7.5 -1.5 13.5 1.50
-3.0 -4.0 -2 -6.0 -2.0 8.0 2.00 -6.0 -2.0 8.0 2.00

The table has eleven columns. The first column (heading x) shows, the input values, \(x \in [-5,-3]\). The second column (heading fOfx) shows the output of \(f(x) = x - 1\). The second column (heading gOfX) shows the output of \(g(x) = 2x + 4\). Columns four to seven, outSum, outDiff, outProd, and outDiv, show the sum, difference, product, and quotient of \(f(x)\) and \(g(x)\), respectively. The last four columns, Add, Sub, Prod, and Div show the output of the algebraically formed function under the operations of addition, subtraction, multiplication, and division, respectfully. The values in the four columns, outSum, outDiff, outProd, and outDiv should match the values in the four columns, Add, Sub, Prod, and Div. They do! (Note, the last row in the table is for the input \(x = -3\) which produced the same results we saw earlier.)

The R code for the self-developed routine verifyArithComboFunctions.R is provided at the end of this appendix.


??.2 The Arithmetic Operations of Two or More Functions, Definition And Evaluation

Now that we’ve explored the arithmetic combination of two functions, let’s explore applying these arithmetic combinations to two or more functions using Example ??.9 in Chapter ??. In that example, five functions were given: \(f(x) = x - 2\), \(g(x) = x + 2\), \(h(x) = x -1\), \(j(x) = x + 1\), \(k(x) = x - 3\), and \(p(x) = x + 3\) and it was asked to find \(\left(fg + \frac{h}{j} - \frac{k}{p}\right)(1)\).

Based on our understanding of the arithmetic combination of functions, \(\left(fg + \frac{h}{j} - \frac{k}{p}\right)(1)\). can be found by either first finding the newly formed function, \(\left(fg + \frac{h}{j} - \frac{k}{p}\right)(x)\) and then evaluating it at \(x = 1\); or by evaluating each individual function at \(x = 1\) and then combining their outputs together as specified.

It was found in Example ??.9 in Chapter ?? that the newly created function \(\left(fg + \frac{h}{j} - \frac{k}{p}\right)(x)\) was \(\frac{x^{4} + 4x^{3} - x^{2} - 12x - 12}{x^{2} + 4x + 3}\) and that when evaluated at \(x = 1\), produced the output \(\left(fg + \frac{h}{j} - \frac{k}{p}\right)(1) = -\frac{5}{2}\). Let’s verify this:

# define the arithmetically combined function being sure to enter the function using ASCII notation
theCombinedFunction <- function(x){(x^4 + 4*x^3 - x^2 - 12*x - 12) / (x^2 + 4*x + 3)}
# evaluate it at x = 1, expressing the result as a fraction versus a decimal
fractions(theCombinedFunction(1))
## [1] -5/2

The expected output was matched! Now, let’s find \(\left(fg + \frac{h}{j} - \frac{k}{p}\right)(1)\) via the alternative method of evaluating each individual function at \(x = 1\) and then combining their outputs together as specified. That is:

\[ \left(fg + \frac{h}{j} - \frac{k}{p}\right)(1) = f(1)g(1) + \frac{h(1)}{g(1)}- \frac{k(1)}{p(1)} \]

# define the individual functions being sure to enter the function using ASCII notation
fFunc <- function(x){x - 2}
gFunc <- function(x){x + 2}
hFunc <- function(x){x - 1}
jFunc <- function(x){x + 1}
kFunc <- function(x){x - 3}
pFunc <- function(x){x + 3}
# evaluate the individual functions at x = 1
fOf1  <- fFunc(1)
gOf1  <- gFunc(1)
hOf1  <- hFunc(1)
jOf1  <- jFunc(1)
kOf1  <- kFunc(1)
pOf1  <- pFunc(1)
# combine aritmetically 
fractions(fOf1*gOf1 + (hOf1/gOf1) - (kOf1/pOf1))
## [1] -5/2

The answers match, as they should, thus verifying that

\[ \left(fg + \frac{h}{j} - \frac{k}{p}\right)(x) = f(x)g(x) + \frac{h(x)}{g(x)}- \frac{k(x)}{p(x)} \]


??.3 Verifying The Domain Of The Arithmetic Combination Of Two Or More Functions

The new function generated by the arithmetic combination of two or more functions has a domain which is the intersection of the domains of the individual functions. Let’s explore a few examples to verify this.

Analysis of Chapter ??, Examples ??.1, ??.?, ??.?, and ??.?

Given the two simple functions used in Examples ??.1, ??.?, ??.?, and ??.? in Chapter ??: \(f(x) = x - 1\) and \(g(x) = 2x + 4\), each individual function has a domain of all real numbers. Combining these functions together via the arithmetic operations of addition, subtraction, and multiplication would, therefore, also have a domain of all real numbers. The problem, however, occurs when combining them together via the operation of division. In this case, the extra concern (above the domains of the individual functions) is that no input to the newly formed function can cause \(g(x)\) to produce an output of zero, for it is in the denominator. That is, the newly created function, \(\left(\frac{f}{g}\right)(x)\) is valid for all \(x\) in the domain as determined by the intersection of the domains of the individual functions and when \(g(x) \ne 0\). In this case that when \(x = -2\), \(g(x)\) would be zero meaning that, in this example, the domain of \(\left(\frac{f}{g}\right)(x)\) would be all real numbers except \(x = 2\), or in interval notation, \((-\infty,-2) \cup (-2,\infty)\). Let’s verify this:

# define the difference function being sure to enter the function using ASCII notation
theQuotFunction <- function(x){(x - 1) / (2*x + 4)}
# evaluate it at x = -2, expressing the result as a fraction versus a decimal
fractions(theQuotFunction(-2))
## [1] -Inf

The result Inf (positive or negative doesn’t matter) indicates a division by zero, thus confirming that \(x = -2\) is not in the domain of \(\left(\frac{f}{g}\right)(x)\). To further explore this, let’s use the self-developed routine verifyArithComboFunctions.R (which we already saw above) for inputs \(x \in [-3,-1]\):

df <- verifyArithComboFunctions('x-1',             # f(x)
                                '2*x+4',           # g(x)
                                '3*x+3',           # (f + g)(x)
                                '-x-5',            # (f - g)(x)
                                '2*x^2 + 2*x - 4', # (fg)(x)
                                '(x-1)/(2*x+4)',   # (f/g)(x)
                                -3,-1,0.5)
kbl(df,
    caption = "Table Verifying The Arithmetic Combination Of Functions", booktabs = TRUE) %>% kable_paper()
Table Verifying The Arithmetic Combination Of Functions
x fOfx gOfx outSum outDiff outProd outDiv Add Sub Prod Div
-3.0 -4.0 -2 -6.0 -2.0 8.0 2.0 -6.0 -2.0 8.0 2.0
-2.5 -3.5 -1 -4.5 -2.5 3.5 3.5 -4.5 -2.5 3.5 3.5
-2.0 -3.0 0 -3.0 -3.0 0.0 -Inf -3.0 -3.0 0.0 -Inf
-1.5 -2.5 1 -1.5 -3.5 -2.5 -2.5 -1.5 -3.5 -2.5 -2.5
-1.0 -2.0 2 0.0 -4.0 -4.0 -1.0 0.0 -4.0 -4.0 -1.0

Notice that for all inputs every arithmetic operation produced an output except when \(x = -2\). At \(x = -2\), every arithmetic operation produced an output except for \(x = -2\), which had Inf for the division output. The reason for this can be seen when noticing what the output of \(g(-2)\) was - it was zero.

Analysis of Chapter ??, Example ??.8

The two functions given were: \(f(x) = \frac{2x - 1}{x-2}\) and \(g(x) = \frac{x+3}{x+4}\) and the task was to evaluate \(\left(\frac{f}{g}\right)(x)\) at \(x = -1\). That was found to be \(\left(\frac{f}{g}\right)(-1) = \frac{3}{2}\). The actual function \(\left(\frac{f}{g}\right)(x)\) was determined to be \(\left(\frac{f}{g}\right)(x) = \frac{2x^{2} + 7x - 4}{x^{2} + x -6}\). The domain of \(\left(\frac{f}{g}\right)(x)\) was found to be \((-\infty,-4) \cup (-4,-3) \cup (-3,2) \cup (2,\infty)\). Let’s explore this all.

First, let’s evaluate each function at \(x = -1\), starting with \(f(x)\):

# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){(2*x - 1)/(x - 2)}
# evaluate it at x = -1, expressing the result as a fraction versus a decimal
fractions(fFunc(-1))
## [1] 1

And, then evaluate \(g(-1)\):

# define the function g(x) being sure to enter the function using ASCII notation
gFunc <- function(x){(x + 3)/(x+4)}
# evaluate it at x = -1, expressing the result as a fraction versus a decimal
fractions(gFunc(-1))
## [1] 2/3

Now, let’s find \(\left(\frac{f}{g}\right)(-1) = \frac{f(-1)}{g(-1)}\)

# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){(2*x - 1)/(x - 2)}
# define the function g(x) being sure to enter the function using ASCII notation
gFunc <- function(x){(x + 3)/(x+4)}
# evaluate each at x = -1
fOfNeg1 = fFunc(-1)
gOfNeg1 = gFunc(-1)
# now find f(-1) / g(-1)
fractions(fOfNeg1 / gOfNeg1)
## [1] 3/2

Thus, we verified that \(\left(\frac{f}{g}\right)(-1) = \frac{3}{2}\) by evaluating the two individual functions, \(f\) and \(g\), at \(x = -1\) and then taking their quotient. Now, let’s verify the actual function \(\left(\frac{f}{g}\right)(x) = \frac{2x^{2} + 7x - 4}{x^{2} + x -6}\) at \(x = -1\):

# define the function f(x)/g(x) being sure to enter the function using ASCII notation
quotFunc <- function(x){(2*x^2 + 7*x - 4) / (x^2 + x - 6)}
# evaluate it at x = -1, expressing the result as a fraction versus a decimal
fractions(quotFunc(-1))
## [1] 3/2

We verified that \(\left(\frac{f}{g}\right)(-1) = \frac{3}{2}\) by evaluating the actual function, \(\left(\frac{f}{g}\right)(x)\) at \(x = -1\). This matches the result found by evaluating the two individual functions, \(f\) and \(g\), at \(x = -1\) and then taking their quotient, as it should!

Note, we could have just entered the two functions, \(f\) and \(g\), and divided them within the function definition. Pretty cool!

# define the function f(x)/g(x) being sure to enter the function using ASCII notation
quotFunc <- function(x){((2*x - 1)/(x-2)) / ((x+3)/(x+4))}
# evaluate it at x = -1, expressing the result as a fraction versus a decimal
fractions(quotFunc(-1))
## [1] 3/2

Now, let’s explore the domain of \(\left(\frac{f}{g}\right)(x)\). As the schematic for the arithmetic combination of functions shows quite clearly, the input, \(x\), goes into both functions, \(f\) and \(g\), simultaneously. The immediate consequence of this is that any input into \(\left(\frac{f}{g}\right)(x)\) must be valid for both functions;, i.e., any input must be in the domain of both functions, \(f\) and \(g\). Looking at the function, \(f(x)\), it is clear that its domain is all real numbers except \(x = 2\). Let’s verify that \(x = 2\) is not in the domain of \(f(x)\):

# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){(2*x - 1)/(x - 2)}
# evaluate it at x = 2, expressing the result as a fraction versus a decimal
fractions(fFunc(2))
## [1] Inf

As expected, the result was Inf which, again, means in this context that a division of zero occurred. Thus, \(x = 2\) is not in the domain of \(f(x)\). Looking at the function, \(g(x)\), it is clear that its domain is all real numbers except \(x = -4\). Let’s verify that \(x = -4\) is not in the domain of \(g(x)\):

# define the function g(x) being sure to enter the function using ASCII notation
gFunc <- function(x){(x + 3)/(x+4)}
# evaluate it at x = -4, expressing the result as a fraction versus a decimal
fractions(gFunc(-4))
## [1] -Inf

As expected, the result was Inf (positive or negative does matter here) which, again, means in this context that a division of zero occurred. Thus, \(x = -4\) is not in the domain of \(g(x)\). Taking the intersection of these two limitations we conclude that the domain of \(\left(\frac{f}{g}\right)(x)\) is all real numbers except \(x = 2\) and \(x = -4\), or in interval notation, \((-\infty, -4) \cup (-4, 2) \cup (2,\infty)\).

Ah, but we missed one not so little detail. Remember the function, \(\left(\frac{f}{g}\right)(x)\), also has the restriction, \(g(x) \ne 0\). This means that any input, \(x\), that would cause the function, \(g\), to produce zero as the output would, therefore, not be in the domain of \(\left(\frac{f}{g}\right)(x)\). It was shown in Example ??.8, that \(x = -3\) is the (only) input that would cause \(g\) to produce an output of zero. Let’s verify this:

# define the function g(x) being sure to enter the function using ASCII notation
gFunc <- function(x){(x + 3)/(x+4)}
# evaluate it at x = -3, expressing the result as a fraction versus a decimal
fractions(gFunc(-3))
## [1] 0

Thus, \(g(-3) = 0\) and \(x = -3\) must be included as an input invalid for \(\left(\frac{f}{g}\right)(x)\). Taking the intersection of all the restrictions on \(\left(\frac{f}{g}\right)(x)\) we now conclude that the the domain of \(\left(\frac{f}{g}\right)(x)\) is all real numbers except \(x = 2\), \(x = -4\) and \(x = -3\), or in interval notation, \((-\infty, -4) \cup (-4,-3) \cup (-3,2) \cup (2,\infty)\).

Let’s verify this by entering these values of \(x\) into the function, \(\left(\frac{f}{g}\right)(x)\), directly (which is always a good practice to acquire) starting with \(x = -3\):

# define the function f(x)/g(x) being sure to enter the function using ASCII notation
quotFunc <- function(x){(2*x^2 + 7*x - 4) / (x^2 + x - 6)}
# evaluate it at x = -3, expressing the result as a fraction versus a decimal
fractions(quotFunc(-3))
## [1] -Inf

The value of \(x = -3\) is verified to not be in the domain of \(\left(\frac{f}{g}\right)(x)\). Now, let’s verify \(x = 2\):

# define the function f(x)/g(x) being sure to enter the function using ASCII notation
quotFunc <- function(x){(2*x^2 + 7*x - 4) / (x^2 + x - 6)}
# evaluate it at x = 2, expressing the result as a fraction versus a decimal
fractions(quotFunc(2))
## [1] Inf

The value of \(x = 2\) is verified to not be in the domain of \(\left(\frac{f}{g}\right)(x)\). Now, let’s verify \(x = -4\):

# define the function f(x)/g(x) being sure to enter the function using ASCII notation
quotFunc <- function(x){(2*x^2 + 7*x - 4) / (x^2 + x - 6)}
# evaluate it at x = -4, expressing the result as a fraction versus a decimal
fractions(quotFunc(-4))
## [1] 0

Whoa! When \(x = -4\) was the input to \(\left(\frac{f}{g}\right)(x) = \frac{2x^{2} + 7x - 4}{x^{2} + x -6}\) directly, the unexpected happened. Instead of getting verification that a division by zero occurred, we see that a zero was produced. This would seem to indicate that \(x = -4\) is in the domain of \(\left(\frac{f}{g}\right)(x)\). As explained in Example ??.8, the reason for this was when algebraically finding \(\left(\frac{f}{g}\right)(x)\) what would have caused a division by zero was lost. But, that does not mean that the fact that \(x = -4\) is invalid for \(g\) can be ignored. It cannot! Since this was all explained in Example ??.8, along with a graphic, it will not be repeated here. What we did here was the verification of the conclusions of Example ??.8 thus solidifying the all important resulting Concept that relying on just the actual newly found function may be risky for it may not tell the whole story! It is repeated here for convenience:


CONCEPT: It can often be risky to rely solely on just what the domain appears to be of the newly found function.


To help put all this into perspective, let’s use the self-developed routine verifyArithComboFunctions.R (which we already saw above) for inputs \(x \in [-5,3]\) so as to be sure to capture all the supposed invalid inputs to \(\left(\frac{f}{g}\right)(x)\):

df <- verifyArithComboFunctions('(2*x - 1)/(x - 2)',               # f(x)
                                '(x+3)/(x+4)',                     # g(x)
                                '(2*x - 1)/(x - 2) + (x+3)/(x+4)', # (f + g)(x)
                                '(2*x - 1)/(x - 2) - (x+3)/(x+4)', # (f - g)(x)
                                '(2*x - 1)/(x - 2) * (x+3)/(x+4)', # (fg)(x)
                                '(2*x^2 + 7*x-4)/(x^2+x-6)',       # (f/g)(x)
                                -3,3,0.5)
kbl(df,
    caption = "Table Verifying The Arithmetic Combination Of Functions", booktabs = TRUE) %>% kable_paper()
Table Verifying The Arithmetic Combination Of Functions
x fOfx gOfx outSum outDiff outProd outDiv Add Sub Prod Div
-3.0 1.400000 0.0000000 1.4000000 1.4000000 0.0000000 Inf 1.4000000 1.4000000 0.0000000 -Inf
-2.5 1.333333 0.3333333 1.6666667 1.0000000 0.4444444 4.0000000 1.6666667 1.0000000 0.4444444 4.0000000
-2.0 1.250000 0.5000000 1.7500000 0.7500000 0.6250000 2.5000000 1.7500000 0.7500000 0.6250000 2.5000000
-1.5 1.142857 0.6000000 1.7428571 0.5428571 0.6857143 1.9047619 1.7428571 0.5428571 0.6857143 1.9047619
-1.0 1.000000 0.6666667 1.6666667 0.3333333 0.6666667 1.5000000 1.6666667 0.3333333 0.6666667 1.5000000
-0.5 0.800000 0.7142857 1.5142857 0.0857143 0.5714286 1.1200000 1.5142857 0.0857143 0.5714286 1.1200000
0.0 0.500000 0.7500000 1.2500000 -0.2500000 0.3750000 0.6666667 1.2500000 -0.2500000 0.3750000 0.6666667
0.5 0.000000 0.7777778 0.7777778 -0.7777778 0.0000000 0.0000000 0.7777778 -0.7777778 0.0000000 0.0000000
1.0 -1.000000 0.8000000 -0.2000000 -1.8000000 -0.8000000 -1.2500000 -0.2000000 -1.8000000 -0.8000000 -1.2500000
1.5 -4.000000 0.8181818 -3.1818182 -4.8181818 -3.2727273 -4.8888889 -3.1818182 -4.8181818 -3.2727273 -4.8888889
2.0 Inf 0.8333333 Inf Inf Inf Inf Inf Inf Inf Inf
2.5 8.000000 0.8461538 8.8461538 7.1538462 6.7692308 9.4545455 8.8461538 7.1538462 6.7692308 9.4545455
3.0 5.000000 0.8571429 5.8571429 4.1428571 4.2857143 5.8333333 5.8571429 4.1428571 4.2857143 5.8333333

The rows for \(x = -4\), \(x = -3\), and \(x = 2\) clearly show what was discussed above. I will leave it to the reader to study this output and make sure that it is understood.

(Disclaimer: In full disclosure, I was perplexed by the row for \(x = -4\) where under the column outDiv it had a zero instead of what I was expecting which was Inf. This column reflects the actual quotient of \(\frac{f(x)}{g(x)}\) for a given \(x\). So, I did some investigation. First I tried to replicated what the table showed by doing the calculations myself):

# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){(2*x - 1)/(x - 2)}
# define the function g(x) being sure to enter the function using ASCII notation
gFunc <- function(x){(x + 3)/(x+4)}
# evaluate each at x = -4
fOfNeg4 = fFunc(-4)
gOfNeg4 = gFunc(-4)
# now find f(-4) / g(-4)
fractions(fOfNeg4 / gOfNeg4)
## [1] 0

(Again, much to my surprise the same result was seen. To further explore this, I modified the above to see what each of the functions’ output was for \(x = -4\))

# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){(2*x - 1)/(x - 2)}
# define the function g(x) being sure to enter the function using ASCII notation
gFunc <- function(x){(x + 3)/(x+4)}
# evaluate each at x = -4
fOfNeg4 = fFunc(-4)
cat('\nfOfNeg4',fOfNeg4,'\n')
## 
## fOfNeg4 1.5
gOfNeg4 = gFunc(-4)
cat('\ngOfNeg4',gOfNeg4,'\n')
## 
## gOfNeg4 -Inf
myDiv <- 1.5 / 0
cat('\nmyDiv',myDiv,'\n')
## 
## myDiv Inf
# now find f(-4) / g(-4)
fractions(fOfNeg4 / gOfNeg4)
## [1] 0

(Clearly \(g(-4)\) was what was expected but not the division. I even did the computation of 1.5 / 0 directly and got the expected Inf. My suspicion, or conclusion, is that R actually first did the division of the two functions before the evaluation at \(x = -4\); this would explain the result seen. I will have to investigate this further.)


Hopefully, these examples help solidify the concepts of Chapter ?? and impressed on you the importance, and value, understanding of how the arithmetic combination of functions works, how to evaluate them, and their domains. The schematic for the two function case is a valuable tool to assist in your understanding and can be used to extend that understanding to more than two functions. You are highly encouraged to do more examples on your own.


??.4 R Code

The R code for the self-developed routine verifyArithComboFunctions.R that verifies the arithmetic combination of functions, \((f + g)(x)\), \((f - g)(x)\), \((fg)(x)\), and \(\left(\frac{f}{g}\right)(x)\), \(g(x) \ne 0\):

verifyArithComboFunctions <- function(fFunc,
                                      gFunc,
                                      aFunc,
                                      sFunc,
                                      pFunc,
                                      dFunc,
                                      xLower,
                                      xUpper,
                                      increment = 0.1) {
  # This routine will verify the workings of the arithmetic combination of
  # TWO functions.
  #
  # first generate the input to be used for evaluation
  xValues <- seq(xLower,xUpper,by=increment)
  # evaluate the functions at the just generated input values
  fOfx         <- sapply(xValues, function(x) eval(parse(text = fFunc)))
  gOfx         <- sapply(xValues, function(x) eval(parse(text = gFunc)))
  aOfx         <- sapply(xValues, function(x) eval(parse(text = aFunc)))
  sOfx         <- sapply(xValues, function(x) eval(parse(text = sFunc)))
  pOfx         <- sapply(xValues, function(x) eval(parse(text = pFunc)))
  dOfx         <- sapply(xValues, function(x) eval(parse(text = dFunc)))
  # store in data frames
  dfOutAdd     <- data.frame( "x" = xValues, "y" = fOfx + gOfx)
  dfOutMinus   <- data.frame( "x" = xValues, "y" = fOfx - gOfx)
  dfOutProd    <- data.frame( "x" = xValues, "y" = fOfx * gOfx)
  dfOutDiv     <- data.frame( "x" = xValues, "y" = fOfx / gOfx)
  dfAdd        <- data.frame( "x" = xValues, "y" = aOfx)
  dfSub        <- data.frame( "x" = xValues, "y" = sOfx)
  dfProd       <- data.frame( "x" = xValues, "y" = pOfx)
  dfDiv        <- data.frame( "x" = xValues, "y" = dOfx)
  # now merge the data frames into one
  dfArithCombo <- data.frame("x"      = xValues,
                            "fOfx"   = fOfx,
                            "gOfx"   = gOfx,
                            "outSum" = dfOutAdd$y,
                            "outDiff" = dfOutMinus$y,
                            "outProd" = dfOutProd$y,
                            "outDiv" = dfOutDiv$y,
                            "Add"     = dfAdd$y,
                            "Sub"     = dfSub$y,
                            "Prod"     = dfProd$y,
                            "Div"     = dfDiv$y)
  # return the data frame
  return(dfArithCombo)
}

Return To Table Of Contents


.

Appendix ??

Composite Functions

In Chapter ??, we explored the concepts of a composite function of two or more individual functions, how it is created, the various means to evaluate it, and, not least of all, how to find the domain of a composite function. The composite function schematic played a key role in the general understanding of a composite function as well as in the evaluation and finding the domain of a composite function. All this was explored from a mathematical (algebraic) perspective. In this appendix we will explore how some of these ideas are handled in a practical, applied sense as well as how they can be used to verify the concepts developed in the chapter.


??.1 Composite Function Definition And Evaluation

The key concept of a composite function is that the output of one function becomes the input to the next function in the composite function chain. The composite function schematic plays a key role in this understanding. We will consider two cases: A composite function of two individual functions, \(f(x)\) and \(g(x)\), \((f \circ g)(x)\); and, a composite function of three individual functions, \(f(x)\), \(g(x)\), and \(h(x)\), \((f \circ g \circ h)(x)\).


??.1.1 Composite Function Definition And Evaluation, Two Functions

For a composite of two individual functions, \(f(x)\) and \(g(x)\), a corresponding composite function could be \((f \circ g)(x)\). The composite function schematic for \((f \circ g)(x)\) is:

The input, \(x\), first enters the first function in the chain, \(g\). The output of \(g\), \(g(x)\), then enters the second function, \(f\), which then produces the composite function output \((f \circ g)(x) = f(g(x))\).

Let’s explore this idea with the two simple functions used in Example ??.5 in Chapter ??: \(f(x) = -x^{2} - x + 5\) and \(g(x) = -\frac{1}{2}x - 2\); the resulting composite function is \((f \circ g)(x) = -\frac{1}{4}x^{2} - \frac{3}{2}x + 3\). In that example we saw that the composite function evaluated at \(x = 1\) was \(\frac{5}{4}\). This was determined via first finding the composite function itself then evaluating it at \(x = 1\), or by using the composite function schematic which shows the path through the composite function taken by the input \(x = 1\):

Now let’s verify these ideas. First let’s show that the output of the composite function, \((f \circ g)(x) = -\frac{1}{4}x^{2} - \frac{3}{2}x + 3\) is indeed \(\frac{5}{4}\) using the following R code:

# define the composite function being sure to enter the function using ASCII notation
theCompositeFunction <- function(x){-(1/4)*x^{2} - (3/2)*x + 3}
# evaluate it at x = 1, expressing the result as a fraction versus a decimal
fractions(theCompositeFunction(1))
## [1] 5/4

As we expected, \((f \circ g)(1) = \frac{5}{4}\).

Next, let’s verify that the output of one function becomes the input to the next function in the composite chain. To do this, let’s evaluate \(g\) at \(x = 1\):

# define the function g(x) being sure to enter the function using ASCII notation
gFunc <- function(x){-(1/2)*x - 2}
# evaluate it at x = 1, expressing the result as a fraction versus a decimal
fractions(gFunc(1))
## [1] -5/2

This output, the expected \(g(1) = -\frac{5}{2}\) will now become the input to the function \(f\):

# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){-x^2 - x + 5}
# evaluate it at x = -5/2, expressing the result as a fraction versus a decimal
fractions(fFunc(-5/2))
## [1] 5/4

This output of \(\frac{5}{4}\) is the expected output of \((f \circ g)(1)\).

To really hit home the concept of a composite function being a chain of functions, chained in such a way that the output of one becomes the input to the next function in the chain, we can accomplish this using the pipe feature of R where the output of one command gets piped into the next command:

# define the function g(x) being sure to enter the function using ASCII notation
gFunc <- function(x){-(1/2)*x - 2}
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){-x^2 - x + 5}
# create the chain beginning with x = 1, entering the function g whose output is then PIPED into the function f,
# expressing the result as a fraction versus a decimal
fractions(gFunc(1) |> fFunc())
## [1] 5/4

This last bit of R code clearly verifies the concept of how a composite function works.

To show that this example was not a one-off, a routine, verifyCompositeFunction.R was developed which evaluates \(g\) at many input values, then takes these outputs and evaluates the second function, \(f\), with these at the inputs. It also evaluates the composite function itself at the same input values that went into \(g\). A table is created that shows the results:

# define the functions g(x), f(x), and (f o g)(x)
gFunc       <- '-(1/2)*x - 2'
fFunc       <- '(-1)*x^2 - x + 5'
cFunc       <- '-(1/4)*x^2 - (3/2)*x + 3'
# set the lower and upper intervals for the input values
xLower      <- 0
xUpper      <- 2
# call verifyCompositeFunction() returning the results in a data frame
df <- verifyCompositeFunction(fFunc,
                              gFunc,,
                              cFunc,
                              xLower,xUpper)
# create the tabled output
kbl(df,
    caption = "Table Verifying How A Composite Function Works", booktabs = TRUE) %>% kable_paper()
Table Verifying How A Composite Function Works
x gOfx fOfgOfx compositeOfx
0.0 -2.00 3.0000 3.0000
0.1 -2.05 2.8475 2.8475
0.2 -2.10 2.6900 2.6900
0.3 -2.15 2.5275 2.5275
0.4 -2.20 2.3600 2.3600
0.5 -2.25 2.1875 2.1875
0.6 -2.30 2.0100 2.0100
0.7 -2.35 1.8275 1.8275
0.8 -2.40 1.6400 1.6400
0.9 -2.45 1.4475 1.4475
1.0 -2.50 1.2500 1.2500
1.1 -2.55 1.0475 1.0475
1.2 -2.60 0.8400 0.8400
1.3 -2.65 0.6275 0.6275
1.4 -2.70 0.4100 0.4100
1.5 -2.75 0.1875 0.1875
1.6 -2.80 -0.0400 -0.0400
1.7 -2.85 -0.2725 -0.2725
1.8 -2.90 -0.5100 -0.5100
1.9 -2.95 -0.7525 -0.7525
2.0 -3.00 -1.0000 -1.0000

The table has four columns. The first column (heading x) shows, the input values, \(x \in [0,2]\). The second column (heading gOfX) shows the output of \(g(x) = -\frac{1}{2}x - 2\) (the first function in the composite function chain) evaluated at the given input values of \(x\) (in column 1). The third column (heading fOfgOfx) shows these output values evaluated by \(f(x) = -x^{2} - x + 5\). These output values (allegedly) are the output of the composite function. The last column (heading compositeOfx) are the output of the composite function itself, \((f \circ g)(x) = -\frac{1}{4}x^{2} - \frac{3}{2}x + 3\) evaluated at the given input values of \(x\) (in column 1).

The values in the third column (fOfgOfx) and the fourth column (compositeOfx) match. They are the same. Thus the idea that the output of the first function becomes the input to the second function has been verified.

The R code for the self-developed routine verifyCompositeFunction.R is provided at the end of this appendix.


??.1.2 Composite Function Definition And Evaluation, Three Functions

For a composite of three individual functions, \(f(x)\), \(g(x)\), and \(h(x)\), a corresponding composite function could be \((f \circ g \circ h)(x)\). The composite function schematic for \((f \circ g \circ h)(x)\) is:

The input, \(x\), first enters the first function in the chain, \(h\). The output of \(h\), \(h(x)\), then enters the second function, \(g\), which then produces the output \(g(h(x))\). This output enters the third function in the chain, \(f\), which produces the composite function output \((f \circ g \circ h)(x) = f(g(h(x)))\).

Let’s explore this idea with the three functions used in Example ??.15 in Chapter ??: \(f(x) = \frac{x + 3}{x-2}\), \(g(x) = \frac{x-1}{x-3}\), and \(h(x) = \frac{x-4}{x+5}\); the resulting composite function is \((f \circ g \circ h)(x) = \frac{-6x - 66}{4x + 29}\). In that example we saw that the composite function evaluated at \(x = -1\) was \(-\frac{12}{5}\). This was determined via first finding the composite function itself then evaluating it at \(x = -1\), or by using the composite function schematic which shows the path through the composite function taken by the input \(x = -1\):

Now let’s verify these ideas. First let’s show that the output of the composite function, \((f \circ g \circ h)(x) = \frac{-6x - 66}{4x + 29}\) is indeed \(-\frac{12}{5}\) using the following R code:

# define the composite function being sure to enter the function using ASCII notation
theCompositeFunction <- function(x){(-6*x - 66)/(4*x + 29)}
# evaluate it at x = -1, expressing the result as a fraction versus a decimal
fractions(theCompositeFunction(-1))
## [1] -12/5

As we expected, \((f \circ g \circ h)(-1) = -\frac{12}{5}\).

In the example ??.15 it was found that \(h(-1) = -\frac{5}{4}\), \(g(h(-1)) = g\left(-\frac{5}{4}\right) = \frac{9}{17}\), and \(f(g(h(-1))) = f\left(\frac{9}{17}\right) = \frac{9}{17}\). Let’s verify that the output of one function becomes the input to the next function in the composite chain by first evaluating \(h\) at \(x = -1\):

# define the function h(x) being sure to enter the function using ASCII notation
hFunc <- function(x){(x-4)/(x+5)}
# evaluate it at x = -1, expressing the result as a fraction versus a decimal
fractions(hFunc(-1))
## [1] -5/4

This agrees with what we found. Following the path through the composite function schematic, let’s evaluate the function \(g\) at \(-\frac{5}{4}\):

# define the function g(x) being sure to enter the function using ASCII notation
gFunc <- function(x){(x-1)/(x-3)}
# evaluate it at x = -5/4, expressing the result as a fraction versus a decimal
fractions(gFunc(-5/4))
## [1] 9/17

This agrees with what we found. And, finally, let’s evaluate \(f\) at \(\frac{9}{17}\):

# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){(x+3)/(x-2)}
# evaluate it at x = 9/17, expressing the result as a fraction versus a decimal
fractions(fFunc(9/17))
## [1] -12/5

This output of \(-\frac{12}{5}\) is the expected output of \((f \circ g \circ h)(-1)\).

To really hit home the concept of a composite function being a chain of functions, chained in such a way that the output of one becomes the input to the next function in the chain, we can accomplish this using the pipe feature of R where the output of one command gets piped into the next command:

# define the function h(x) being sure to enter the function using ASCII notation
hFunc <- function(x){(x-4)/(x+5)}
# define the function g(x) being sure to enter the function using ASCII notation
gFunc <- function(x){(x-1)/(x-3)}
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){(x+3)/(x-2)}
# create the chain beginning with x = -1, entering the function h whose output is then PIPED into the function g,
# whose output is then PIPED into the function f, expressing the result as a fraction versus a decimal
fractions(hFunc(-1) |> gFunc() |> fFunc())
## [1] -12/5

To show that this example was not a one-off, a routine, verifyCompositeFunction.R was developed which evaluates \(h\) at many input values, then takes these outputs and evaluates the second function, \(g\), with these at the inputs, and then evaluates the third function, \(f\), with these as the inputs. It also evaluates the composite function itself at the same input values that went into \(h\). A table is created that shows the results:

# define the functions g(x), f(x)$, and (f o g)(x), being sure to enter the functions using ASCII notation
hFunc       <- '(x-4)/(x+5)'
gFunc       <- '(x-1)/(x-3)'
fFunc       <- '(x+3)/(x-2)'
cFunc       <- '(-6*x - 66)/(4*x + 29)'
# set the lower and upper intervals for the input values
xLower      <- -1
xUpper      <- 1
# call verifyCompositeFunction() returning the results in a data frame
df <- verifyCompositeFunction(fFunc,
                              gFunc,
                              hFunc,
                              cFunc,
                              xLower,xUpper,3)
# create the tabled output
kbl(df,
    caption = "Table Verifying How A Composite Function Works", booktabs = TRUE) %>% kable_paper()
Table Verifying How A Composite Function Works
x hOfx gofhofx fofgofhofx compositeOfx
-1.0 -1.2500000 0.5294118 -2.400000 -2.400000
-0.9 -1.1951220 0.5232558 -2.385827 -2.385827
-0.8 -1.1428571 0.5172414 -2.372093 -2.372093
-0.7 -1.0930233 0.5113636 -2.358779 -2.358779
-0.6 -1.0454545 0.5056180 -2.345865 -2.345865
-0.5 -1.0000000 0.5000000 -2.333333 -2.333333
-0.4 -0.9565217 0.4945055 -2.321168 -2.321168
-0.3 -0.9148936 0.4891304 -2.309353 -2.309353
-0.2 -0.8750000 0.4838710 -2.297872 -2.297872
-0.1 -0.8367347 0.4787234 -2.286713 -2.286713
0.0 -0.8000000 0.4736842 -2.275862 -2.275862
0.1 -0.7647059 0.4687500 -2.265306 -2.265306
0.2 -0.7307692 0.4639175 -2.255034 -2.255034
0.3 -0.6981132 0.4591837 -2.245033 -2.245033
0.4 -0.6666667 0.4545455 -2.235294 -2.235294
0.5 -0.6363636 0.4500000 -2.225807 -2.225807
0.6 -0.6071429 0.4455446 -2.216560 -2.216560
0.7 -0.5789474 0.4411765 -2.207547 -2.207547
0.8 -0.5517241 0.4368932 -2.198758 -2.198758
0.9 -0.5254237 0.4326923 -2.190184 -2.190184
1.0 -0.5000000 0.4285714 -2.181818 -2.181818

The table has five columns. The first column (heading x) shows, the input values, \(x \in [-1,1]\). The second column (heading hOfX) shows the output of \(h(x) = \frac{x-4}{x+5}\) (the first function in the composite function chain) evaluated at the given input values of \(x\) (in column 1). The third column (heading gofhofx) shows these output values evaluated by \(g(x) = \frac{x-1}{x-3}\). The fourth column (heading fofgofhofx) shows these output values evaluated at \(f(x) = \frac{x + 3}{x-2}\). These output values (allegedly) are the output of the composite function. The last column (heading compositeOfx) are the output of the composite function itself, \((f \circ g \circ h)(x) = \frac{-6x - 66}{4x + 29}\) evaluated at the given input values of \(x\) (in column 1).

The values in the fourth column (fofgofhofx) and the fifth column (compositeOfx) match. They are the same. Thus the idea that the output of the first function becomes the input to the second function has been verified.


??.2 Verifying The Domain Of The Composite Function

In Chapter ??, Section ??.5, Example ??.5 we explored the finding of the domain of a composite function. It was seen that the domain of the composite function itself may not (and many cases do not) tell the whole story while using the composite function schematic does. We will use R to verify the conclusions drawn in several examples from Chapter ??, Section ??.5.

Analysis of Chapter ??, Example ??.7

The two functions in this example were: \(f(x) = \frac{x+ 4}{3x + 2}\) and \(g(x) = 2x + 1\) which resulted in the composite function \((f \circ g)(x) = \frac{2x+5}{6x+5}\). The domain of \((f \circ g)(x)\) function itself was determined to be all real numbers except \(x = -\frac{5}{6}\), or \(\left(-\infty,-\frac{5}{6}\right) \cup \left(-\frac{5}{6},\infty\right)\). Using the composite function schematic, this domain was indeed the actual domain due to \(g(x)\)’s domain being all real numbers. However, the schematic showed the need to determine what the input to \(g\) would be to cause the output of \(g\) to produce the output \(x = -\frac{5}{6}\) which would then cause \(f\) to be invalid.

Let’s first verify that \(x = -\frac{5}{6}\) is an invalid input to the composite function itself:

# define the composite function (f O g)(x), being sure to enter the function using ASCII notation
theComposite <- function(x){(2*x + 5)/(6*x + 5)}
fractions(theComposite(-5/6))
## [1] Inf

The result, \((f \circ g)(-5/6)\) being Inf, indicates a division by zero, thus confirming that \(x = -\frac{5}{6}\) is not in the domain of \((f \circ g)(x)\).

Via the composite function schematic it was determined that \(g(x)\) could not produce an output of \(-\frac{2}{3}\) for that input to \(f\) would be invalid (\(-\frac{2}{3}\) is not in the domain of \(f\)). The input to \(g\) to cause it to produce the output \(-\frac{2}{3}\) was determined algebraically to be \(x = -\frac{5}{6}\). Let’s verify that that is the case:

# define the composite function g(x), being sure to enter the function using ASCII notation
gFunc <- function(x){2*x + 1}
fractions(gFunc(-5/6))
## [1] -2/3

Thus, \(g\left(-\frac{5}{6}\right) = -\frac{2}{3}\) which then becomes the input to \(f\). Let’s see what \(f\left(-\frac{2}{3}\right)\) would be:

# define the composite function f(x), being sure to enter the function using ASCII notation
fFunc <- function(x){(x+ 4)/(3*x + 2)}
fractions(fFunc(-2/3))
## [1] Inf

Again, the inf indicates that a division by zero occurred, thus verifying that \(x = -\frac{2}{3}\) is not in the domain of \(f\).

Following the logic of the composite function schematic (where the functions are chained in such a way that the output of one becomes the input to the next function in the chain), we could have verified that \(x = -\frac{5}{6}\) is not in the domain of \((f \circ g)(x)\) in one step using the pipe feature of R:

# define the composite function f(x), being sure to enter the function using ASCII notation
fFunc <- function(x){(x+ 4)/(3*x + 2)}
fractions(gFunc(-5/6) |> fFunc())
## [1] Inf

The result, inf, verifies that \(x = -\frac{5}{6}\) is not in the domain of \((f \circ g)(x)\).

Let’s explore a more complex example.

Analysis of Chapter ??, Example ??.15

This example formed a composite function using three individual functions \(f(x) = \frac{x + 3}{x-2}\), \(g(x) = \frac{x-1}{x-3}\), and \(h(x) = \frac{x-4}{x+5}\). The resulting composite function is \((f \circ g \circ h)(x) = \frac{-6x - 66}{4x + 29}\). The domain of the composite function itself is (obviously) all real numbers except \(x = -\frac{29}{4}\) yet in Chapter ??, Section ??.5 it was concluded that the domain of \((f \circ g \circ h)(x)\), in interval notation, is \(\left(-\infty,\frac{-19}{2}\right) \cup \left(\frac{-19}{2},\frac{-29}{4}\right) \cup \left(\frac{-29}{4},-5\right) \cup \left(-5,\infty\right)\). Let’s verify this.

First, let’s put \(x = -\frac{29}{4}\) into the actual composite function:

# define the composite function (f O g o h)(x), being sure to enter the function using ASCII notation
theComposite <- function(x){(-6*x - 66)/(4*x + 29)}
fractions(theComposite(-29/4))
## [1] -Inf

Thus, \(x = -\frac{29}{4}\) is not in the domain composite function. But that was only one of the three numbers that were found to not be in the domain. What about the other two? Let’s first put \(x = -\frac{19}{2}\) into the actual composite function:

# define the composite function (f O g o h)(x), being sure to enter the function using ASCII notation
theComposite <- function(x){(-6*x - 66)/(4*x + 29)}
fractions(theComposite(-19/2))
## [1] 1

This shows that even though the \(x = -\frac{19}{2}\) was said to be not in the domain, the composite function was indeed successfully evaluated to be \((f \circ g \circ h)\left(-\frac{19}{2}\right) = 1\). Now, let’s put the other number, \(x = -5\), into the actual composite function:

# define the composite function (f O g o h)(x), being sure to enter the function using ASCII notation
theComposite <- function(x){(-6*x - 66)/(4*x + 29)}
fractions(theComposite(-5))
## [1] -4

This shows that even though the \(x = -5\) was said to be not in the domain, the composite function was indeed successfully evaluated to be \((f \circ g \circ h)\left(-5\right) = -4\).

So, only one of the three numbers said to be not in the domain of the composite function was shown to be invalid by directly using the composite function. The other two seem to be perfectly valid. What gives?? This is where the composite function schematic becomes key. For a composite of three individual functions, \(f(x)\), \(g(x)\), and \(h(x)\), a corresponding composite function could be \((f \circ g \circ h)(x)\). The composite function schematic for \((f \circ g \circ h)(x)\) is:

From the schematic it is obvious that since the first function the input, \(x\), enters is \(h\), it must be valid for \(h\). Well, given that \(h(x) = \frac{x-4}{x+5}\), clearly \(x\) can not equal \(-5\). Let’s verify this:

# define the composite function h(x), being sure to enter the function using ASCII notation
hFunc <- function(x){(x-4)/(x+5)}
fractions(hFunc(-5))
## [1] -Inf

Yes, \(x\) can not equal \(-5\) for it is not in the domain of \(h(x)\) and since it is the first function that this value of \(x\) enters, it cannot be in the domain of the composite function. This explains another of the numbers listed above for the domain of \((f \circ g \circ h)(x)\). What about the third, \(x = -\frac{19}{2}\)?

Well, this is easy to deduce. From the schematic the output of \(h\) becomes the input to \(g\). This means that the output of \(h\) must be valid for \(g\). Well, \(g\) has a domain of all real numbers except \(x = 3\). Solving algebraically for what the input to the composite function would need to be such that \(h\) would produce an out of three we would find that \(x\) cannot be \(x = -\frac{19}{2}\). Let’s verify that this is true:

# define the composite function h(x), being sure to enter the function using ASCII notation
hFunc <- function(x){(x-4)/(x+5)}
fractions(hFunc(-19/2))
## [1] 3

Now, let’s verify that this output of \(h\) would cause \(g\) to be undefined:

# define the composite function h(x), being sure to enter the function using ASCII notation
hFunc <- function(x){(x-4)/(x+5)}
# define the composite function g(x), being sure to enter the function using ASCII notation
gFunc <- function(x){(x-1)/(x-3)}
fractions(hFunc(-19/2) |> gFunc())
## [1] Inf

The mystery of why the value \(x = -\frac{19}{2}\) was not in the domain of the composite function has been solved!

Let’s take a look at the value of \(x = -\frac{29}{4}\). This was determined from the composite function itself. However, the same conclusion could have been drawn by using the composite function schematic as we saw in Chapter ??, Section ??.5. The key was to realize that \(g\) could not produce an output of \(2\) for since that becomes the input to \(f\) and \(x = 2\) is not in the domain of \(f\). This number was found to be \(x = -\frac{29}{4}\). Let’s verify this:

# define the composite function h(x), being sure to enter the function using ASCII notation
hFunc <- function(x){(x-4)/(x+5)}
# define the composite function g(x), being sure to enter the function using ASCII notation
gFunc <- function(x){(x-1)/(x-3)}
fractions(hFunc(-29/4) |> gFunc())
## [1] 2

Completing the chain that this output of \(g\) goes into \(f\):

# define the composite function h(x), being sure to enter the function using ASCII notation
hFunc <- function(x){(x-4)/(x+5)}
# define the composite function g(x), being sure to enter the function using ASCII notation
gFunc <- function(x){(x-1)/(x-3)}
# define the composite function f(x), being sure to enter the function using ASCII notation
fFunc <- function(x){(x+3)/(x - 2)}
fractions(hFunc(-29/4) |> gFunc() |> fFunc())
## [1] Inf

Thus, \(x = -\frac{29}{4}\) is not in the domain, but notice, it can be found without the need to first find the composite function itself!


Hopefully, these examples help solidify the concepts of Chapter ?? and impressed on you the importance, and value, of the composite function schematic to not only your understanding of a composite function, but in the value it brings. You are highly encouraged to do more examples on your own.


??. 3 R Code

The R code for the self-developed routine verifyCompositeFunction.R that verifies a composite function of two individual functions, \((f \circ g)(x)\) or a composite function of three individual functions, \((f \circ g \circ h)(x)\):

verifyCompositeFunction <- function(fFunc,
                                    gFunc,
                                    hFunc     = NULL,
                                    cFunc,
                                    xLower,
                                    xUpper,
                                    numFuncs  = 2,
                                    increment = 0.1) {
  #
  # first generate the input to be used for evaluation
  xValues <- seq(xLower,xUpper,by=increment)
  # evaluate g(x) - the function specified in func1 and store away in a 
  # (temporary) data frame
  if (numFuncs == 2) {
    # verifying (f o g)(x)
    #
    # evaluate g(x) - the function specified in gFunc - which is the FIRST
    # function in the chain and store away in a (temporary) data frame
    gOfx    <- sapply(xValues, function(x) eval(parse(text = gFunc)))
    dfFuncG <- data.frame( "x" = xValues, "y" = gOfx)
    # now that we have the output of the first function, these become the 
    # input to the second function, f(x) - the function specified in fFunc and
    # store away in a (temporary) data frame
    fofgofx <- sapply(dfFuncG$y, function(x) eval(parse(text = fFunc)))
    dfFuncF <- data.frame( "x" = dfFuncG$y, "y" = fofgofx)
    # now evaluate the composite function itself - the function specified in
    # cFunc using the SAME inputs that were used for the first function
    # and store away in a (temporary) data frame
    fCircg    <- sapply(xValues, function(x) eval(parse(text = cFunc)))
    dfFuncC <- data.frame( "x" = xValues, "y" = fCircg)
    # now merge the three data frames into one
    dfComposite <- data.frame("x"            = xValues,
                              "gOfx"         = dfFuncG$y,
                              "fOfgOfx"      = dfFuncF$y,
                              "compositeOfx" = dfFuncC$y)
  } else if (numFuncs == 3) {
    # verifying (f o g o h)(x)
    #
    # evaluate h(x) - the function specified in hFunc - which is the FIRST
    # function in the chain and store away in a (temporary) data frame
    # (temporary) data frame
    hOfx    <- sapply(xValues, function(x) eval(parse(text = hFunc)))
    dfFuncH <- data.frame( "x" = xValues, "y" = hOfx)
    # now that we have the output of the first function, these become the 
    # input to the second function, g(x) - the function specified in gFunc and
    # store away in a (temporary) data frame
    gofhofx <- sapply(dfFuncH$y, function(x) eval(parse(text = gFunc)))
    dfFuncG <- data.frame( "x" = dfFuncH$y, "y" = gofhofx)
    # now that we have the output of the second function, these become the
    # input to the third function, f(x) - the function specified in fFunc and
    # store away in a (temporary) data frame
    fofgofhofx <- sapply(dfFuncG$y, function(x) eval(parse(text = fFunc)))
    dfFuncF <- data.frame( "x" = dfFuncG$y, "y" = fofgofhofx)
    # now evaluate the composite function itself - the function specified in
    # cFunc using the SAME inputs that were used for the first function
    # and store away in a (temporary) data frame
    fCircgCirch    <- sapply(xValues, function(x) eval(parse(text = cFunc)))
    dfFuncC <- data.frame( "x" = xValues, "y" = fCircgCirch)
    # now merge the three data frames into one
    dfComposite <- data.frame("x"            = xValues,
                              "hOfx"         = dfFuncH$y,
                              "gofhofx"      = dfFuncG$y,
                              "fofgofhofx"   = dfFuncF$y,
                              "compositeOfx" = dfFuncC$y)
  }
  # return the data frame
  return(dfComposite)
}

Return To Table Of Contents


.

Appendix ??

Inverse Functions

In Chapter ??, we explored the concepts of a function and its inverse, should it have one. For the most part, this was explored from a mathematical (algebraic) perspective. In this appendix we will explore how some of these ideas are handled in a practical, applied sense as well as how they can be used to verify the concepts developed in the chapter.


??.1 Inverse Function Definition And Verification

A key concept of an inverse function is that it undoes the mapping that the original function did. For example, for a given function, \(f(x)\), and an input \(x\), then the mapping produced by \(f\) would be \((x,f(x))\). The inverse function, \(f^{-1}(x)\) (assuming that it exists) would take as its input, \(f(x)\), and, if was truly the inverse function to \(f\), would undo that mapping; i.e., the mapping produced by \(f^{-1}\) would be \((f(x),x)\).

This idea of the output of \(f\) becoming the input to \(f^{-1}\) is what constitutes a composite function, \((f^{-1} \circ f)(x)\) in particular. The following schematic reflects the composite function \((f^{-1} \circ f)(x)\):

Since these two functions are inverses of each other, context not withstanding, it really doesn’t matter their order. This means that we could also form the composite function \((f \circ f^{-1})(x)\), which has the composite function schematic:

These two composite functions, \((f\circ f^{-1})(x)\) and \((f^{-1} \circ f)(x)\), both should equal \(x\). I.e., \((f\circ f^{-1})(x) = (f^{-1} \circ f)(x) = x\). The verification that this is true is only way to definitively show that the two functions, \(f\), and \(f^{-1}\) are indeed inverses of each other.

Let’s explore these ideas using the function from Example ??.5 in Chapter ??. The function \(f\) was given and it was asked to find the inverse function, \(f^{-1}\). These two functions, the one given and the one found are restated here:

\[ \begin{align} f(x) &= \frac{3x-1}{2x+5} \\ \\ f^{-1}(x) &= \frac{-5x - 1}{2x - 3} \end{align} \]

To verify that these two functions it was asked to verify that the point \(\left(1,\frac{2}{7}\right)\) on \(f(x)\) becomes the point \(\left(\frac{2}{7},1\right)\) on \(f^{-1}(x)\). In other words, the mapping \((x,f(x))\), or in this case \(\left(1,\frac{2}{7}\right)\) was undone by \(f^{-1}\) thus producing the mapping \((f(x),x)\), or in this case \(\left(\frac{2}{7},1\right)\). Let’s verify that this is true by first verifying the mapping \(\left(1,\frac{2}{7}\right)\) by the function, \(f\):

# define the function f, being sure to enter the function using ASCII notation
fFunc <- function(x){(3*x-1)/(2*x+5)}
# evaluate f at x = 1
fractions(fFunc(1))
## [1] 2/7

The mapping \(\left(1,\frac{2}{7}\right)\) by \(f\) is verified. To verify that \(f^{-1}\) would undo that mapping, let’s evaluate that \(f^{-1}\) evaluated at the output of \(f\), \(2/7\), would produce a \(1\):

# define the function fInv, being sure to enter the function using ASCII notation
fInvFunc <- function(x){(-5*x - 1)/(2*x - 3)}
# evaluate f at x = 2/7
fractions(fInvFunc(2/7))
## [1] 1

The undoing of the mapping \(\left(1,\frac{2}{7}\right)\) to \(\left(\frac{2}{7},1\right)\) is verified.

To really hit home the concept of a composite function being a chain of functions, chained in such a way that the output of one becomes the input to the next function in the chain, we can accomplish this using the pipe feature of R where the output of one command gets piped into the next command:

# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){(3*x-1)/(2*x+5)}
# define the function fInv being sure to enter the function using ASCII notation
fInvFunc <- function(x){(-5*x - 1)/(2*x - 3)}
# create the chain beginning with x = 1, entering the function f whose output is then PIPED into the function fInv,
# expressing the result as a fraction versus a decimal
fractions(fFunc(1) |> fInvFunc())
## [1] 1

This last bit of R code clearly verifies the concept of how a composite function works and, more importantly, how a function and its inverse work.

As was stated in Chapter ??, a single numeric example of the function alleged to be the inverse function undoing the mapping produced by the original function is not sufficient to definitively state that the two functions are indeed inverses. To draw that conclusion, it must be shown that \((f\circ f^{-1})(x) = x\) and \((f^{-1} \circ f)(x) = x\). To do this, a routine, verifyInverseFunctions.R was developed which evaluates the function, \(f\), at many input values, then takes these outputs and evaluates the alleged inverse function, \(f^{-1}\), with these at the inputs. The outputs of \(f^{-1}\) must be the initial inputs to \(f\).

Using \(f(x) = \frac{3x-1}{2x+5}\) and \(f^{-1}(x) = \frac{-5x - 1}{2x - 3}\), here is the output of verifyInverseFunctions.R:

# define the functions f(x) and fInv(x)
fFunc    <- '(3*x-1)/(2*x+5)'
# define the function fInv being sure to enter the function using ASCII notation
fInvFunc <- '(-5*x - 1)/(2*x - 3)'
# set the lower and upper intervals for the input values
xLower   <- 0
xUpper   <- 2
# call verifyInverseFunctions() returning the results in a data frame
df <- verifyInverseFunctions(fFunc,
                             fInvFunc,
                             xLower,
                             xUpper)
# create the tabled output
kbl(df,
    caption = "Table Verifying How An Inverse Function Works", booktabs = TRUE) %>% kable_paper()
Table Verifying How An Inverse Function Works
xInTof fOfx xInToFInv fInvOfx
0.0 -0.2000000 -0.2000000 0.0
0.1 -0.1346154 -0.1346154 0.1
0.2 -0.0740741 -0.0740741 0.2
0.3 -0.0178571 -0.0178571 0.3
0.4 0.0344828 0.0344828 0.4
0.5 0.0833333 0.0833333 0.5
0.6 0.1290323 0.1290323 0.6
0.7 0.1718750 0.1718750 0.7
0.8 0.2121212 0.2121212 0.8
0.9 0.2500000 0.2500000 0.9
1.0 0.2857143 0.2857143 1.0
1.1 0.3194444 0.3194444 1.1
1.2 0.3513514 0.3513514 1.2
1.3 0.3815789 0.3815789 1.3
1.4 0.4102564 0.4102564 1.4
1.5 0.4375000 0.4375000 1.5
1.6 0.4634146 0.4634146 1.6
1.7 0.4880952 0.4880952 1.7
1.8 0.5116279 0.5116279 1.8
1.9 0.5340909 0.5340909 1.9
2.0 0.5555556 0.5555556 2.0

The initial inputs to \(f\) are indeed the outputs of \(f^{-1}\) when evaluated at the outputs of \(f\). This verified \((f^{-1} \circ f)(x) = x\), albeit at a small set of numbers, though the inputs could be changed, expanded, etc. and the result that the mapping is undone would be the same.

Now, we still have to show that \((f \circ f^{-1})(x) = x\) so let’s rerun verifyInverseFunctions.R this time switching the functions:

# define the functions f(x) and fInv(x)
fFunc    <- '(-5*x - 1)/(2*x - 3)'
# define the function fInv being sure to enter the function using ASCII notation
fInvFunc <-   '(3*x-1)/(2*x+5)'
# set the lower and upper intervals for the input values
xLower   <- 3
xUpper   <- 5
# call verifyInverseFunctions() returning the results in a data frame
df <- verifyInverseFunctions(fFunc,
                             fInvFunc,
                             xLower,
                             xUpper)
# create the tabled output
kbl(df,
    caption = "Table Verifying How An Inverse Function Works", booktabs = TRUE) %>% kable_paper()
Table Verifying How An Inverse Function Works
xInTof fOfx xInToFInv fInvOfx
3.0 -5.333333 -5.333333 3.0
3.1 -5.156250 -5.156250 3.1
3.2 -5.000000 -5.000000 3.2
3.3 -4.861111 -4.861111 3.3
3.4 -4.736842 -4.736842 3.4
3.5 -4.625000 -4.625000 3.5
3.6 -4.523809 -4.523809 3.6
3.7 -4.431818 -4.431818 3.7
3.8 -4.347826 -4.347826 3.8
3.9 -4.270833 -4.270833 3.9
4.0 -4.200000 -4.200000 4.0
4.1 -4.134615 -4.134615 4.1
4.2 -4.074074 -4.074074 4.2
4.3 -4.017857 -4.017857 4.3
4.4 -3.965517 -3.965517 4.4
4.5 -3.916667 -3.916667 4.5
4.6 -3.870968 -3.870968 4.6
4.7 -3.828125 -3.828125 4.7
4.8 -3.787879 -3.787879 4.8
4.9 -3.750000 -3.750000 4.9
5.0 -3.714286 -3.714286 5.0

Like above, the initial inputs to \(f\) (which was \(f^{-1}\) in the above) are indeed the outputs of \(f^{-1}\) (which was \(f\) in the above) when evaluated at the outputs of \(f\). This verified \((f^{-1} \circ f)(x) = x\), but by us switching the functions, it is really verifying \((f \circ f^{-1})(x)\).


??.2 Exploring The Key Properties Of A Function And Its Inverse

In Chapter ?? it was seen that a function and its inverse possessed some unique properties:


CONCEPT: Given two functions which are inverses of each other the following properties are true:


Example ??.5 in Chapter ?? demonstrated these properties using the two functions

\[ \begin{align} f(x) &= \frac{3x-1}{2x+5} \\ \\ f^{-1}(x) &= \frac{-5x - 1}{2x - 3} \end{align} \]

where it was shown that the domain of one became the range of the other, and vice versa. Also true was the x-intercept of one became the y-intercept of the other, with the \(x\)’s and \(y\)’s switched. These results were summarized in the table:

\(f(x) = \frac{3x-1}{2x+5}\) \(f^{-1}(x) = \frac{-5x - 1}{2x - 3}\)
Domain \(\left(-\infty,-\frac{5}{2}\right) \cup \left(-\frac{5}{2},\infty\right)\) \(\left(-\infty,\frac{3}{2}\right) \cup \left(\frac{3}{2},\infty\right)\)
Range \(\left(-\infty,\frac{3}{2}\right) \cup \left(\frac{3}{2},\infty\right)\) \(\left(-\infty,-\frac{5}{2}\right) \cup \left(-\frac{5}{2},\infty\right)\)
x-intercept \(\left(\frac{1}{3},0\right)\) \(\left(-\frac{1}{5},0\right)\)
y-intercept \(\left(0,-\frac{1}{5}\right)\) \(\left(0,\frac{1}{3}\right)\)

.

Let’s explore these a bit more. First, let’s verify that \(-5/2\) is not in the domain of \(f\):

# define the function f, being sure to enter the function using ASCII notation
fFunc <- function(x){(3*x-1)/(2*x+5)}
# evaluate f at x = -5/2
fractions(fFunc(-5/2))
## [1] -Inf

The -Inf, indicates a division by zero, thus confirming that \(x = -\frac{5}{2}\) is not in the domain of \(f(x)\). Verifying that \(3/2\) is not in the domain of \(f^{-1}\):

# define the function fInv, being sure to enter the function using ASCII notation
fInvFunc <- function(x){(-5*x - 1)/(2*x - 3)}
# evaluate f at x = 3/2
fractions(fInvFunc(3/2))
## [1] -Inf

Again, the -Inf, indicates a division by zero, thus confirming that \(x = \frac{3}{2}\) is not in the domain of \(f^{-1}(x)\).

The plots in Example ??.5 in Chapter ?? showed that these were the only two exclusions from the domains of \(f\) and \(f^{-1}\). From these plots we also gleaned the ranges of both functions. It is beyond the scope of what we’re learning, but the reason why the range for \(f\) was all real numbers except \(\frac{3}{2}\) is that there is a horizontal asymptote at \(y = \frac{3}{3}\) which basically means that as the input goes to infinity, \(x \to \infty\), the function’s output will get closer and closer to this line but will never touch it or cross it. One way we can see this is to evaluate the function at large input values and see what the outputs are:

# define the function f, being sure to enter the function using ASCII notation
fFunc <- '(3*x-1)/(2*x+5)'
# evaluate f at a range of values
xValues    <- seq(100000,110000,by=1000)
fOfx       <- sapply(xValues, function(x) eval(parse(text = fFunc)))
dfFunc     <- data.frame( "x" = xValues, "y" = fOfx)
kbl(dfFunc,
    caption = "As f(x) Goes To Infinity", booktabs = TRUE) %>% kable_paper()
As f(x) Goes To Infinity
x y
100000 1.499958
101000 1.499958
102000 1.499958
103000 1.499959
104000 1.499959
105000 1.499959
106000 1.499960
107000 1.499960
108000 1.499961
109000 1.499961
110000 1.499961

It’s pretty clear that the output is approaching \(\frac{3}{2}\) as \(x \to \infty\). The same logic could be applied to \(f^{-1}\):

# define the function f, being sure to enter the function using ASCII notation
fInvFunc <- '(-5*x - 1)/(2*x - 3)'
# evaluate f at a range of values
xValues    <- seq(100000,110000,by=1000)
fOfx       <- sapply(xValues, function(x) eval(parse(text = fInvFunc)))
dfFunc     <- data.frame( "x" = xValues, "y" = fOfx)
kbl(dfFunc,
    caption = "As fInv(x) Goes To Infinity", booktabs = TRUE) %>% kable_paper()
As fInv(x) Goes To Infinity
x y
100000 -2.500043
101000 -2.500042
102000 -2.500042
103000 -2.500041
104000 -2.500041
105000 -2.500040
106000 -2.500040
107000 -2.500040
108000 -2.500039
109000 -2.500039
110000 -2.500039

It’s pretty clear that the output is approaching \(-\frac{5}{2}\) as \(x \to \infty\), thus indicating a horizontal asymptote at \(y = -5/2\) which verifies the range of \(f^{-1}\) to be all real numbers except \(-\frac{5}{2}\).

From the verification of the domains and ranges of \(f\) and \(f^{-1}\) we do indeed see that the domain of one becomes the range of the other and vice versa. Now, let’s verify the x- and y-intercepts. The y-intercept for \(f\):

# define the function f, being sure to enter the function using ASCII notation
fFunc <- function(x){(3*x-1)/(2*x+5)}
# evaluate f at x = 0
fractions(fFunc(0))
## [1] -1/5

The y-intercept for \(f\) is \(\left(0,-\frac{1}{5}\right)\). The y-intercept for \(f^{-1}\):

# define the function fInv, being sure to enter the function using ASCII notation
fInvFunc <- function(x){(-5*x - 1)/(2*x - 3)}
# evaluate f at x = 0
fractions(fInvFunc(0))
## [1] 1/3

The y-intercept for \(f^{-1}\) is \(\left(0,\frac{1}{3}\right)\).

To find the x-intercepts we need to solve \(f(x) = 0\) and \(f^{-1}(x) = 0\). To accomplish this we will use the built-in R function, uniroot() which finds a root of a function, \(f\), within a given interval, \([a,b]\), where \(f(a)\) and \(f(b)\) are of opposite signs (much like the bisection method discussed in Chapter ??). Finding the x-intercept for \(f(x) = \frac{3x-1}{2x+5}\)

# define the function f, being sure to enter the function using ASCII notation
fFunc <- function(x){(3*x-1)/(2*x+5)}
# left end of interval
a <- 0
# right end of interval 
b <- 2
fractions(uniroot(fFunc,c(a,b))$root)
## [1] 1/3

Thus, the x-intercept for \(f\) is \(\left(\frac{1}{3},0\right)\). Now, find the x-intercept for \(f^{-1}(x) = \frac{-5x - 1}{2x - 3}\)

# define the function fInv, being sure to enter the function using ASCII notation
fInvFunc <- function(x){(-5*x - 1)/(2*x - 3)}
# left end of interval
a <- -2
# right end of interval 
b <- 0
fractions(uniroot(fInvFunc,c(a,b))$root)
## [1] -1/5

The x-intercept for \(f^{-1}\) is \(\left(-\frac{1}{5},0\right)\).

We clearly see, then, that the x-intercept of a function becomes the y-intercept of the inverse function, and vice versa, with the coordinates switched.

Thus, we have verified the properties of a function and its inverse for the functions presented in Example ??.5 in Chapter ??.


??.3 Exploring A Function And Its Inverse As A Composite Function And Domains

In Chapter ?? we saw that if the output of a function, \(f\), evaluated at some \(x\), becomes the input to its inverse function, \(f^{-1}\), the output was the inputted value, \(x\). This idea of taking the output of one function to be the input to another is what constitutes a composite function. For a a function, \(f\), and its inverse function, \(f^{-1}\), the two corresponding composite functions are \((f \circ f^{-1})(x)\) and \((f^{-1} \circ f)(x)\). The schematics for these composite functions are:

It was also stated in Chapter ??, and verified above, that the domain of one function becomes the range of the other, and the range of one function becomes the domain of the other. This is a direct result of the two functions undoing the mapping of the other and that the two functions are reflections about the line \(y = x\). The implications of this is that if one knows the domain and range of one function, the domain and range of the other is immediately known.

This leads to an interesting question that might have entered the mind of an inquisitive student: Since a function and its inverse taken together form a composite function, shouldn’t the process described in Chapter ?? to find the domain of a composite function have been followed, and if so, would it validate or invalidate the above statement?

To investigate this, let’s again use the functions from Example ??.5 in Chapter ??:

\[ \begin{align} f(x) &= \frac{3x-1}{2x+5} \\ \\ f^{-1}(x) &= \frac{-5x - 1}{2x - 3} \end{align} \]

It is clear, has been validated above, that the domain of \(f\) is all real numbers except \(-\frac{5}{2}\) and the domain of \(f^{-1}\) is all real numbers except \(\frac{3}{2}\). Let’s first consider the composite function \((f^{-1} \circ f)(x)\):

Using the logic of finding the true domain of a composite function we first realize that since \(f\) is the first function that the input, \(x\), enters it must be valid for \(f\). That means, right away, that the domain of the composite function must not include \(-\frac{5}{2}\). Next, knowing that the domain of \(f^{-1}\) is all real numbers except \(\frac{3}{2}\), this tells us that the output of \(f\) must not produce the output of \(\frac{3}{2}\). Let’s find the input, \(x\), to the composite function that would cause \(f\) to produce a \(\frac{3}{2}\):

\[ \begin{align} \frac{3x-1}{2x+5} &= \frac{3}{2} \\ 3x - 1 &= \frac{3}{2}(2x + 5) \\ 3x - 1 &= 3x + \frac{15}{2} \\ 3x - 3x &= 1 + \frac{15}{2} \\ 0 &= \frac{17}{2} \end{align} \]

This is a false statement. \(0\) can never equal \(\frac{17}{2}\). The implication of this is that there is no input to the composite function, \((f^{-1} \circ f)(x)\), that would cause \(f\) to produce a \(\frac{3}{2}\). Therefore the domain of \((f^{-1} \circ f)(x)\) is simply all real numbers except \(x = -\frac{5}{2}\), or in interval notation, \(\left(-\infty,-\frac{5}{2}\right) \cup \left(-\frac{5}{2},\infty\right)\). This is the domain of \(f(x)\).

If we were to do the same analysis for the composite function, \((f \circ f^{-1})(x)\) we would end up with the same false statement (this is left as an exercise to verify). The implications of this is that there is no input to the composite function, \((f \circ f^{-1})(x)\), that would cause \(f^{-1}\) to produce a \(-\frac{5}{2}\), which would be invalid for \(f\), the second function in the composite function chain. Therefore, the domain of \((f \circ f^{-1})(x)\) is all real numbers except \(x = \frac{3}{2}\), or in interval notation, \(\left(-\infty,\frac{3}{2}\right) \cup \left(\frac{3}{2},\infty\right)\). This is the domain of \(f^{-1}(x)\).

So, even if we followed the process of how to find the true domain of a composite function, we would end up with the same conclusion as to what the domains of the two functions are. Since neither function produces an output that is invalid for the other, the domains are merely the domains of the first function in the composite function chain. Hence, if we know the domain and range of one function, we can state with confidence what the domain of the other function is.

Out of curiosity, what would happen if \(-\frac{5}{2}\) was entered into the composite function \((f^{-1} \circ f)(x)\)? Let’s see by using verifyCompositeFunction.R (see the Appendix ??, Composite Functions for a description of this self developed routine).

# define the functions g(x), f(x), and (f o g)(x)
fFunc       <- '(3*x-1)/(2*x+5)'
fInvFunc    <- '(-5*x - 1)/(2*x - 3)'
cFunc       <- 'x'
# set the lower and upper intervals for the input values
xLower      <- -3
xUpper      <- -2
# call verifyCompositeFunction() returning the results in a data frame
df <- verifyCompositeFunction(fInvFunc,
                              fFunc,,
                              cFunc,
                              xLower,xUpper)
# create the tabled output
colnames(df) <- c('x','f(x)','fInv(f(x))','compositeOfx')
kbl(df,
    caption = "Table Verifying How A Composite Function Works", booktabs = TRUE) %>% kable_paper()
Table Verifying How A Composite Function Works
x f(x) fInv(f(x)) compositeOfx
-3.0 10.00000 -3.0 -3.0
-2.9 12.12500 -2.9 -2.9
-2.8 15.66667 -2.8 -2.8
-2.7 22.75000 -2.7 -2.7
-2.6 44.00000 -2.6 -2.6
-2.5 -Inf NaN -2.5
-2.4 -41.00000 -2.4 -2.4
-2.3 -19.75000 -2.3 -2.3
-2.2 -12.66667 -2.2 -2.2
-2.1 -9.12500 -2.1 -2.1
-2.0 -7.00000 -2.0 -2.0

The results clearly show that \(x = -\frac{5}{2}\) is not in the domain of \(f\). Notice, however, that the entry for \(f^{-1}(f(x))\) is NaN, which stands for Not a Number. Since \(f\) couldn’t produce an output, this makes perfect sense, there was nothing for the function \(f^{-1}\) to evaluate.


??.4 A Function And Its Inverse Example

In the Why You Should Care section of Chapter ?? we explored how inverse functions play an important role in statistics. The normal, or Gaussian, distribution was introduced to help explain what the functions Probability Density Function, or PDF, Cumulative Distribution Function, or CDF, and the Quantile function are and how they are related to each other. To illustrate the concept that the CDF and quantile functions are inverses of each other, a very simple PDF was chosen, \(f(x) = 3x^{2}\), from which we got the CDF, \(F(x) = x^{3}\), and by finding the inverse of \(F(x)\), we got the quantile function, \(Q(x) = x^{1/3}\). Here, let’s take a closer look at the the normal distribution in general, and the normal distribution’s CDF and quantile functions in particular.

Recall that the standard normal distribution, which is the normal distribution with a mean of zero and a variance of one, is \(f(x) = \frac{1}{\sqrt{2\pi}}e^{\frac{-x^{2}}{2}}\), and its graph, the very familiar bell curve:

The area under the curve of the PDF represents probability and the shape of the curve shows where the probability is most dense. That is, The PDF shows the most likely values the observed random variable will take on. Since this is a PDF for a continuous random variable, the probability of a specific point is always zero. So, what is usually done is the finding of the probability within a region. For example suppose we wanted to find the probability that some random variable, \(X\), will have an outcome between two points, say \(x = -1\) and \(x = 1\), \(P[-1 \le X \le 1]\) we would need to find:

\[ \int_{-1}^{1} \frac{1}{\sqrt{2\pi}}e^{\frac{-x^{2}}{2}} dx \]

(You will learn what this means in calculus, for now just accept that this integral will yield the area under the curve between \(x = -1\) and \(x = 1\)). To find what this area is, will use the integrate() function in R (it produces an estimate using a numerical method algorithm):

# area under the standard normal distribution
# define the function f, being sure to enter the function using ASCII notation
fFunc <- function(x){(1/(sqrt(2*pi))) * exp(-0.5*x^2)}
# lower limit of integration
xLower <- -1
# upper limit of integration
xUpper <- 1
# compute (estimate) the definite integral
defIntegral  <- integrate(fFunc, lower=xLower, upper=xUpper)
# extract the estimate
area <- defIntegral[[1]]
area
## [1] 0.6826895

To visually see what this means:

This means that (roughly) \(68\%\) of the probability lies between \(-1\) and \(1\), or that it is \(68\%\) likely that the observed value will be between \(-1\) and \(1\). (As an aside, this corresponds to \(\pm 1\) standard deviation, but that is beyond our purpose here.)

Now, let’s take a look at the Cumulative Distribution Function, CDF. Recall that the CDF yields the probability that a value of the continuous random variable will be less than or equal to some value. In other words, it accumulates the probability of all outcomes up to a given point. Also recall that there is a relationship between the PDF and CDF. Mathematically the CDF is the area under the curve of the PDF, which implies that to find the cumulative probability up to a given point, the use of integration is required. For the standard normal PDF, the corresponding CDF, \(F(x)\), is:

\[ F(x) = \int_{-\infty}^{x} \frac{1}{\sqrt{2\pi}}e^{\frac{-t^{2}}{2}} dt \]

The graph of the CDF for the standard normal distribution is:

So, for example, if we wanted to know what the probability of getting an observed event which was less than or equal to -1, \(P[X \le -1]\), is we would use the CDF to answer this question. Like we saw above with the PDF, this would represent the area under the CDF curve from \(-\infty\) to \(-1\). The best way to answer this question for the CDF of the standard normal distribution would be to use the pnorm() function in R:

# find the probability of X <= x
x <- -1
pnorm(x,mean=0,sd=1)
## [1] 0.1586553

Thus, \(P[X \le -1] \approx 0.15\). This can be represented visually on the graph of the CDF:

Now lets look at what the probability of getting an observed event which was less than or equal to 1, \(P[X \le 1]\) is:

# find the probability of X <= x
x <- 1
pnorm(1,mean=0,sd=1)
## [1] 0.8413447

Thus, \(P[X \le 1] \approx 0.86\). This can be represented visually on the graph of the CDF:

Above we were interested in what the area under the curve of the PDF was between \(x = -1\) and \(x = 1\), \(P[-1 \le X \le 1]\), and had to integrate the PDF to find this. The CDF also allows us to answer this question. We found what the \(P[X \le 1]\) was and we found what the \(P[X \le -1]\) was so we could just take the difference between the two, \(P[X \le 1]\) - \(P[X \le -1]\). Let’s try that:

xUpper <- 1
xLower <- -1
pnorm(xUpper,mean=0,sd=1)-pnorm(xLower,mean=0,sd=1)
## [1] 0.6826895

This is the same as what we found by integrating the PDF! If we look at this visually on the graph of the CDF we see that this is what we were looking for:

And now we come to the quantile function. As we know, the quantile function is the inverse function of the CDF and it is this relationship that is of most interest to us here. The quantile function for the standard normal distribution is

The quantile function is useful for finding what the percentile is of an observed value of the random variable. Let’s say that we were interested in knowing what the observed value is for the \(70^{th}\) percentile. Using the graph of the quantile function we observe:

From the graph it appears that an observed value at approximately \(0.5\) is the \(70^{th}\) percentile. Reading from a graph to get an exact value is very tricky from a resolution perspective, so let’s use the qnorm() function in R:

# find the percentile of x
x <- 0.7
qnorm(x,mean=0,sd=1)
## [1] 0.5244005

As expected, it was around 0.5 but now we have an exact value. Thus, the quantile function maps \(0.7\) to \(0.5244005\), or, \((0.7,0.5244005)\). If the CDF is truly the inverse function, we would expect a mapping of \((0.5244005,0.7)\). Let’s use the graph of the CDF to verify this:

The mapping of \((0.5244005,0.7)\) is as expected, though again, reading off a graph can be tricky. Visualizations help to get a sense of what is going on but you should always use algebraic, or numeric, techniques to find and/or verify solutions.

So, what can we conclude from this discussion of the standard normal distribution, one of the key distributions in statistics? The relationship between the three functions, the Probability Distribution Function (PDF), the Cumulative Distribution Function (CDF), and the quantile function is amazing. The CDF can be found by integrating the PDF, which means that the PDF can be found by differentiating the CDF. The CDF and quantile functions are inverse functions. The CDF accumulates the probabilities of a random variable up to a particular value of interest. Enter a value into the CDF function and a probability will be returned. The quantile function yields the value of a random variable that represents the accumulated sum of all probabilities less than it. Enter a probability into the quantile function and a random variable value is returned. This is the unmapping process between a function and it inverse! Thus, the study of inverse functions is more than an academic exercise, they play an important role in mathematics and, therefore, in the real world. This example with the standard normal distribution is but one example.

One final note: in practice the quantile function may or may not be used directly. If you know the CDF, you can capitalize on the fact it is the inverse function of the quantile function to basically answer any question you might have used the quantile function for; this was seen above, but let’s just reiterate again. Suppose you were interested in know what the \(50^{th}\) percentile is. You can answer this directly from the CDF!

Since we are using the CDF, the x-axis represents the observed value and y-axis represents probability, or \(P[X \le x]\) in particular. So, to find \(50^{th}\) percentile we would go up the y-axis to \(0.5\), which represents \(P[X \le 0.5]\). From there draw a line, which is $ = 0.5$, over to where this line \(y = 0.5\) hits the CDF. Then from there, drop a line down to the x-axis. Where this line intercepts the x-axis is the observed value. The following graph represents this idea:

The point of intersection is \((0,0.5)\). But this is a point on the CDF. Thus, we can use our knowledge of the relationship between a function and its inverse to deduce that the corresponding point on the quantile function would be \((0.5,0)\), which represents what the observed value corresponding to the \(50^{th}\) percentile. In this case it would be zero.

Let’s just verify this using R, first verifying the point of intersection is \((0,0.5)\). First, let’s find the value of the CDF evaluated at \(x 0\):

# find the probability of X <= x
x <- 0
pnorm(x,mean=0,sd=1)
## [1] 0.5

Thus, the CDF maps \(x = 0\) to \(y = 0.5\), or \((0,0.5)\). Now, let’s find the value of the quantile function evaluated at \(0.5\):

# find the percentile of x
x <- 0.5
qnorm(x,mean=0,sd=1)
## [1] 0

Thus, the quantile function maps \(0.5\) to \(0\), or \((0.5,0)\). The idea that an inverse function, which in this case is the quantile function, undoes the mapping of the original function, which in this case is the CDF, is verified. What this example also shows, however, is that you can use the original function, to determine what the output of the inverse function would be without needing to invoke the inverse function at all. So, in this case, if we know the CDF of a probability distribution it is a (relatively) easy process to determine a quantile (or percentile)!!

This example introduced some statistics, in particular three very important functions, and illustrated the role of mathematics plays and how what you’re learning goes beyond just an academic exercise. Pretty cool!!


??.5 R Code

The R code for the self-developed routine verifyInverseFunctions.R that verifies the relationship between a function and its inverse:

verifyInverseFunctions <- function(fFunc,
                                   fInvFunc,
                                   xLower,
                                   xUpper,
                                   increment = 0.1) {
  # 
  # first generate the input to be used for evaluation
  xInTof     <- seq(xLower,xUpper,by=increment)
  # evaluate f(x) - the function specified in fFunc and store away in a 
  # (temporary) data frame
  fOfx       <- sapply(xInTof, function(x) eval(parse(text = fFunc)))
  dfFunc     <- data.frame( "x" = xInTof, "y" = fOfx)
  # set the inputs of fInv to the ouputs of f(x)
  xInToFInv  <- fOfx
  # evaluate the inverse function and store away in a (temporary) data frame
  fInvOfx    <- sapply(xInToFInv, function(x) eval(parse(text = fInvFunc)))
  dfFuncInv  <- data.frame( "x" = xInToFInv, "y" = fInvOfx)
  # now merge the data frames into one
  dfInverses <- data.frame("xInTof"     = xInTof,
                            "fOfx"      = dfFunc$y,
                            "xInToFInv" = xInToFInv,
                            "fInvOfx"   = dfFuncInv$y)
  # return the data frame
  return(dfInverses)
}

Return To Table Of Contents


.

About The Author

Tony Smaldone has over 45 years of technical industry experience, having worked for ~20 years at Hewlett-Packard (HP) as a network consultant and technical engineer, and ~20 years at Lockheed Martin (LM) as a manager and a Lead Member Of The Engineering Staff for the development and analysis (inclusive of a high fidelity stochastic model) of the Aegis ballistic missile defense system. Mr. Smaldone has a B.S.E.E, a M.S. Mathematics, and is ABD for a doctorate. Mr. Smaldone is also an adjunct professor of mathematics having worked at a variety of colleges and universities for the past 20 years. Mr. Smaldone is currently a teacher of mathematics and statistics at Camden Catholic High School in Cherry Hill, New Jersey. His research interests include applied mathematics, statistics, the creation of mathematical and statistical models, the technology and mathematics used in AI (deep learning primarily), the development of AI models, and the moral and ethical consequences thereof.

Return To Table Of Contents


  1. https://cchs.shinyapps.io/cchsaiuat-1/↩︎