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!
Potential Topics
Potential Topics Of A Key Chapter
Potential Topics
Potential Topics
Potential Topics
Potential Topics
R CodeR CodeR CodeR CodeR CodeR CodeR CodeR CodeR CodeThis chapter is focused on complex numbers. However, one can’t talk about complex numbers without talking about the imaginary number, \(i\). The imaginary number has a long and intriguing history and are essential in mathematics and many applications. Unfortunately, we don’t have the time here to dive into \(i\) and it’s history in great depth. I would highly suggest the curious student (which should be each of you) spend time looking into this. A place to start is the book, An Imaginary Tale: The Story of \(\sqrt{-1}\), by Paul J. Nahin.
To get a sense of the history of \(i\), consider \(f(x) = x^{2} + 1\). As we will see later in Section ?? Root Finding is that it is often very important to understand when the output of the function is zero. In other words, \(f(x) = 0\), a root finding problem. In this case we have:
\[ \begin{align} f(x) &= 0 \\ x^{2} + 1 &= 0 \\ x^{2} &= -1 \\ x &= \pm \sqrt{-1} \end{align} \]
We now have a problem, the taking the square root of a negative number which is not possible for there exists no real number such that when it is squared would give \(-1\) let alone would give any negative number. Indeed, it was a common occurrence that equations who have this same problem when it was attempted to solve them. They were basically deemed unsolvable. However, as time went on this situation became more and more unacceptable. Eventually after much debate and among great controversy even after it was shown that algebraic operations could be performed on negative square roots, the term imaginary number was coined for the square root of negative one, \(\sqrt{-1}\). Eventually, it was Leonhard Euler (one of my all time favourite mathematician) who, in 1748, formally introduced the symbol \(i\) to denote the square root of negative one; that is, \(i = \sqrt{-1}\). It should be pointed out that, technically this is the principle root, for if we define \(i^{2} = -1\), then \(i = \pm \sqrt{-1}\). This is something to keep in mind. When one thinks of \(i\), the immediate association made is \(\sqrt{-1}\) but, technically, it is \(\pm \sqrt{-1}\).
CONCEPT: The imaginary number, \(i\), is defined as
\[ i = \pm \sqrt{-1} \]
(Note: the above was a very brief history and totally incomplete. Again, it is highly recommended that you look into this more yourself. You won’t regret it.)
What if we had the function \(f(x) = x^{2} + 5\) and we wanted to solve \(f(x) = 0\)?
\[ \begin{align} f(x) &= 0 \\ x^{2} + 5 &= 0 \\ x^{2} &= -5 \\ x &= \pm \sqrt{-5} \end{align} \]
The two solutions, then, are \(x = \sqrt{-5}\) and \(x = -\sqrt{-5}\). We never leave it this way, however. Recalling that \(\sqrt{ab} = \sqrt{a}\sqrt{b}\), we can rewrite these as:
\[ \begin{align} \sqrt{-5} &= \sqrt{5(-1)} \\ &= \sqrt{5}\sqrt{-1} \\ &= \sqrt{5}i \end{align} \]
and
\[ \begin{align} -\sqrt{-5} &= -\sqrt{5(-1)} \\ &= -\sqrt{5}\sqrt{-1} \\ &= -\sqrt{5}i \end{align} \]
Hence the two solutions are \(x = \pm \sqrt{5}i\) or \(x = \sqrt{5}i\) and \(x = -\sqrt{5}i\).
Notice how this was accomplished. We were able to express \(\sqrt{-5}\) as the \(\sqrt{5(-1)} = \sqrt{5}\sqrt{-1}\). Then we replace the \(\sqrt{-1}\) with \(i\) to get \(\sqrt{5}i\). Notice, also, that the convention is write the \(i\) last.
CONCEPT: The \(\sqrt{-x} = \pm \sqrt{x}\sqrt{-1} = \pm \sqrt{x}i\)
\[ \sqrt{-x} = \pm \sqrt{x}i \]
Looking at \(i = \sqrt{-1}\), what is \(i^{2}\)?
\[ \begin{align} i^{2} &= (i)(i) \\ &= \left(\sqrt{-1}\right)\left(\sqrt{-1}\right) \\ &= \left(\sqrt{-1}\right)^{2} \\ &= -1 \end{align} \]
This is a very important idea: \(i^{2} = -1\)! Why? First it means that every time you see an \(i^{2}\) you replace it with a \(-1\). Second, and perhaps, the most intriguing, that was an imaginary number is now a real number!
CONCEPT: \(i^{2} = -1\). The imaginary number, \(i\), when squared becomes a real number!
\[ i^{2} = -1 \]
Using \(i^{2} = -1\) we can verify that \(\sqrt{-x} = \sqrt{x}i\). By squaring \(\sqrt{x}i\) we would expect to get \(-x\):
\[ \begin{align} (\sqrt{x}i)^{2} &= (\sqrt{x}i)(\sqrt{x}i) \\ &= \sqrt{x}\sqrt{x}(i)(i) \\ &= xi^{2} \\ &= x(-1) \\ &= -x \end{align} \]
We explored \(i^{2}\). Actually, it is interesting to explore powers of \(i\) in general beginning with power \(0\):
\[ \begin{align} i^{0} &= 1 \\ i^{1} &= i \\ i^{2} &= (i)(i) = -1 \\ i^{3} &= i^{2}i = -i \\ i^{4} &= (i^{3})(i) = (-i)(i) = -(i)(i) = 1 \\ i^{5} &= (i^{4})i = (1)i = i \\ i^{6} &= (i^{5})(i) = (i)(i) = -1 \\ i^{7} &= (i^{6})(i) = (-1)(i) = -i \end{align} \]
We can go on, but there is a clear pattern emerging. To see it more clearly, let’s summarize the above:
\[ \begin{align} i^{0} &= 1 \\ i^{1} &= i \\ i^{2} &= -1 \\ i^{3} &= -i \\ i^{4} &= 1 \\ i^{5} &= i \\ i^{6} &= -1 \\ i^{7} &= -i \end{align} \]
There is a repeating pattern of \(1\), \(i\), \(−1\), \(-i\) on a \(4\) power of \(i\) cycle. The pattern repeats every \(4\) powers! \(i\) raised to any power always produces one of these four as the response \(1\), \(i\), \(−1\), \(-i\). Note also that even powers of \(i\) produce a real number, while odd powers of \(i\) produce an imaginary number.
When \(i\) is raised to a positive integer powers there is a repeating pattern of \(1\), \(i\), \(−1\), \(-i\) on a \(4\) power of \(i\) cycle. The pattern repeats every \(4\) powers! \(i\) raised to any power always produces one of these four as the response \(1\), \(i\), \(−1\), \(-i\). Note also that even powers of \(i\) produce a real number, while odd powers of \(i\) produce an imaginary number.
This is an important idea. Knowing the first four powers of \(i\)
\[ \begin{align} i^{0} &= 1 \\ i^{1} &= i \\ i^{2} &= -1 \\ i^{3} &= -i \end{align} \]
allows us to easily find any positive integer power of \(i\). If given \(i\) raised to a power \(n\), \(i^{n}\), divide the power, \(n\), by \(4\) and then:
For example, what is \(i^{87}\)? Here, \(n = 87\), thus dividing \(87\) by \(4\) gives \(21\) with a remainder of \(3\). Therefore, \(i^{87} = i^{3} = -i\)
Let’s look at some examples.
Find \(\sqrt{-64}\).
Solution:
Realizing that \(\sqrt{-64}\) can be rewritten as:
\[ \begin{align} \sqrt{-64} &= \pm \sqrt{64}\sqrt{-1} \\ &= \pm 8\sqrt{-1} \\ &= \pm 8i \end{align} \]
Thus, \(\sqrt{-64} = \pm 8i\)
Find \(\sqrt{-8}\).
Solution:
Realizing that \(\sqrt{-8}\) can be rewritten as:
\[ \begin{align} \sqrt{-8} &= \pm \sqrt{8}\sqrt{-1} \\ &= \pm \sqrt{4}\sqrt{2}\sqrt{-1} \\ &= \pm 2\sqrt{2}\sqrt{-1} \\ &= \pm 2\sqrt{2}i \end{align} \]
Thus, \(\sqrt{-8} = \pm 2\sqrt{2}i\)
Find \(i^{98}\).
Solution:
Here the power of \(i\) is \(n = 4\). Dividing \(98\) by \(4\) produces the quotient \(24\) with a remainder of \(2\). Therefore,
\[ \begin{align} i^{98} &= i^{2} \\ &= -1 \end{align} \]
Thus, \(i^{98} = -1\)
Will \(i^{2005}\) be a real or imaginary number?
Solution:
Since the power in \(i^{2005}\) is \(2005\), which is an odd number, the result will be an imaginary number.
We know, therefore, that the answer will be \(i\) or \(-i\). Even though the problem didn’t specifically ask what the answer is, let’s find it anyway.
Dividing \(2005\) by \(4\) produces the quotient \(501\) with a remainder of \(1\). Therefore,
\[ \begin{align} i^{2005} &= i^{1} \\ &= i \end{align} \]
So, yes, \(i^{2005}\) will be an imaginary number, and that number is \(i\).
Here is an example that will utilize the application of the laws of exponents.
Find \(-2(i^{5})^{3}\).
Solution:
One approach is to use the law of exponent \((x^{n})^{m} = x^{nm}\):
\[ \begin{align} -2(i^{5})^{3} &= -2(i^{15}) \end{align} \]
Looking at \(i^{15}\), \(15\) divided by \(4\) is \(3\) with a remainder of \(3\). Thus, \(i^{15} = i^{3} = -i\). using this:
\[ \begin{align} -2(i^{5})^{3} &= -2(i^{15}) \\ &= -2(i^{3}) \\ &= -2(-i) \\ &= 2i \end{align} \]
Thus, \(i^{15} = 2i\). Another approach would be to first look at \(i^{5}\). \(5\) divided by \(4\) is \(1\) with a remainder of \(1\). Therefore, \(i^{5} = i^{1} = i\). Using this:
\[ \begin{align} -2(i^{5})^{3} &= -2(i^{1})^{3} \\ &= -2(i^{3}) \\ &= -2(-i) \\ &= 2i \end{align} \]
Thus, \(i^{15} = 2i\). The two approaches match, as they should!
Now that we understand the imaginary number, \(i\), we can begin to look at complex numbers.
A complex number is so named for it is composed of two distinct parts, not because it is complex mathematically speaking. So, what are those two parts. The first part is the real part which consists of any real number. The second part is the imaginary part which, as we know, is an imaginary number. These two parts are combined via the operation of addition. The following diagram illustrates this idea.
Looking \(a + bi\) the imaginary part is \(bi\) which has the imaginary number, \(i\), multiplied by a coefficient which can be any real number. Should that coefficient be negative, then the complex number becomes \(a + -bi\) but it is usually written as \(a - bi\). Since the two parts, the real and the imaginary, are connected via the operation of addition, then \(a + bi = bi + a\). However, it is the convention that the real part comes first followed by the imaginary part.
CONCEPT: A complex number is a number composed of a real part and an imaginary part to form the number \(a + bi\) where \(a\) and \(b\) are real numbers.
Since the \(a\) and \(b\) in \(a + bi\) can be any real number, that gives three possible types of a complex number:
CONCEPT: A purely imaginary complex number is \(0 + bi\), the real part is zero. A purely real complex number is \(a + 0i\), the imaginary part is zero.
It is interesting to note is that every number is a complex number. Certainly the number \(2 + 5i\) is a complex number as we just defined it. But what about the number \(7\)? We normally refer to this as an integer. Knowing that a complex number, \(a + bi\) has a real part and an imaginary part, \(7\) would be the complex number \(7 + 0i\), or a purely real number. We would, therefore, just say that \(7\) is a real number. So, yes, every number can be considered to be a complex number. (This is something to remember when you take higher level math courses!)
Let’s look at some examples.
Given \(-3 + 2i\), identify the real and imaginary parts.
Solution:
Given a complex number is of the form, \(a + bi\), \(-3 + 2i\) has a real part of \(-3\) and an imaginary part of \(2i\).
Given \(10 - 7i\), identify the real and imaginary parts.
Solution:
Given a complex number is of the form, \(a + bi\), \(10 - 7i\) has a real part of \(10\) and an imaginary part of \(-7i\).
Given \(-15i\), identify the real and imaginary parts.
Solution:
Given a complex number is of the form, \(a + bi\), \(-15i\) has a real part of \(0\) and an imaginary part of \(-15i\). Thus, \(-15i\) is a purely imaginary number.
Given \(99\), identify the real and imaginary parts.
Solution:
Given a complex number is of the form, \(a + bi\), \(99\) has a real part of \(99\) and an imaginary part of \(0i\). Thus, \(99\) is a purely real number.
The Cartesian Coordinate system allows us to plot points in \(n\)-dimensional space. More specifically, it identifies where a particular point is in \(n\)-dimensional space. We are all familiar with two dimensional space where any point can be uniquely identified by the ordered pair, \((x,y)\). A point in three dimensional space would have the ordered triple, \((x,y,z)\). And so on. It is the use of the Cartesian Coordinate system that allows us to visualize points in \(n\)-dimensional space. For example, given the points \((2,3)\), \((4,-1)\), and \((-5,2)\) you can easily plot them in a two dimension graph to visually see where these points are and what, if any, relationship they may have (in statistics this is known as creating a scatter plot.)
Well, the complex plane is similar in that it allows for the visualization of complex numbers; in other words we can plot complex numbers just as easily as we can real numbers. The main difference is that though having the traditional x- and y-axes, in a complex plot, the x-axis now represents the real axis; the y-axis now represents the imaginary axis. The complex plot is sometimes known as the Argand plot, after Jean-Robert Argand who developed this idea in the early 19th century. (Actually, Wessel and Gauss are believed to have independently developed this idea around the same time).
To see how a complex number is plotted in the complex plane and to help make the connection of how a point in two-dimensional space is plotted, let’s consider the complex number \(x + yi\), in lieu of the conventional \(a + bi\). The real part is \(x\) and the imaginary part is \(y\). Therefore, to plot the point \(x + yi\) you would move along the x-axis, which is now the real axis, \(x\) units from the origin. Then you would move vertically \(y\) units, which equivalent to having had moved along the y-axis, which is now the imaginary axis, and you would now be at the point \(x + yi\). The ordered pair of that point in the complex plane would be \((x,y)\). The \(x\) represents the real part, the \(y\) represents the imaginary part. Here is a complex plot which helps illustrates these idea:
CONCEPT: The complex number \(x + yi\) will have the ordered pair \((x,y)\) on the complex plane. The real part coefficient, \(x\), is the value along the real axis; the imaginary part coefficient, \(y\), is the value along the imaginary axis. Using \(a + bi\) as the complex number, it will have the ordered pair \((a,b)\) 0n the complex plane.
Now that we have an understanding of the complex plane, let’s return to a generic complex number, \(a + bi\).
There are three possible types of points that may exist on the complex plot:
The following plot reflects this idea:
The last thing to note is that for any point, \((a,b)\), or \((x,y)\) if you prefer, on the plot, the vector, \(<a,b>\), or \(<x,y>\), originating from the origin, \((0,0)\) to \((a,b)\), can be constructed. The following plot reflects this idea:
CONCEPT: For the complex number, \(a + bi\), its vector in the complex plane is \(<a,b>\), where a vector is the line from the origin to the point \((a,b)\).
There is a lot more to the complex plane, most of which is beyond our purpose and level. What was presented here should suffice for our purposes.
Let’s look at some examples.
Given the complex numbers \(-3 + 2i\), \(1 - 3i\), \(4i\), and \(6\), state what would their ordered pairs be on the complex plane.
Solution:
We are asked to to determine the ordered pairs of \(-3 + 2i\), \(1 - 3i\), \(4i\), and \(6\). Remember that a complex number \(a + bi\) will have the ordered pair \((a,b)\) in the complex plane.
Thus, the complex number \(-3 + 2i\) will have the ordered pair, \((-3,2)\). The complex number, \(1 - 3i\), will have the ordered pair, \((1,-3)\). The complex number \(4i\), which is purely imaginary can be written as \(0 + 4i\), thus, it will have the ordered pair, \((0,4)\). The complex number \(6\), which is purely real can be written as \(6 + 0i\), thus, it will have the ordered pair, \((6,0)\).
Let’s now visualize these four point in the complex plane:
Given the ordered pairs \((-2,4)\), \(\left(0,\frac{3}{2}\right)\), \((-3,0)\), and \(\left(\frac{5}{2},\frac{13}{2}\right)\) of points on the complex plane, express them in the form \(a + bi\).
Solution:
We are asked to to determine the associated complex number, \(a + bi\), is for each of the ordered pairs of \(-3 + 2i\), \(1 - 3i\), \(4i\), and \(6\). Remember that a complex number \(a + bi\) will have the ordered pair \((a,b)\) in the complex plane.
Thus, the complex number associated with \((-2,4)\) would be \(-2 + 4i\). The complex number associated with \(\left(0,\frac{3}{2}\right)\) would be \(0 + \frac{3}{2}i\), or \(\frac{3}{2}i\). The complex number associated with \((-3,0)\) would be \(-3 + 0i\), or \(-3\). The complex number associated with \(\left(\frac{5}{2},\frac{13}{2}\right)\) would be \(\frac{5}{2} + \frac{13}{2}i\).
Let’s now visualize these four point in the complex plane:
Given the complex numbers \(3 + 2i\) and \(4 - 5i\), state what the associated vectors are.
Solution:
We are asked to find the vector associated with each of the complex numbers \(3 + 2i\) and \(4 - 5i\). Remember that for the complex number, \(a + bi\), its vector in the complex plane is \(<a,b>\), where a vector is the line from the origin to the point \((a,b)\). Thus, for \(3 + 2i\), its vector will be \(<3,2>\). For \(4 - 5i\), its vector will be \(<4,-5>\).
Let’s now visualize these points and their vectors in the complex plane:
Now that we have a basic understanding of the complex plane, let’s look at the complex number, \(a + bi\), and the relationship that it has to its complex conjugate.
Complex conjugates play an important role in many areas of mathematics. One area that we’ll see this to be true is in Chapter ?? as part of our discussion of root finding. But, for now, the first question to address is what is a complex conjugate.
Simply put, given a complex number, \(a + bi\), then its complex conjugate is \(a - bi\). The real part remains the same, the imaginary part is the opposite. In other words, the \(a\) and the \(bi\) remain the same, the only thing that changes is the sign between them. So, the complex conjugate of \(a + bi\) is \(a - bi\). Likewise, the complex conjugate of \(a - bi\) is \(a + bi\).
CONCEPT: The complex conjugate of \(a + bi\) is \(a - bi\). The complex conjugate of \(a - bi\) is \(a + bi\). The complex conjugate is the same as \(a + bi\) except that the sign of the imaginary part is reversed.
Let’s look at a complex plot of a complex number and its conjugate:
From the plot we observe that the real part of each is the same distance from the origin, \(a\), along the x-axis which is the real axis. The distance along the y-axis, the imaginary axis, is the same and is the magnitude of the imaginary part, \(b\). The direction along the imaginary axis, however, is the opposite. The ordered pair for complex number, \(a + bi\), in the complex plane is \((a,b)\), while the odered pair for the complex conjugate, \(a - bi\), is \((a,-b)\). On other words, the complex conjugate is the reflection of the complex number, \(a + bi\), about the x-axis.
There are some interesting properties between a complex number, \(a + bi\), and its complex conjugate, \(a - bi\).
\[ \begin{align} (a + bi) + (a - bi) &= 2a \end{align} \]
\[ \begin{align} (a + bi) - (a - bi) &= 2bi \end{align} \]
\[ \begin{align} (a + bi)(a - bi) &= a^{2} + b^{2} \\ \end{align} \]
These properties are interesting for they show that complex numbers can be combined so as to become purely real or purely imaginary. The last one, the product of a complex number, \(a + bi\), and its complex conjugate, \(a - bi\) is always real, is of keen interest in many applications. However, on a practical note, the product of a complex number and its conjugate is nothing more than the sum of the squares of \(a\) and \(b\).
CONCEPT: Interesting properties of a complex number, \(a + bi\), and its complex conjugate, \(a - bi\):
Note: See the next section, Arithmetic Operations where these properties will be verified.
Let’s look at some examples of complex conjugates.
Find the complex conjugate of \(8 + 6i\).
Solution:
The complex conjugate of a complex number is the keeping of real part and the reversing of the sign of the imaginary part. Thus, in this example, we have \(8 + 6i\), so the complex conjugate will be \(8 - 6i\).
Find the complex conjugate of \(12 - 3i\).
Solution:
The complex conjugate of a complex number is the keeping of real part and the reversing of the sign of the imaginary part. Thus, in this example, we have \(12 - 3i\), so the complex conjugate will be \(12 + 3i\).
Find the complex conjugate of \(\frac{2}{i}\).
Solution:
Before attempting to find the complex conjugate we realize that the given expression is not in the form of \(a + bi\). We can resolve this by multiplying the denominator (and, therefore, the numerator) by \(i\):
\[ \begin{align} \frac{2}{i} \left(\frac{i}{i}\right) &= \frac{2i}{i^{2}} \\ &= -2i \end{align} \]
We now have a purely imaginary number, which can be expressed as the complete complex number \(0 - 2i\) (the real part is \(0\)). Now we can use the idea that the complex conjugate of a complex number is the keeping of real part and the reversing of the sign of the imaginary part. Thus, in this example, we have \(0 - 2i\), so the complex conjugate will be \(0 + 2i\). Or, simply the purely imaginary number \(2i\).
Note: the solution was a methodical approach to finding the complex conjugate. Once it was expressed as \(-2i\), it should have been obvious that the complex conjugate would be \(2i\).
Evaluate the sum of the complex number \(4 + 2i\) with its complex conjugate.
Solution:
First, recognize that the complex conjugate of \(4 + 2i\) is \(4 - 2i\). Thus, we are looking for \((4 + 2i) + (4 - 2i)\). We can use the above property that the sum of a complex number, \(a + bi\), and its complex conjugate, \(a - bi\) is the real quantity, \(2a\). For this problem \(a = 4\), therefore:
\[ \begin{align} (4 + 2i) + (4 - 2i) &= 2(4) = 8 \end{align} \]
Note: we will see why this property is true in section ??.5.1 Complex Number Addition
Evaluate the difference of the complex number \(-5 - 3i\) from its complex conjugate.
Solution:
First, recognize that the complex conjugate of \(-5 - 3i\) is \(-5 + 3i\). Thus, we are looking for \((-5 + 3i) - (-5 - 3i)\). We can use the above property that the difference of a complex number, \(a + bi\), and its complex conjugate, \(a - bi\) is the imaginary quantity, \(2bi\). For this problem \(b = 3\), therefore:
\[ \begin{align} (-5 + 3i) - (-5 - 3i) &= 2(3)i = 6i \end{align} \]
Note: we will see why this property is true in section ??.5.2 Complex Number Subtraction
Evaluate the product of the complex number \(\frac{1}{3} - \frac{2}{5}i\) and its complex conjugate.
Solution:
First, recognize that the complex conjugate of \(\frac{1}{3} - \frac{2}{5}i\) is \(\frac{1}{3} + \frac{2}{5}i\). Thus, we are looking for \(\left(\frac{1}{3} - \frac{2}{5}i\right)\left(\frac{1}{3} + \frac{2}{5}i\right)\). We can use the above property that the product of a complex number, \(a + bi\), and its complex conjugate, \(a - bi\) is the real quantity, \(a^{2} + b^{2}\). For this problem \(a = \frac{1}{3}\) and \(b = \frac{2}{5}\), therefore:
\[ \begin{align} \left(\frac{1}{3} - \frac{2}{5}i\right)\left(\frac{1}{3} + \frac{2}{5}i\right) &= \left(\frac{1}{3}\right)^{2} +\left(\frac{2}{5}\right)^{2} \\ &= \left(\frac{1}{9}\right) +\left(\frac{4}{25}\right) \\ &= \frac{61}{225} \end{align} \]
Note: we will see why this property is true in section ??.5.3 Complex Number Multiplication
Now that we have an understanding of a complex number and its complex conjugate, we can proceed to explore performing the arithmetic operations of addition, subtraction, multiplication, and division of complex numbers.
Now that we have an understanding of what a complex number is, we turn our attention to the arithmetic operations between two or more complex numbers. The arithmetic operations are, of course, addition, subtraction, multiplication, and division. We will consider each in turn.
The addition of two complex numbers is nothing more than the adding together of the real parts and the adding together of the imaginary parts.
\[ \begin{align} (a + bi) + (c + di) &= (a + c) + (bi + di) \\ & = (a + c) + (b + d)i \end{align} \]
CONCEPT: The addition of two complex numbers, \(a + bi\) and \(c + di\), is the adding of the real parts and the imaginary parts. that is
\[ \begin{align} (a + bi) + (c + di) &= (a + c) + (b + d)i \end{align} \]
To enhance our understanding of the addition of complex numbers let us look at it from a visualization perspective. Using the addition of \(1 + 2i\) and \(2 + i\) as an example, here is the complex plot of these two complex numbers along with the associated vectors of each: the vectors \(<1,2>\) and \(<2,1>\) for the complex numbers, \(1 + 2i\) and \(2 +i\), respectively. Each complex number is associated with an ordered pair in the complex plane. The complex number \(1 + 2i\) has the ordered pair, \((1,2)\); the complex number \(2 + i\) has the ordered pair, \((2,1)\).
Now, using vector addition, where we place the tail of vector \(<2,1>\) at the head of vector \(<1,2>\), we will visually see what \((1 + 2i) + (2 + i)\) is:
From the graph we see that the sum of these two complex numbers is the ordered pair \((3,3)\), which corresponds to the complex number \(3 + 3i\).
Applying the definition of the addition of two complex numbers, \((a + bi) + (c + di) = (a + c) + (b + d)i\), for the example here \((1 + 2i) + (2 + i)\), where \(a = 1\), \(b = 2\), \(c = 2\), and \(d = 1\), we get: \((1 + 2i) + (2 + i) = (1 + 2) + (2 + 1)i = 3 + 3i\), which is what the visualization showed. And, of course, the complex number \(3 + 3i\) has the ordered pair \((3,3)\) in the complex plane.
An interesting observation here is that using the idea of a complex number having an ordered pair in the complex plane, then the addition of two complex numbers \(a + bi\) and \(c + di\), which have the ordered pairs in the complex plane, \((a,b)\), \((c,d)\), respectively, results in the ordered pair \((x,y)\) where \(x = a + c\), the sum of the x-coordinates of the two individual ordered pairs, and \(y = b + c\), the sum of the y-coordinates of the two individual ordered pairs.
CONCEPT: The two complex numbers, \(a + bi\) and \(c + di\), will have the ordered pairs, \((a,b)\) and \((c,d)\), respectively in the complex plane. The addition \((a + bi) + (c + di)\) will produce the ordered pair in the complex plane \((x,y)\) where \(x = a + c\), the sum of the x-coordinates of the two individual ordered pairs, and \(y = b + c\), the sum of the y-coordinates of the two individual ordered pairs.
What if we have more than two complex numbers which we want to sum? The addition of more than two complex numbers is the same idea: add the real parts together and add the imaginary parts together. That is, the addition of \(n\) complex numbers would be:
\[ \begin{align} (a_{1} + b_{1}i) + (a_{2} + b_{2}i) + \cdots + (a_{n} + b_{n}i) &= (a_{1} + a_{2} + \cdots a_{n}) + (b_{1} + b_{2} + \cdots +b_{n})i \end{align} \]
CONCEPT: The addition of more than two complex numbers is the adding of the real parts and the imaginary parts. In general, the addition of \(n\) complex numbers is
\[ \begin{align} (a_{1} + b_{1}i) + (a_{2} + b_{2}i) + \cdots + (a_{n} + b_{n}i) &= (a_{1} + a_{2} + \cdots a_{n}) + (b_{1} + b_{2} + \cdots +b_{n})i \end{align} \]
It is also true that the sum of more than two complex numbers will result in the ordered pair, \((x,y)\), in the complex plane. The x-coordinate will be just the sum of all the x-coordinates of each individual ordered pair. The y-coordinate will be just the sum of all the y-coordinates of each individual ordered pair.
One final note worth mentioning is that since the addition of complex numbers is just the adding of the real and imaginary parts, the order in which the complex numbers are added does not matter. Adding \(a + b\) is the same as adding \(b + a\).
Let’s look at some examples, first the addition of just two complex numbers.
Find the sum of the two complex numbers \(2 + 5i\) and \(-3 + 7i\) using the definition of complex number arithmetic.
Solution:
The definition of complex number arithmetic is given two complex numbers, \(a + bi\) and \(c + di\), then \((a + bi) + (c + di) = (a + c) + (b + d)i\); i.e., the adding of the real parts and the adding of the imaginary. For these two complex numbers \(2 + 5i\) and \(-3 + 7i\) we see that \(a = 2\), \(b = 5\), \(c = -3\), and \(d = 7\). Applying the definition we get:
\[ \begin{align} (2 + 5i) + (-3 + 7i) &= (2 + -3) + (5 + 7)i \\ &= -1 + 12i \end{align} \]
Hence, \((2 + 5i) + (-3 + 7i) = -1 + 12i\).
Find the sum of the two complex numbers \(-3 + 7i\) and \(4 - 5i\) using ordered pairs.
Solution:
The complex number, \(-3 + 7i\), has the ordered pair \((-3,7)\) in the complex plane. The complex number, \(4 - 5i\), has the ordered pair \((4,-5)\) in the complex plane. The result of the addition, \((-3 + 7i) + (4 - 5i)\) will result in the ordered pair \((x,y)\) in the complex plane where \(x\) is the sum of the x-coordinates and \(y\) is the sum of the y-coordinates of the two ordered pairs. Thus,
\[ \begin{align} x &= -3 + 4 = 1 \\ y &= 7 + -5 = 2 \end{align} \]
The resulting ordered pair is, therefore, \((1,2)\), which corresponds to the complex number \(1 + 2i\).
Now let’s add more than two complex numbers together.
Find the sum of the following complex numbers \(1 + 2i\), \(\frac{1}{2} + i\), \(3 + \frac{2}{3}i\) and \(\frac{7}{2} + \frac{7}{3}i\) using the definition of complex number arithmetic.
Solution:
The definition of complex number arithmetic is given more than two complex numbers is \((a_{1} + b_{1}i) + (a_{2} + b_{2}i) + \cdots + (a_{n} + b_{n}i) = (a_{1} + a_{2} + \cdots a_{n}) + (b_{1} + b_{2} + \cdots +b_{n})i\)
In other words, to find the sum of any number of complex numbers we just add the real parts together and we add the imaginary parts together:
\[ \begin{align} \left(1 + 2i\right) + \left(\frac{1}{2} + i\right) + \left(3 + \frac{2}{3}i\right) + \left(\frac{7}{2} + \frac{7}{3}i\right) &= \left(1 + \frac{1}{2} + 3 + \frac{7}{2}\right) + \left(2 + 1 + \frac{2}{3} + \frac{7}{3}\right)i \\ &= 8 + 6i \end{align} \]
Hence, \(\left(1 + 2i\right) + \left(\frac{1}{2} + i\right) + \left(3 + \frac{2}{3}i\right) + \left(\frac{7}{2} + \frac{7}{3}i\right) = 8 + 6i\).
Find the sum of the following complex numbers \(2 + 3i\), \(-\frac{1}{2} + i\), and \(-\frac{5}{2} - \frac{5}{3}i\) using ordered pairs.
Solution:
The complex number, \(2 + 3i\), has the ordered pair \((2,3)\) in the complex plane. The complex number, \(-\frac{1}{2} + i\), has the ordered pair \(\left(-\frac{1}{2},1\right)\) in the complex plane. The complex number, \(-\frac{5}{2} - \frac{5}{3}i\), has the ordered pair \(\left(-\frac{5}{2},-\frac{5}{3}\right)\) in the complex plane.
The result of the addition, \((2 + 3i) + \left(-\frac{1}{2} + i\right) + \left(-\frac{5}{2} - \frac{5}{3}i\right)\) will result in the ordered pair \((x,y)\) in the complex plane where \(x\) is the sum of the x-coordinates and \(y\) is the sum of the y-coordinates of the two ordered pairs. Thus,
\[ \begin{align} x &= 2 + -\frac{1}{2} + -\frac{5}{2} = -1 \\ y &= 3 + 1 + -\frac{5}{3} = \frac{7}{3} \end{align} \]
The resulting ordered pair is, therefore, \(\left(-1,\frac{7}{3}\right)\), which corresponds to the complex number \(-1 + \frac{7}{3}i\).
In the above section, ??.4 Complex Conjugate, we saw an interesting property of a complex number and its complex conjugate: The sum of a complex number, \(a + bi\), and its complex conjugate, \(a - bi\) is always the real number \(2a\).
This next example verifies this property.
Verify the property \((a + bi) + (a - bi) = 2a\)
Solution:
Using the definition of complex number addition where we add the real parts and the imaginary parts, we see:
\[ \begin{align} (a + bi) + (a - bi) &= (a + a) + (bi - bi) \\ &= (a+a) + (b - b)i \\ &= 2a + 0i \\ &= 2a \end{align} \]
Thus, \((a + bi) + (a - bi) = 2a\).
We could also verify this by using ordered pairs. The ordered pair associated with \(a + bi\) is \((a,b)\). The ordered pair associated with \(a - bi\) is \((a,-b)\). We know that the resulting ordered pair of the sum \((a + bi) + (a - bi)\) will be \((x,y)\), where \(x\) is the sum of the x-coordinates and \(y\) is the sum of the y-coordinates of the individual ordered pairs. Thus \(x = a + a = 2a\) and \(y = b + -b = 0\). Thus the resulting ordered pair of \((a + bi) + (a - bi)\) is \((2a,0)\), which is the complex number \(2a + 0i\), or simply \(2a\).
Thus, \((a + bi) + (a - bi) = 2a\).
We can also verify this property using vector addition. The vector associated with \(a + bi\) is \(<a,b>\). The vector associated with \(a - bi\) is \(<a,-b>\). Using vector addition, where we place the tail of vector \(<a,-b>\) at the head of vector \(<a,b>\), we will visually see what \((a + bi) + (a - bi)\) is. The following complex plot is a visualization of this idea:
Thus, \((a + bi) + (a - bi) = 2a\).
This next example will seek to verify this property using a specific complex number.
Verify \((a + bi) + (a - bi) = 2a\) for the complex number \(1 + 4i\).
Solution:
For the given \(1 + 4i\), \(a =1\) and \(b = 4\). This property, then, says that the sum of this complex number and its complex conjugate, \(1 - 4i\), will be \(2a = 2(1) = 2\). Let’s do the actual complex addition of \(1 + 4i\) and its complex conjugate, \(1 - 4i\):
\[ \begin{align} (1 + 4i) + (1 - 4i) &= (1 + 1) + (4 - 4)i \\ &= 2 + 0 = 2 \end{align} \]
The expected answer of \(2\) from the property, \((a + bi) + (a - bi) = (a + a) + (bi - bi) = 2a\), was verified by doing the actual complex addition.
The next arithmetic operation to consider is subtraction.
The subtraction of two complex numbers is nothing more than the subtraction of the real parts and the subtracting of the imaginary parts.
\[ \begin{align} (a + bi) - (c + di) &= (a - c) + (bi - di) \\ & = (a - c) + (b - d)i \end{align} \]
If this looks a little confusing remember that you can always turn a subtraction problem into an addition problem. In this case that would be to distribute the \(-1\) across the second complex number:
\[ \begin{align} (a + bi) - (c + di) &= (a + bi) + -(c + di) \\ &= (a + bi) + (-c + -di) \\ &= (a + -c) + (bi + -di) \\ &= (a - c) + (b - d)i \end{align} \]
CONCEPT: The subtraction of two complex numbers, \(a + bi\) and \(c + di\), is the subtracting of the real parts and the imaginary parts. that is
\[ \begin{align} (a + bi) - (c + di) &= ((a - c) + (b - d)i \end{align} \]
To enhance our understanding of the subtraction of complex numbers let us look at it from a visualization perspective. Using the subtraction of \(4 - 2i\) from \(2 + 3i\) as an example, here is the complex plot of these two complex numbers along with the associated vectors of each: the vectors \(<4,-2>\) and \(<2,3>\) for the complex numbers, \(4 - 2i\) and \(2 + 3i\), respectively. Each complex number is associated with an ordered pair in the complex plane. The complex number \(4 - 2i\) has the ordered pair, \((4,-2)\); the complex number \(2 + 3i\) has the ordered pair, \((2,3)\).
Now, to actually do the subtraction, especially using vector addition, I’m going to turn the subtraction problem into an addition problem. Thus, instead of \((2 + 3i) - (4 - 2i)\) will be doing \((2 + 3i) + (-4 + 2i)\). All this means from a vector perspective is that the vector \(<4,-2>\) is flipped 180 degrees to \(<-4,2>\). The following complex plot shows this idea:
Now that we turned the subtraction problem into an addition problem, we can use vector addition where we will place the tail of vector \(<-4,2>\) at the head of vector \(<2,3>\), where we will visually see what \((2 + 3i) + (-4 + 2i)\) is in the following complex plot (I removed the original vector \(<4,-2>\) to reduce clutter):
An interesting observation here is that using the idea of a complex number having an ordered pair in the complex plane, then the subtraction of two complex numbers \(a + bi\) and \(c + di\), which have the ordered pairs in the complex plane, \((a,b)\), \((c,d)\), respectively, results in the ordered pair \((x,y)\) where \(x = a - c\), the difference of the x-coordinates of the two individual ordered pairs, and \(y = b - c\), the difference of the y-coordinates of the two individual ordered pairs.
CONCEPT: The two complex numbers, \(a + bi\) and \(c + di\), will have the ordered pairs, \((a,b)\) and \((c,d)\), respectively in the complex plane. The subtraction \((a + bi) - (c + di)\) will produce the ordered pair in the complex plane \((x,y)\) where \(x = a - c\), the difference of the x-coordinates of the two individual ordered pairs, and \(y = b - c\), the difference of the y-coordinates of the two individual ordered pairs.
What if we have more than two complex numbers of which we want to take the difference? If the addition of more than two complex numbers is the adding the real parts together and adding the imaginary parts together, subtraction is nothing more than taking their difference. However, I do highly recommend that the simplest thing to do is to first turn the subtraction into an addition problem. Using that idea then the subtraction of \(n\) complex numbers would be:
\[ \begin{align} (a_{1} + b_{1}i) - (a_{2} + b_{2}i) - \cdots - (a_{n} + b_{n}i) &= (a_{1} + b_{1}i) + -(a_{2} + b_{2}i) + \cdots + -(a_{n} + b_{n}i) \\ &= (a_{1} + b_{1}i) + (-a_{2} + -b_{2}i) + \cdots + (-a_{n} + -b_{n}i) \\ &= (a_{1} - a_{2} - \cdots - a_{n}) + (b_{1} - b_{2} - \cdots - b_{n})i \end{align} \]
CONCEPT: The subtraction of more than two complex numbers is taking the difference of the real and the imaginary parts. I recommend turning the subtraction problem into an addition problem. Either way, in general, the addition of \(n\) complex numbers is
\[ \begin{align} (a_{1} + b_{1}i) - (a_{2} + b_{2}i) - \cdots - (a_{n} + b_{n}i) &= (a_{1} - a_{2} - \cdots - a_{n}) + (b_{1} - b_{2} - \cdots - b_{n})i \end{align} \]
It is also true that the difference of more than two complex numbers will result in the ordered pair, \((x,y)\), in the complex plane. The x-coordinate will be just the difference of all the x-coordinates of each individual ordered pair. The y-coordinate will be just the difference of all the y-coordinates of each individual ordered pair.
One final note worth mentioning is that since the subtraction of complex numbers is performing the arithmetic operation of subtraction, the order in which the complex numbers are subtracted matters. However, if you first turn the subtraction problem into an addition problem, then the order in which the addition is done does not matter.
Let’s look at some examples, first the difference of just two complex numbers.
Find the difference of the two complex numbers \(1 + 2i\) and \(4 - 3i\) using the definition of complex number arithmetic.
Solution:
The definition of complex number arithmetic is given two complex numbers, \(a + bi\) and \(c + di\), then \((a + bi) - (c + di) = (a + c) - (b + d)i\); i.e., the subtracting of the real parts and the subtracting of the imaginary. For these two complex numbers \(1 + 2i\) and \(4 - 3i\) we see that \(a = 1\), \(b = 2\), \(c = 4\), and \(d = -3\). Applying the definition we get:
\[ \begin{align} (1 + 2i) - (4 - 3i) &= (1 + 2i) - (2 + -3)i \\ &= (1 - 4) + (2 + 3)i \\ &= -3 + 5i \end{align} \]
Thus, \((1 + 2i) - (4 - 3i) = -3 + 5i\).
As mentioned, I highly recommend turning the subtraction problem into an addition problem. Let’s do that:
\[ \begin{align} (1 + 2i) - (4 - 3i) &= (1 + 2i) + -(4 - 3)i \\ &= (1 + 2i) + (-4 + 3)i \\ &= (1 + -4) + (2 + 3)i \\ &= -3 + 5i \end{align} \]
The same result, \(-3 + 5i\), was obtained. It’s up to you which approach you prefer.
Find the difference of the two complex numbers \(-3 + 7i\) and \(4 - 5i\) using ordered pairs.
Solution:
The complex number, \(-3 + 7i\), has the ordered pair \((-3,7)\) in the complex plane. The complex number, \(4 - 5i\), has the ordered pair \((4,-5)\) in the complex plane. The result of the subtraction, \((-3 + 7i) - (4 - 5i)\) will result in the ordered pair \((x,y)\) in the complex plane where \(x\) is the difference of the x-coordinates and \(y\) is the difference of the y-coordinates of the two ordered pairs. Thus,
\[ \begin{align} x &= -3 - 4 = -7 \\ y &= 7 - -5 = 12 \end{align} \]
The resulting ordered pair is, therefore, \((-7,12)\), which corresponds to the complex number \(-7 + 12i\).
Now let’s subtract more than two complex numbers.
Find the difference of the following complex numbers \(1 - 2i\), \(-\frac{1}{2} + i\), \(-3 - \frac{2}{3}i\) and \(\frac{7}{2} - \frac{5}{3}i\).
Solution:
To subtract two or more complex numbers we take the difference of the real parts and we take the difference of the imaginary parts:
\[ \begin{align} \left(1 - 2i\right) - \left(-\frac{1}{2} + i\right) - \left(-3 - \frac{2}{3}i\right) - \left(\frac{7}{2} - \frac{5}{3}i\right) &= \left(1 - 2i\right) + -\left(-\frac{1}{2} + i\right) + -\left(-3 - \frac{2}{3}i\right) + -\left(\frac{7}{2} - \frac{5}{3}i\right) \\ &= \left(1 - 2i\right) + \left(\frac{1}{2} - i\right) + \left(3 + \frac{2}{3}i\right) + \left(-\frac{7}{2} + \frac{5}{3}i\right) \\ &= \left(1 + \frac{1}{2} + 3 - \frac{7}{2}\right) + \left(-2 - 1 + \frac{2}{3} + \frac{5}{3}\right)i \\ &= \left(4 - \frac{6}{2}\right) + \left(-3 + \frac{7}{3}\right)i \\ &= 1 - \frac{2}{3}i \end{align} \]
Hence, \(\left(1 - 2i\right) - \left(-\frac{1}{2} + i\right) - \left(-3 - \frac{2}{3}i\right) - \left(\frac{7}{2} - \frac{5}{3}i\right) = 1 - \frac{2}{3}i\).
Let’s verify this by using the above generalization that \((a_{1} + b_{1}i) - (a_{2} + b_{2}i) - (a_{3} + b_{3}i) - (a_{4} + b_{4}i) = (a_{1} - a_{2} - a_{3} - a_{4}) + (b_{1} - b_{2} - b_{3} - b_{4})i\). In this problem \(a_{1} = 1\), \(a_{2} = -\frac{1}{2}\), \(a_{3} = -3\), \(a_{4} = \frac{7}{2}\), \(b_{1} = -2\), \(b_{2} = 1\), \(b_{3} = -\frac{2}{3}\), and \(b_{4} = -\frac{5}{3}\):
\[ \begin{align} (a_{1} + b_{1}i) - (a_{2} + b_{2}i) - (a_{3} + b_{3}i) - (a_{4} + b_{4}i) &= (a_{1} - a_{2} - a_{3} - a_{4}) + (b_{1} - b_{2} - b_{3} - b{4}) \\ \left(1 - 2i\right) - \left(-\frac{1}{2} + i\right) - \left(-3 - \frac{2}{3}i\right) - \left(\frac{7}{2} - \frac{5}{3}i\right) &= \left(1 - -\frac{1}{2} - -3 - \frac{7}{2}\right) + \left(-2 - 1 - -\frac{2}{3} - -\frac{5}{3}\right)i \\ &= -1 - \frac{2}{3}i \end{align} \]
They match!
Find the sum of the following complex numbers \(2 + 3i\), \(-\frac{1}{2} + i\), and \(-\frac{5}{2} - \frac{5}{3}i\) using ordered pairs.
Solution:
The complex number, \(2 + 3i\), has the ordered pair \((2,3)\) in the complex plane. The complex number, \(-\frac{1}{2} + i\), has the ordered pair \(\left(-\frac{1}{2},1\right)\) in the complex plane. The complex number, \(-\frac{5}{2} - \frac{5}{3}i\), has the ordered pair \(\left(-\frac{5}{2},-\frac{5}{3}\right)\) in the complex plane.
The result of the subtraction, \((2 + 3i) - \left(-\frac{1}{2} + i\right) - \left(-\frac{5}{2} - \frac{5}{3}i\right)\) will result in the ordered pair \((x,y)\) in the complex plane where \(x\) is the difference of the x-coordinates and \(y\) is the difference of the y-coordinates of the two ordered pairs. Thus,
\[ \begin{align} x &= 2 - -\frac{1}{2} - -\frac{5}{2} = 5 \\ y &= 3 - 1 - -\frac{5}{3} = \frac{11}{3} \end{align} \]
The resulting ordered pair is, therefore, \(\left(5,\frac{11}{3}\right)\), which corresponds to the complex number \(5 + \frac{11}{3}i\).
In the above section, ??.4 Complex Conjugate, we saw an interesting property of a complex number and its complex conjugate: The difference of a complex number, \(a + bi\), and its complex conjugate, \(a - bi\) is always the imaginary number \(2bi\).
This next example verifies this property.
Verify the property \((a + bi) - (a - bi) = 2bi\)
Solution:
Using the definition of complex number subtraction where we subtract the real parts and the imaginary parts, we see (again, turning this into an addition problem):
\[ \begin{align} (a + bi) - (a - bi) &= (a + bi) + -(a - bi) \\ &= (a + bi) + (-a + bi) \\ &= (a + -a) + (bi + bi) \\ &= 0 + (b + b)i \\ &= 2bi \end{align} \]
Thus, \((a + bi) - (a - bi) = 2bi\).
We could also verify this by using ordered pairs. The ordered pair associated with \(a + bi\) is \((a,b)\). The ordered pair associated with \(a - bi\) is \((a,-b)\). We know that the resulting ordered pair of the difference \((a + bi) - (a - bi)\) will be \((x,y)\), where \(x\) is the difference of the x-coordinates and \(y\) is the difference of the y-coordinates of the individual ordered pairs. Thus \(x = a - a = 0\) and \(y = b - -b = b + b = 2b\). Thus the resulting ordered pair of \((a + bi) + (a - bi)\) is \((0,2b)\), which is the complex number \(0 + 2bi\), or simply \(2bi\).
Thus, \((a + bi) - (a - bi) = 2bi\).
We can also verify this property using vector subtraction which we’ll turn into vector addition. The vector associated with \(a + bi\) is \(<a,b>\). The vector associated with \(a - bi\) is \(<a,-b>\). However when turning the problem into an addition problem this vector gets flipped 180 degrees to become \(<-a,b>\). Using vector addition, where we place the tail of vector \(<-a,b>\) at the head of vector \(<a,b>\), we will visually see what \((a + bi) - (a - bi)\) is. The following complex plot is a visualization of this idea:
Thus, \((a + bi) - (a - bi) = 2bi\).
This next example will seek to verify this property using a specific complex number.
Verify \((a + bi) - (a - bi) = 2bi\) for the complex number \(1 + 4i\).
Solution:
For the given \(1 + 4i\), \(a =1\) and \(b = 4\). This property, then, says that the difference of this complex number and its complex conjugate, \(1 - 4i\), will be \(2bi = 2(4)i = 8i\). Let’s do the actual complex difference of \(1 + 4i\) and its complex conjugate, \(1 - 4i\):
\[ \begin{align} (1 + 4i) - (1 - 4i) &= (1 + 4i) + -(1 - 4i) \\ &= (1 + 4i) + (-1 + 4i) \\ &= (1 + -1) + (4i + 4i) \\ &= (1 + -1) + (4 + 4)i \\ &= 0 + 8i \\ &= 8i \end{align} \]
The expected answer of \(8i\) from the property, \((a + bi) - (a - bi) = 2bi\), was verified by doing the actual complex addition.
The next arithmetic operation to consider is multiplication.
For two complex numbers, \(a + bi\) and \(c + di\), we are interested in what is the product \((a + bi)(c + di)\). If we take a close look at this we realize that this is nothing more than the product of two binomials, that is the multiplication of two algebraic expressions each with two terms (which is what a binomial is). Well, we know how to do this using the distributive property. Let’s do that:
\[ \begin{align} (a + bi)(c + di) &= ac + adi + bci + bdi^{2} \\ &= ac + (ad + bc)i + bdi^{2} \end{align} \]
But, remember that \(i^{2} = -1\). Making that substitution:
\[ \begin{align} (a + bi)(c + di) &= ac + adi + bci + bdi^{2} \\ &= ac + (ad + bc)i + bdi^{2} \\ &= ac + (ad + bc)i - bd \\ &= (ac - bd) + (ad + bc)i \end{align} \]
CONCEPT: The multiplication of two complex numbers is nothing more than the multiplication of two binomials. In doing so a term \(i^{2}\) will always result which must be replaced with what it equals, \(i^{2} = -1\). Thus, the product of two complex numbers, \(a + bi\) and \(c + di\), is:
\[ \begin{align} (a + bi)(c + di) &= (ac - bd) + (ad + bc)i \end{align} \]
Unfortunately, the visualization of how multiplication works is beyond the level we are at here. It is a bit more complicated than the addition or subtraction. But, we can show the complex plot of two complex numbers and their product. The following complex plot shows the complex number, \(-4 + i\), with its associated ordered pair, \((-4,1)\), multiplied to the complex number \(2 + 3i\), with its associated ordered pair, \((2,3)\), and the resulting product of \(-11 - 10i\), with its associated ordered pair, \((-11 - 10)\).
With the realization that a complex number \(a + bi\) is a binomial then the multiplication of more than two complex numbers is nothing more than the multiplication of the binomials representing each complex number. The general case for the multiplication of \(n\) complex numbers can get quite messy, so we will refrain from doing here and will be left as an exercise.
CONCEPT: The multiplication of more than two complex numbers is nothing more than the multiplication of the binomials representing each complex number.
Since the multiplication of complex numbers is just the multiplication of the binomials representing each complex number, the order in which the complex numbers are multiplied does not matter.
Let’s look at some examples, first the multiplication of just two complex numbers.
Find the product of the two complex numbers \(1 + 2i\) and \(4 - 3i\).
Solution:
The multiplication of two complex numbers is nothing more than the product of the two binomials representing the two complex numbers:
\[ \begin{align} (1 + 2i)(4 - 3i) &= (1)(4) + (1)(-3i) + (4)(2i) + (2i)(-3i) \\ &= 4 - 3i + 8i - 6i^{2} \\ &= 4 + 5i + 6 \\ &- 10 + 5i \end{align} \]
Let’s verify this using \((a + bi)(c + di) = (ac - bd) + (ad + bc)i\). Here \(a = 1\), \(b = 2\), \(c = 4\), \(d = -3\):
\[ \begin{align} (1 + 2i)(4 - 3i) &= (1)(4) - (2)(-3) + \left[(1)(-3) + (2)(4)\right]i \\ &= 4 + 6 + (-3 + 8)i \\ &= 10 + 5i \end{align} \]
They match!!
Now, let’s look at example of the multiplication of more than two complex numbers.
Find the product of the four complex numbers \(-2 + i\), \(1 - 2i\), \(3 - 4i\), and \(-1 - i\).
Solution:
The multiplication of complex numbers is nothing more than the product of the binomials representing each of the complex numbers, we are looking for \((-2 + i)(1 - 2i)(3 - 4i)(-1 - i)\). To solve this, let’s take two complex numbers at a time starting with the first two:
\[ \begin{align} (-2 + i)(1 - 2i) &= -2 + 4i + i - 2i^{2} \\ &= -2 + 5i + 2 \\ &= 5i \end{align} \]
Now, let’s take the second two complex numbers:
\[ \begin{align} (3 - 4i)(-1 - i) &= -3 - 3i + 4i + 4i^{2} \\ &= -3 + i - 4 \\ &= -7 + i \end{align} \]
And, finally, let’s multiply these two partial results together:
\[ \begin{align} (5i)(-7 + i) &= -35i +5i^{2} \\ &= -5 - 35i \end{align} \]
Thus, \((-2 + i)(1 - 2i)(3 - 4i)(-1 - i) = -5 - 35i\)
Note: The order of multiplication chosen was but one approach. Left as an additional exercise to the reader to perform this multiplication in a different order to verify that the answer would be the same.
In the above section, ??.4 Complex Conjugate, we saw an interesting property of a complex number and its complex conjugate: The product of a complex number, \(a + bi\), and its complex conjugate, \(a - bi\) is always the real number \(a^{2} + b^{2}\).
This next example verifies this property.
Verify the property \((a + bi)(a - bi) = a^{2} + b^{2}\)
Solution:
The multiplication of two complex numbers is nothing more than the multiplication of two binomials. Let’s do that for \(a + bi\) and \(a - bi\):
\[ \begin{align} (a + bi)(a - bi &= a(a) + a(-bi) + a(bi) + bi(-bi) \\ &= a^{2} - abi + abi - b^{2}i^{2} \\ &= a^{2} + b^{2} \end{align} \]
Thus, \((a + bi)(a - bi) = a^{2} + b^{2}\).
The best visualization given the limitation we have on showing the product of two vectors is the complex plot of the complex number, \(a + bi\), and its complex conjugate, \(a - bi\), along with the real number \(a^{2} + b^{2}\):
This next example will seek to verify this property using a specific complex number.
Verify \((a + bi)(a - bi) = a^{2} + b^{2}\) for the complex number \(2 + 3i\).
Solution:
The complex number, \(2 + 3i\), has the complex conjugate, \(2 - 3i\). The product is \(2+3i)(2-3i)\), so \(a = 2\) and \(b = 3\) (note, \(b = -3i\) could have chosen as well). Thus, we would expect the product to be \(2^{2} + 3^{2} = 4 + 9 = 13\).
Now, let’s do the actual multiplication:
\[ \begin{align} (2 + 3i)(2 - 3i) &= 2(2) + 2(-3i) + 2(3i) + (3i)(-3i) \\ &= 4 - 6i + 6i - 9i^{2} \\ &= 4 + 9 \\ &= 13 \end{align} \]
They match, thus \((a + bi)(a - bi) = a^{2} + b^{2}\) has been verified for the complex number \(2 + 3i\).
And, finally, let’s look at the arithmetic operation of division.
For two complex numbers, \(a + bi\) and \(c + di\), we are now interested in how to find the quotient of \(a + bi\) divided by \({c + di}\). That is, what is \(\frac{a + bi}{c + di}\)? This is an interesting question.
Let’s first consider \(\frac{4 + 5i}{7}\). Here we are dividing the complex number, \(4 + 5i\), by the real number \(7\) (though it can be argued that \(7\) is also a complex number, \(7 + 0i\)). We know how to do this:
\[ \begin{align} \frac{4 + 5i}{7} &= \frac{4}{7} + \frac{5i}{7} \end{align} \]
Here, we were dividing the real and imaginary parts, \(4\) and \(5i\), respectively, by the real number \(7\). No problem. But what if we were dividing \(4 + 5i\) by \(2 + 3i\)? We don’t know how to divide “i” into a real number. So, what we want to do is to eliminate the imaginary part of the denominator. We know how to do this. We would multiply the denominator by its complex conjugate! And, obviously, we would have to also multiply the numerator by it as well. By doing so, we eliminated the imaginary part in the denominator which then allows us to proceed with the division as above.
This leads us to the definition of complex division. To divide \(a + bi\) by \(c + di\):
\[ \begin{align} \frac{a + bi}{c + di} &= \left(\frac{a + bi}{c + di}\right)\left(\frac{c - di}{c - di}\right) \\ \\ &= \frac{ac - adi + bci - bdi^{2}}{c^{2} - cdi + cdi - d^{2}i^{2}} \\ \\ &= \frac{(ac + bd) + (bc - ad)i}{c^{2} + d^{2}} \end{align} \]
Note: This answer is perfectly fine! Though if perhaps for simplification, or because you were instructed to, the answer could be written as:
\[ \begin{align} \frac{a + bi}{c + di} &= \frac{(ac + bd) + (bc - ad)i}{c^{2} + d^{2}} \\ \\ &= \frac{ac + bd}{c^{2} + d^{2}} + \frac{bc - ad}{c^{2} + d^{2}}i \end{align} \]
So, when faced with the division of two complex numbers, multiply both the numerator and denominator by the complex conjugate of the denominator, and do the complex arithmetic.
CONCEPT: The division of two complex numbers is achieved by the multiplication of both the numerator and denominator by the complex conjugate of the denominator, and do the complex arithmetic to get
\[ \frac{a + bi}{c + di} = \frac{(ac + bd) + (bc - ad)i}{c^{2} + d^{2}} = \frac{ac + bd}{c^{2} + d^{2}} + \frac{bc - ad}{c^{2} + d^{2}}i \]
That’s complex division in a nutshell. It is (relatively) straight forward.
Let’s look at some examples:
Given the complex numbers, \(-2 + i\) and \(1 - 2i\), find their quotient.
Solution:
Since we are doing division, we are looking for \(\frac{-2 + i}{1 - 2i}\). To find this, we must multiply both the numerator and the denominator by the complex conjugate of \(-2 + i\):
\[ \begin{align} \frac{-2 + i}{1 - 2i} &= \left(\frac{-2 + i}{1 - 2i}\right) \left(\frac{1 + 2i}{1 + 2i}\right) \\ &= \frac{-2 - 4i + i + 2i^{2}}{1 + 2i - 2i - 4i^{2}} \\ &= \frac{-2 - 3i - 2}{1 + 4} \\ &= \frac{-4 - 3i}{5} \end{align} \]
Thus, \(\frac{-2 + i}{1 - 2i} = \frac{-4 - 3i}{5}\). A couple of things to note: First, the denominator is real, as expected since we multiplied \(1 - 2i\) by its complex conjugate \(1 + 2i\). Second, the question is always is this answer sufficient or should it be expressed as \(-\frac{4}{5} - \frac{3}{5}i\). Either one is correct, obviously. How you express the answer would be dependent on the contextual situation. Personally, the answer \(\frac{-4 - 3i}{5}\) is perfectly fine.
We can verify this answer by using the fact that \(\frac{a + bi}{c + di} = \frac{(ac + bd) + (bc - ad)i}{c^{2} + d^{2}}\). In this example \(a=-2\), \(b = 1\), \(c = 1\), and \(d = -2\) which leads to:
\[ \begin{align} \frac{-2 + i}{1 - 2i} &= \frac{\left[(-2)(1) + (1)(-2)\right] + \left[(1)(1)-(-2)(-2)\right]i}{(1)^{2} + (-2)^{2}} \\ \\ &= \frac{-2 + -2 + (1 - 4)i}{1 + 4} \\ \\ &= \frac{-4 - 3i}{5} \end{align} \]
The answers match.
Given the complex numbers, \(4 - 8i\) and \(2 + 5i\), find their quotient.
Solution:
Since we are doing division, we are looking for \(\frac{4 - 8i}{2 + 5i}\). To find this, we must multiply both the numerator and the denominator by the complex conjugate of \(2 - 5i\):
\[ \begin{align} \frac{4 - 8i}{2 + 5i} &= \left(\frac{4 - 8i}{2 + 5i}\right)\left(\frac{2 - 5i}{2 - 5i}\right) \\ \\ &= \frac{8 - 20i-16i+40i^{2}}{4+25} \\ \\ &= \frac{-32-36i}{29} \end{align} \]
Thus, \(\frac{4 - 8i}{2 + 5i} = \frac{-32-36i}{29}\)
We can verify this answer by using the fact that \(\frac{a + bi}{c + di} = \frac{(ac + bd) + (bc - ad)i}{c^{2} + d^{2}}\). In this example \(a=4\), \(b = -8\), \(c = 2\), and \(d = 5\) which leads to:
\[ \begin{align} \frac{4 - 8i}{2 + 5i} &= \frac{\left[(4)(2) + (-8)(5)\right] + \left[(-8)(2)-(4)(5)\right]i}{(2)^{2} + (5)^{2}} \\ \\ &= \frac{8 + -40 + (-16 - 20)i}{4 + 25} \\ \\ &= \frac{-32 - 36i}{29} \end{align} \]
The answers match.
Given the complex numbers, \(\frac{1}{2} - 3i\) and \(-\frac{2}{3} + 5i\), find their quotient using the fact that \(\frac{a + bi}{c + di} = \frac{(ac + bd) + (bc - ad)i}{c^{2} + d^{2}}\).
Solution:
Since we are doing division, we are looking for \(\frac{\frac{1}{2} - 3i}{-\frac{2}{3} + 5i}\). Here \(a = \frac{1}{2}\), \(b = -3\), \(c = -\frac{2}{3}\), and \(d = 5\) which leads to:
\[ \begin{align} \frac{\frac{1}{2} - 3i}{-\frac{2}{3} + 5i} &= \frac{\left[\left(\frac{1}{2}\right)\left(-\frac{2}{3}\right)+(-3)(5)\right] + \left[(-3)\left(-\frac{2}{3}\right)-\left(\frac{1}{2}\right)(5)\right]i}{\left(-\frac{2}{3}\right)^{2} + (5)^{2}} \\ \\ &= \frac{-\frac{1}{3} -15 + \left(2 - \frac{5}{2}\right)i}{\frac{4}{9} + 25} \\ \\ &= \frac{-\frac{46}{3} - \frac{1}{2}i}{\frac{229}{9}} \\ \\ &= \frac{-138 - \frac{9}{2}i}{229} \end{align} \] Thus, \(\frac{\frac{1}{2} - 3i}{-\frac{2}{3} + 5i} = \frac{-138 - \frac{9}{2}i}{229}\)
Note, in this example it was not asked to verify the solution. That said, I would recommend that you do verify it by actually doing the multiplication of \(\frac{\frac{1}{2} - 3i}{-\frac{2}{3} + 5i}\) by the complex conjugate \(-\frac{2}{3} - 5i\) in the numerator and denominator. This will give you a sense of how, in certain cases like this one where there are fractions involved, using the fact that \(\frac{a + bi}{c + di} = \frac{(ac + bd) + (bc - ad)i}{c^{2} + d^{2}}\) might be the easier approach. Or it may not.
Another suggestion for verification is to remember that any division \(\frac{N}{D} = Q + \frac{R}{D}\), where \(Q\) is the quotient and \(R\) is the remainder, can be verified by reproducing the \(N\) via \(N = D\left(Q + \frac{R}{D}\right)\).
For example, in Exercise ??.??, we found \(\frac{-2 + i}{1 - 2i} = \frac{-4 - 3i}{5}\). Let’s verify the answer using this idea:
\[ \begin{align} \frac{-2 + i}{1 - 2i} &\mathrel{\overset{?}{=}} \frac{-4 - 3i}{5} \\ -2 + i &\mathrel{\overset{?}{=}} (1 - 2i)\left(\frac{-4 - 3i}{5}\right) \\ \\ -2 + i &\mathrel{\overset{?}{=}} \frac{-4 - 3i + 8i + 6i^{2}}{5} \\ \\ -2 + i &\mathrel{\overset{?}{=}} \frac{-10 + 5i}{5} \\ \\ -2 + i &= -2 + i \end{align} \]
The answer was correct.
So far we have been doing each arithmetic operation individually. Obviously, there will be cases where the need to combine them will be necessary. The next section deals with this idea.
We have now seen all four of the arithmetic operations, addition, subtraction, multiplication, and division, of complex numbers individually. It is not an unreasonable expectation that these operations will need to be combined. Doing so is just a matter of doing the operations as you would any normal algebraic expression. The only difference is that the entities involved are complex numbers.
Let’s look at some examples. This first one deals with the case where we have a numerator and denominator and in each there is a rational expression:
Find the result of dividing \(\frac{1 + i}{2 - i}\) by \(\frac{3 + 2i}{-2 + i}\)
Solution:
We are asked to find:
\[ \frac{\frac{1 + i}{2 - i}}{\frac{3 + 2i}{-2 + i}} \]
There are several ways to work this problem. One way to approach this is to start with the division of the expression in the numerator by the expression in the denominator then do the final division by using the complex conjugate.
\[ \begin{align} \frac{\frac{1 + i}{2 - i}}{\frac{3 + 2i}{-2 + i}} &= \left(\frac{1 + i}{2 - i}\right)\left(\frac{-2 + i}{3 + 2i}\right) \\ &= \frac{-2 + i - 2i + i^{2}}{6 + 4i - 3i -2i^{2}} \\ &= \frac{-3 - i}{8 + i} \\ &= \left(\frac{-3 - i}{8 + i}\right)\left(\frac{8 - i}{8 - i}\right) \\ &= \frac{-24 + 3i - 8i + i^{2}}{64 - i^{2}} \\ &= \frac{-25 - 5i}{65} \\ &= \frac{-5 - i}{13} \end{align} \]
Thus, \(\frac{\frac{1 + i}{2 - i}}{\frac{3 + 2i}{-2 + i}} = \frac{-5 - i}{13}\)
Note: On a problem like this it is common that the answer is left as \(\frac{-3 - i}{8 + i}\). No. The question was what the result was of \(\frac{\frac{1 + i}{2 - i}}{\frac{3 + 2i}{-2 + i}}\). This means that the division of \(\frac{-3 - i}{8 + i}\) must be done.
This next example takes a look at taking the difference of two rational complex expressions.
Find \(\frac{1+i}{2+i} - \frac{3+i}{1+3i}\)
Solution:
In this problem we are subtracting two rational expressions, thus they must be first combined to produce one complex rational expression, followed by the final division.
\[ \begin{align} \frac{1+i}{2+i} - \frac{3+i}{1+3i} &= \frac{(1+i)(1+3i) - (2+i)(3+i)}{(2+i)(1+3i)} \\ &= \frac{1+3i+i-3 - (6+2i+3i-1)}{2 + 6i + i - 3} \\ &= \frac{-2 + 4i - (5 + 5i)}{-1 + 7i} \\ &= \frac{-7 - i}{-1 + 7i} \\ &= \left(\frac{-7 - i}{-1 + 7i}\right)\left(\frac{-1-7i}{-1-7i}\right) \\ &= \frac{7 + 50i - 7}{1 + 49} \\ &= \frac{50i}{50} \\ &= i \end{align} \]
Thus, \(\frac{1+i}{2+i} - \frac{3+i}{1+3i} = i\). (Always amazes me how something relatively complicated looking can reduce to something very simple!)
Let’s look at one more example where we are combining multiplication, subtraction, and ultimately, division:
Find \(\left(\frac{1 + i}{2-i}\right)\left(\frac{3 + 2i}{4 - 2i}\right) - \frac{5 + 2i}{1 - i}\)
Solution:
Let’s look at \(\left(\frac{1 + i}{2-i}\right)\left(\frac{3 + 2i}{4 - 2i}\right)\) first:
\[ \begin{align} \left(\frac{1 + i}{2-i}\right)\left(\frac{3 + 2i}{4 - 2i}\right) &= \frac{3 + 2i + 3i + 2i^{2}}{8 - 4i - 4i + 2i^{2}} \\ &= \frac{1 + 5i}{6 - 8i} \end{align} \]
Now, we need to find:
\[ \begin{align} \frac{1 + 5i}{6 - 8i} - \frac{5 + 2i}{1 - i} &= \frac{1 - i + 5i - 5i^{2} - \left(30 - 40i + 12i - 16i^{2}\right)}{6 - 6i - 8i + 8i^{2}} \\ &= \frac{6 + 4i - (46 - 28i)}{-2 - 14i} \\ &= \frac{-40 + 32i}{-2 - 14i} \end{align} \]
And, finally we do the division:
\[ \begin{align} \left(\frac{-40 + 32i}{-2 - 14i}\right)\left(\frac{-2 + 14i}{-2 + 14i}\right) &= \frac{80 - 560i -64i +448i^{2}}{(2)^{2} + (14^{2})} \\ &= \frac{-368 - 624i}{200} \\ &= \frac{-46 - 78i}{25} \end{align} \]
Thus, \(\left(\frac{1 + i}{2-i}\right)\left(\frac{3 + 2i}{4 - 2i}\right) - \frac{5 + 2i}{1 - i} = \frac{-46 - 78i}{25}\)
Note: since this problem was basically just the algebraic combination of rational expressions, there was more than one way that this problem could have been approached. This is true in algebra in general. The approach taken was but one way. You might have taken another approach which, as long as it was algebraically correct, was okay too.
This section on the arithmetic combination of complex numbers discussed the arithmetic operations of addition, subtraction, multiplication, and division of complex numbers. Hopefully, it was recognized that in general it is nothing more than arithmetically combining algebraic expressions. That said, there are two minor exceptions. First, remember that these are complex numbers which really doesn’t make much of a difference except that it should never be forgotten that \(i^{2} = -1\). Second, division is a bit different, requiring the use of complex conjugates; yet it can be argued that it is actually easier.
There are many reasons as to why you should care about complex numbers. They are essential in understanding alternating electrical currents (one of the two forms of electricity), signal processing, quantum mechanics, and many others. In this Why You Should Care we will explore two key areas in mathematics, root finding and trigonometry.
Root Finding
As alluded to above, root finding is the process of understanding when a function, \(f(x)\), has an output of zero. That is, \(f(x) = 0\). This is such an important topic that an entire chapter of this book is devoted to it (see Chapter ??).
Let us consider the function, \(f(x) = x^{2} - 2x + 3\). To find when the output of this function equals zero, i.e., \(f(x) = 0\), One general, yet misguided, approach might be to plot the function and wherever the function crosses the x-axis is where the function’s output is \(0\). In other words, the x-intercepts. So, let’s visually see what the graph of \(f(x)\) looks like:
From the graph we see that there are no x-intercepts. This makes sense for the function, \(f(x) = x^{2} - 2x + 3\), is a quadratic, it is concave up, and its vertex is \((1,2)\) so this function will never cross the x-axis! Does this mean that there are no solutions to \(f(x) = 0\)? NO it does not.
Now let’s solve \(f(x) = 0\), or \(x^{2} - 2x + 3 = 0\), algebraically using the quadratic formula
\[ \begin{align} x &= \frac{2 \pm \sqrt{4 - 4(1)(3)}}{2(1)} \\ x &= \frac{2 \pm \sqrt{4 - 12}}{2} \\ x &= \frac{2 \pm \sqrt{-8}}{2} \\ x &= \frac{2 \pm 2\sqrt{-2}}{2} \\ x &= 1 \pm \sqrt{-2} \end{align} \]
At this point we have the situation where the solution requires taking the square root of a negative number. We would conclude, therefore, that there is no solution which explains why there are no x-intercepts.
However, we now know better. Using what we learned in this chapter, \(x = 1 \pm \sqrt{-2}\) becomes \(x = 1 \pm \sqrt{2}i\)!
The two roots, or the values of \(x\) where \(f(x) = 0\), are \(x = 1 +\sqrt{2}i\) and \(x = 1 - \sqrt{2}i\). These are complex numbers They exist in the complex plane not in the real plane which explains why there are no x-intercepts. However, they are still solutions to \(f(x) = 0\) and that is what is important to us here. Let’s algebraically verify that \(x = 1 +\sqrt{2}i\) and \(x = 1 - \sqrt{2}i\) are indeed solutions to \(f(x) = 0\). First consider \(x = 1 +\sqrt{2}i\):
\[ \begin{align} f(1 +\sqrt{2}i) &= (1 +\sqrt{2}i)^{2} + 2(1 +\sqrt{2}i) + 3 \\ &= -1 + 2\sqrt{2i} - 2 - 2\sqrt{2}i + 3 \\ &= 0 \end{align} \]
Thus, \(x = 1 +\sqrt{2}i\) is a root of \(f(x)\). Next, let’s verify \(x = 1 -\sqrt{2}i\):
\[ \begin{align} f(1 -\sqrt{2}i) &= (1 -\sqrt{2}i)^{2} + 2(1 - \sqrt{2}i) + 3 \\ &= -1 - 2\sqrt{2i} - 2 + 2\sqrt{2}i + 3 \\ &= 0 \end{align} \]
Thus, \(x = 1 - \sqrt{2}i\) is a root of \(f(x)\). Both are verified; therefore, \(x = 1 + \sqrt{2}i\) and \(x = 1 - \sqrt{2}i\) are, indeed, the roots of \(f(x) = x^{2} - 2x + 3\). They are the values of \(x\) where the output of \(f(x)\) is zero!
As mentioned, these roots, \(x = 1 + \sqrt{2}i\) and \(x = 1 - \sqrt{2}i\), are not real, they are complex. They will not be seen in a plot of the function. However, using what we learned about the complex plane and complex plots, they can be seen in the complex plane as the following complex plot shows:
Without complex numbers, we would have said that given \(f(x) = x^{2} - 2x + 3\), there are no values of \(x\) for which \(f(x) = 0\). In other words, it had no solution. With complex numbers, we found that there were indeed two solutions to \(f(x) = 0\), \(x = 1 + \sqrt{2}i\) and \(x = 1 - \sqrt{2}i\).
This idea of understanding where a function’s output is zero is so important, and is known as root finding. Complex numbers play such an important role in this area. Again, an entire chapter of this book is devoted to root finding in which you will explore these ideas in a lot more detail (see Chapter ??).
Trigonometry
In our discussion of the imaginary number, \(i\), we met Leonhard Euler (1707-1783). He was a Swiss born mathematician among many other disciplines, thus making him a polymath. Euler is one of my all time favourite mathematicians. Among his many amazing discoveries / contributions to mathematics is what is known as Euler’s Formula:
\[ e^{ix} = \cos x + i \sin x \]
where \(e\) is (you guess it) Euler’s Number and is an irrational constant, up there with \(\pi\), and is approximately equal to \(2.71828\) for the decimal places go on forever; \(i\) is, well, \(i\), the imaginary number; and, \(\cos x\) and \(\sin x\) are the two fundamental trigonometric functions. Euler’s Formula links many different branches of mathematics together! Amazing! Very interestingly, however, if we let \(x = \pi\), and evaluate Euler’s Formula recognizing that \(\cos \pi = -1\) and \(\sin \pi = 0\) we get:
\[ \begin{align} e^{i\pi} &= \cos \pi + i \sin \pi \\ e^{i\pi} &= -1 \\ e^{i\pi} + 1 &= 0 \end{align} \]
This equation, \(e^{i\pi} + 1 = 0\), is known as the most beautiful equation in mathematics! It not only relates the two most well known constants in mathematics, \(e\) and \(\pi\), with the imaginary number, \(i\), but forms such a beautifully simple, yet powerful, equation.
As exciting as this is, let’s return to Euler’s Formula, \(e^{ix} = \cos x + i \sin x\). If we evaluate this formula at \(x + y\), we get:
\[ \begin{align} e^{i(x + y)} &= \cos(x + y) + i \sin(x + y) \end{align} \]
Without going into all the mathematical details, it can be shown that from \(e^{i(x + y)} = \cos(x + y) + i \sin(x + y)\) two equations are discovered:
\[ \begin{align} \cos(x + y) &= \cos x \cos y - \sin x \sin y \\ \sin(x + y) &= \sin x \cos y + \sin y \cos x \end{align} \]
These are part of two key trigonometric identities known as the sum / difference identities for the sine and cosine functions! Amazing!
It is understood that some of this may seem overwhelming to you. Don’t fret, for \(e\) and the trigonometric functions will be discussed in depth later in the book. The point here is that having an understanding of \(i\) and complex numbers has real value and are used pervasively in mathematics, with root finding and trigonometry being just two. This is not to mention the plethora of applications, some of which were mentioned at the start of this section.
This is Why You Should Care!
This chapter introduced the imaginary number, \(i\), and a complex number, \(a + bi\). The key word there is introduced. There is so much more that can be said on each, but what was presented is sufficient at this level.
Given that \(i = \pm \sqrt{-1}\) we now have the ability to handle the square root of a negative number. As wonderful as that may be, the value is now being able to solve equations, such as \(f(x) = 0\), which were deemed unsolvable! Though we saw interesting properties of powers of \(i\), it is imperative to recognize that \(i^{2} = -1\).
A complex number is of the form \(a + bi\), where \(a\) is the real part and \(bi\) is the imaginary part. Given that a complex number has an imaginary part, it exists in the complex plane which requires the use of a complex plot for visualization. Like a real number which is identified in two-dimensional space by the ordered pair \((x,y)\), a complex number will have the ordered pair \((a,b)\) in the complex plane. Since \(a\) represents the real part, the x-axis of the complex plot represents the real part of the complex number. The y-axis of the complex plot represents the imaginary part. Thus, the ordered pair \((a,b)\), which represent the complex number \(a + bi\), is plotted \(a\) units along the x-axis and \(b\) units along the y-axis.
Complex numbers can be combined arithmetically:
\[ \begin{align} (a + bi) + (c + di) &= (a + c) + (b + d)i \end{align} \]
\[ \begin{align} (a + bi) - (c + di) &= ((a - c) + (b - d)i \end{align} \]
\[ \begin{align} (a + bi)(c + di) &= (ac - bd) + (ad + bc)i \end{align} \]
\[ \frac{a + bi}{c + di} = \frac{(ac + bd) + (bc - ad)i}{c^{2} + d^{2}} = \frac{ac + bd}{c^{2} + d^{2}} + \frac{bc - ad}{c^{2} + d^{2}}i \]
Root Finding is very important in mathematics and in the real world. The ability to find when the output of a function is zero is critical in applications such as
There are a plethora of others. From a mathematics perspective, optimization is a key component of differential calculus. After finding the derivative of a function, you would set it equal to zero which would identify where the function’s output is either a minimum or maximum. We’ll see later the role root finding plays in understanding where a function exhibits asymptotic behavior. And as we’ll see in this chapter, how root finding allows for the factoring of any degree \(n\) polynomial which has pervasive implications. These are but just some examples.
This is a unique chapter (as well as the associated the appendix). Here we are not demonstrating a particular single concept or idea like composite functions, for example. Rather, root finding is a multifaceted topic that involves a lot of concepts (and theorems), each of which could stand on their own. However, when combined together they answer the all important question: Where is output of a function zero, which means more than just finding where a function crosses the x-axis.
Though not entirely all inclusive of root finding, this is one of the most, if not the most, important chapters in the book!
Before diving into the methods of root finding, it is important that we have an understanding of what is meant by root finding; that is, what we mean by a root finding problem. To help develop this understanding, we need to consider the three use cases of root finding. These are the cases, or scenarios, which lead to a root finding problem.
There are three use cases, or contexts, where root finding plays a vital role. The first is when you have some function, \(f(x)\), and you are interested in understanding when the output of the function is zero; i.e., when \(f(x) = 0\). The second is when you have some function, \(f(x)\), and you are interested in knowing when the output of the function is some specific value; i.e., when \(f(x) = k\), where \(k\) is some value. And, the third is when you have two functions, \(f(x)\) and \(g(x)\), are interested in when the output of \(f(x)\) equals the output of \(g(x)\); i.e., \(f(x) = g(x)\).
Let’s explore each in turn starting with \(f(x) = 0\).
To explore the idea of \(f(x) = 0\), consider \(f(x) = x^{3} + 2x^{2} - x - 2\), find the the value, or values of \(x\) which would cause the output of \(f(x)\) to be zero:
Solution:
This example is of the kind \(f(x) = 0\). To answer this question we will use the graph of \(f(x) = x^{3} + 2x^{2} - x - 2\):
From the graph, it is clear that the output of \(f(x) = x^{3} + 2x^{2} - x - 2\) is zero at the values \(x = -2\), \(x = -1\), and \(x = 1\). To be sure, let’s algebraically verify this. First, let’s verify \(x = -2\):
\[ \begin{align} f(-2) &= (-2)^3 + 2(-2)^{2} - (-2) - 2 \\ &= -8 + 8 + 2 - 2 \\ &= 0 \end{align} \]
Therefore, \(f(-2) = 0\). Next, let’s verify \(x = -1\):
\[ \begin{align} f(-1) &= (-1)^3 + 2(-1)^{2} - (-1) - 2 \\ &= -1 + 2 + 1 - 2 \\ &= 0 \end{align} \]
Therefore, \(f(-1) = 0\). And, finally, let’s verify \(x = 1\):
\[ \begin{align} f(1) &= (1)^3 + 2(1)^{2} - (1) - 2 \\ &= 1 + 2 - 1 - 2 \\ &= 0 \end{align} \]
Therefore, \(f(1) = 0\). Thus the values of \(x\) which causes \(f(x) = x^{3} + 2x^{2} - x - 2\) to produce the output zero are \(x = -2\), \(x = -1\), and \(x = 1\).
The value, or values, of \(x\) which cause the output of some function, \(f(x)\), to be zero are known as the roots of the function. The roots of a function are also sometimes referred to as the zeros. The two terms, roots and zeros, are interchangeable. So, whenever we say root, we could also have said zero, they mean the same thing. In the above example, the roots (or zeros) of \(f(x) = x^{3} + 2x^{2} - x - 2\) are \(x = -2\), \(x = -1\), and \(x = 1\).
CONCEPT: The value, or values, of \(x\) which cause the output of some function, \(f(x)\), to be zero are known as the roots of the function. The roots of a function are also sometimes referred to as the zeros. The two terms, roots and zeros, are interchangeable.
In the above example, the roots of \(f(x)\) coincided with the x-intercepts. This makes sense, for any point on the x-axis has the ordered pair \((x, 0)\), or \((x,f(x))\), so when \(f(x) = 0\), then it would be a point on the x-axis. Is this always the case? Let’s explore this idea in the following example.
Consider \(f(x) = x^{2} - 2x + 3\), find the value, or values, of \(x\) which cause \(f(x)\) to product an output of zero:
Solution:
First, let’s visually see what the graph of \(f(x)\) looks like:
From the graph we see that there are no x-intercepts. This makes sense for the function, \(f(x) = x^{2} - 2x + 3\), is a quadratic, it is concave up, and its vertex is \((1,2)\) so the end behavior of this quadratic is as \(x \to \infty\) and as \(x \to -\infty\), the output goes to infinity, or \(f(x) \to \infty\). Therefore, this function will never cross the x-axis! Does this mean that there are no solutions to \(f(x) = 0\)? NO it does not.
Let’s solve \(f(x) = 0\), or \(x^{2} - 2x + 3 = 0\), using the quadratic formula
\[ \begin{align} x &= \frac{2 \pm \sqrt{4 - 4(1)(3)}}{2(1)} \\ x &= \frac{2 \pm \sqrt{4 - 12}}{2} \\ x &= \frac{2 \pm \sqrt{-8}}{2} \\ x &= \frac{2 \pm 2\sqrt{-2}}{2} \\ &= 1 \pm \sqrt{2}i \end{align} \]
The two roots are \(x = 1 +\sqrt{2}i\) and \(x = 1 - \sqrt{2}i\). These are complex roots. They exist in the complex plane not in the real plane which explains why there are no x-intercepts. However, they are still solutions to \(f(x) = 0\). Let’s algebraically verify this first for \(x = 1 +\sqrt{2}i\):
\[ \begin{align} f(1 +\sqrt{2}i) &= (1 +\sqrt{2}i)^{2} + 2(1 +\sqrt{2}i) + 3 \\ &= -1 + 2\sqrt{2i} - 2 - 2\sqrt{2}i + 3 \\ &= 0 \end{align} \]
Thus, \(x = 1 +\sqrt{2}i\) is a root of \(f(x)\). Next, let’s verify \(x = 1 -\sqrt{2}i\):
\[ \begin{align} f(1 -\sqrt{2}i) &= (1 -\sqrt{2}i)^{2} + 2(1 - \sqrt{2}i) + 3 \\ &= -1 - 2\sqrt{2i} - 2 + 2\sqrt{2}i + 3 \\ &= 0 \end{align} \]
Thus, \(x = 1 - \sqrt{2}i\) is a root of \(f(x)\). Both are verified; therefore, \(x = 1 + \sqrt{2}i\) and \(x = 1 - \sqrt{2}i\) are, indeed, the roots of \(f(x) = x^{2} - 2x + 3\).
From this we saw that \(f(1 +\sqrt{2}i) = 0\) which means that the output of \(f(x)\) is zero when the input is \(x = 1 +\sqrt{2}i\). The same is true for \(x = 1 -\sqrt{2}i\). This meets the definition we stated above for a root: A root is the value of \(x\) which causes the output to be zero. That is what we care about, when the output of the function is zero! It does not matter whether the roots are in the real plane of not. If they are in the complex plane then the output of the function will be zero regardless. We are looking for these values, not the x-intercepts!
Since these roots, \(x = 1 + \sqrt{2}i\) and \(x = 1 - \sqrt{2}i\), are not real, they will not be seen in a plot of the function as was mentioned. However, they can be seen in the complex plane as the following complex plot shows:
CONCEPT: Root finding is the finding of when the output of the function is zero. That is, the value, or values, of \(x\), that produce the mapping \((x,f(x)=0)\). Root finding is not merely the finding of x-intercepts
In essence, this is the major idea behind root finding, the understanding when a function’s output is zero. Certainly this can imply an x-intercept but that is not the major idea of root finding.
Next, let’s consider the use case of \(f(x) = k\) for some constant, \(k\). That is we’re looking for the value, or values, of the input, \(x\), for which the function’s output would be \(k\), or \((x,f(x)=k)\). To address this case, let’s do some simple algebraic manipulation:
\[ \begin{align} f(x) &= k \\ f(x) - k &= 0 \end{align} \]
By bringing \(k\) over to the left side of the equal sign we have \(f(x) - k = 0\). We can, if we choose, call this new function, \(g(x)\). That is \(g(x) = f(x) - k\), which means we’re looking for \(g(x) = 0\). This is a root finding problem!
CONCEPT: The solution to \(f(x) = k\) becomes a root finding problem by subtracting \(k\) from both sides: \(f(x) - k = 0\).
This idea is explored in the following example.
Consider \(f(x) = x^{3} + x\) and the interest is finding where the output of \(f\) is \(2\). That is, \(f(x) = 2\), or \(x^{3} + x = 2\)
Solution:
Let’s take a look at the graph of \(f(x) = x^{3} + x\):
From the graph, it is clear that \(f(x) = 2\) at \(x = 1\), with a mapping of \((1,2)\). Let’s approach this problem by turning it into a root finding problem:
\[ \begin{align} f(x) &= 2 \\ x^{3} + x &= 2 \\ x^{3} + x - 2 &= 0 \\ \end{align} \]
Thus, this becomes a root finding problem. Since we haven’t learned how to find the roots yet, be assured that \(x = 1\) is indeed a root. But we can verify this graphically by plotting this new function, \(g(x) = x^{3} + x - 2\):
From the graph, it is clear that the root of \(g(x) = x^{3} + x - 2\) is at \(x = 1\). Since this function was created by algebraically manipulating \(f(x) = 2\) to produce \(f(x) - 2 = 0\), the conclusion, therefore, is that the output of the function \(f(x)\) is \(2\) when \(x = 1\). This relationship can be seen clearly from the graph of both \(f(x)\) and \(g(x) = x^{3} + x - 2\):
From the graph, it is clear that the root of \(g(x) = x^{3} + x - 2\), \(x = 1\), is the value of \(x\) which produces the output of \(2\) for \(f(x) = x^{3} + x\).
The above example showed that finding the value of \(x\) which causes \(f(x)\) to have the output \(k\), \(f(x) = k\) can be found by solving \(f(x) - k = 0\), which is a root finding problem.
And, lastly, let’s consider the last use case of \(f(x) = g(x)\). That is we’re looking for the value, or values, of the input, \(x\), for which the function, \(f(x)\), has an output equal to the output of \(g(x)\) at the same value of \(x\). To address this case, let’s do some simple algebraic manipulation:
\[ \begin{align} f(x) &= g(x) \\ f(x) - g(x) &= 0 \end{align} \]
By bringing \(g(x)\) over to the left side of the equal sign we have \(f(x) - g(x) = 0\). We can, if we choose, call this new function, \(h(x)\). That is \(h(x) = f(x) - g(x)\), which means we’re looking for \(h(x) = 0\). This is a root finding problem!
CONCEPT: The solution to \(f(x) = g(x)\) becomes a root finding problem by subtracting \(g(x)\) from both sides: \(f(x) - g(x) = 0\). In general, this means the points of intersection of the two functions.
This idea is explored in the following example.
Consider \(f(x) = x^{2} + 3x - 5\) and \(g(x) = x-2\) and the interest is finding where the output of \(f(x)\) equals that of \(g(x)\), or \(x^2 + 3x -5 = x-2\)
Solution:
Let’s begin by looking at the graph of \(f(x) = x^{2} + 3x - 5\) and \(g(x) = x-2\):
From the graph, it is clear that the two functions intersect at two places, \(x = -3\) and \(x = 1\). The output value for \(x = -3\) is \(-5\) and the output value for \(x = 1\) is \(-1\). It is at these intersection points, \((-3,-5)\) and \((1,-1)\) that the output of the two functions are equal. To verify this we could certainly evaluate \(f(x)\) and \(g(x)\) at \(x = -3\) and \(x = 1\), but let’s verify this by using \(f(x) - g(x) = 0\):
\[ \begin{align} f(x) &= g(x) \\ x^{2} + 3x - 5 &= x - 2\\ x^{2} + 2x - 3 &= 0 \end{align} \]
This result, we can call \(h(x)\), so we now have \(h(x) = 0\), which is a root finding problem. Solving \(h(x) = x^{2} + 2x - 3 = 0\) using the quadratic formula:
\[ \begin{align} x &= \frac{-2 \pm \sqrt{4 - 4(1)(-3)}}{2(1)} \\ x &= \frac{-2 \pm \sqrt{4 + 12}}{2} \\ x &= \frac{-2 \pm \sqrt{16}}{2} \\ x &= \frac{-2 \pm 4}{2} \\ &= -1 \pm 2 \end{align} \]
Hence, the two solutions are \(x = -3\) and \(x = 1\). This verifies that the outputs of \(f(x)\) and \(g(x)\) are equal at \(x = -3\) and \(x = 1\).
The above example showed that finding the value, or values, of \(x\) which causes the output of \(f(x)\) to be equal to the output \(g(x)\), \(f(x) = g(x)\) can be found by solving \(f(x) - g(x) = 0\), which is a root finding problem.
In this section, we explored the three possible scenarios where root finding plays a key and very important role. This is a very important idea. To summarize:
CONCEPT: The three possible scenarios where root finding plays a key and very important role:
Now that we have an understanding of a root finding problem, we will now turn our attention to the actual root finding process. That is, we will investigate how to solve \(f(x) = 0\), regardless of how it was formed. We will be making use of several theorems that will guide us on our journey.
Before getting into the specific theorems, it is useful to remind ourselves of what a theorem is and how it can be used. A theorem is, in simple terms, a mathematical statement that has been proven to be true (how the proof was constructed is not relevant to this discussion, but you will encounter proofs many times in your mathematical development). Since it has been proven to be true, you can use and apply the conclusion(s) of the theorem with complete confidence.
A theorem, in general terms, has two parts. The first being the assumptions, or the conditions, that the theorem assumes to be true; the second being the conclusion(s). Note, the conclusion(s) of the theorem can only be applied if the assumptions are met. Said another way, if the assumptions are not met, the conclusion(s) can not be applied. Hence, before you use a theorem, you should always verify that the assumptions upon which it is based are have been met.
Concept: A theorem is a mathematical statement proven to be true. The first part of a theorem gives the assumptions, or conditions, that must be met before applying the conclusion(s) of the theorem. The second part of a theorem is (are) the conclusion(s) that can be applied only when the assumptions, or conditions, are met.
The first theorem that we need in our root finding journey is the Fundamental Theorem of Algebra.
In our study of root finding, we will initially limit our discussion to polynomials. As you recall, a polynomial is \(f(x) = a_{n}x^{n} + a_{n-1}x^{n-1} + a_{n-2}x^{n-2} + \cdots + a_{2}x^{2} + a_{1}x + a_{0}\) where \(n\) is a positive integer exponent. Each polynomial has a degree. Since we are dealing only with univariate polynomials, the degree is simply the highest power of \(x\). For example, \(f(x) = -3x^{5} + 2x^{4} - x^{3} - 6x^{2} + x - 7\) is a degree \(5\) polynomial for \(5\) is the highest power of \(x\), \(x^{5}\).
We now present our first of many theorems which play a role in root finding, the Fundamental Theorem of Algebra. There are a number of ways you will see the Fundamental Theorem of Algebra expressed depending on the level of formality and context. For our purposes here (consistent with where we are at mathematically), the definition of the Fundamental Theorem of Algebra, or FTA, we will be using is as follows:
Fundamental Theorem of Algebra: Given a polynomial, \(f(x)\), with real coefficients and of degree \(n\), then there will always be \(n\) roots. The roots may not all be unique (i.e., repeated roots with some multiplicity) and roots may not be real (i.e. can be complex).
(As a example of the two parts of a theorem discussed above, let’s look closely at this theorem: The assumptions, or the conditions, of this theorem are that the function in question is a degree \(n\) polynomial and the coefficients are real. The conclusion is that there will always be \(n\) roots, some of which may be repeated, some of which may be complex.)
There’s a lot to this theorem. First, it tell us how many roots there will be for a given polynomial of degree \(n\). There will always be n roots, no more, no less. Some of the roots might be repeated, but they each count as an individual root. And, it is not always true that roots will be real, some of the roots may be complex. Let’s look at a simple example.
Given \(f(x) = x^{3} + 2x^{2} - x - 2\), use the FTA to determine how many roots of \(f(x)\) there will be and of what type they are.
Solution:
In order to apply the FTA, we should verify that we can use it. That is, the conclusion of any theorem can only be applied when the conditions, or assumptions, are met. For the FTA, the condition is that the function given is a polynomial. In this example, the given function, \(f(x)\), is the sum of positive integer powers of \(x\), so, yes, it is a polynomial. We can apply the theorem. The degree of \(f(x)\) is \(3\) which, by the FTA, tells us that there will be \(3\) roots.
This function was the function explored previously in Example ??.1 whose graph is:
From the graph we see that there are indeed three roots, \(x = -2\), \(x = -1\), and \(x = 1\), just as was guaranteed by the FTA and they are all real.
Note that the FTA does not tell us anything about what the roots are, nor does it tell us how to find them. It only tells us how many there will be. That said, it does tell us something about the roots. They may or may not be real and/or they may not be unique. The above example verified that there were three roots and that they were real. Let’s look at another simple example.
Consider \(f(x) = x^{3}\), use the FTA to determine how many roots of \(f(x)\) there will be and of what type they are.
Solution:
The given function, \(f(x) = x^{3}\), is a polynomial, so by the FTA, there will be three roots. We know that this is the cubic function whose graph is:
From the graph, it is seen that there is only one root, \(x = 0\). But, the FTA says there should three. What gives? If we look at \(f(x) = 0\):
\[ \begin{align} f(x) &= 0 \\ x^{3} &= 0 \\ (x)(x)(x) &= 0 \end{align} \]
Since we have the product of three things equal to 0, this would imply that \(x = 0\), or \(x = 0\), or \(x = 0\). These are the three roots. It is the same root repeated three times. This is often referred to as a multiplicity. In this case the root has a multiplicity of \(3\).
The above example showed that the FTA guaranteed that there would be three roots for the function, \(f(x) = x^{3}\), which there were. The FTA also said that the roots may not be unique, which in this case they were not. The root \(x = 0\) was repeated three times, or is said that it has a multiplicity of three. Each repeated root counts as a root and must be individually listed.
So far we’ve seen all of the conclusions of the FTA except for the statement that the roots may not all be real. Let’s explore this with yet another simple example.
Consider \(f(x) = x^{2} - 2x + 3\), use the FTA to determine how many roots of \(f(x)\) there will be and of what type they are.
Solution:
The given function, \(f(x) = x^{2} - 2x + 3\), is a polynomial, so by the FTA, there will be two roots.
This function was the function explored previously in Example ??.2 whose graph is:
As the graph indicates, there are no values of \(x\) which cause the output of the function to be zero, at least in the real plane. We saw that the two roots were \(x = 1 +\sqrt{2}i\) and \(x = 1 - \sqrt{2}i\). These are complex roots, thus, obviously not real.
Since these roots, \(x = 1 + \sqrt{2}i\) and \(x = 1 - \sqrt{2}i\), are not real, they will not be seen in a plot of the function. However, they can be seen in the complex plane as the following complex plot shows:
The above example showed that the FTA guaranteed that there would be two roots for the function, \(f(x) = x^{2} - 2x + 3\), which there were. The FTA also said that the roots may not all be real, which in this case they were not. The two roots were complex.
The conclusion of the FTA have been shown to be true. This last example, however, where the roots were complex, leads us to the next theorem, the Complex Conjugate Theorem.
Before discussing the Complex Conjugate Theorem, let’s just take a moment to review what was discussed in Chapter ?? on complex numbers, complex conjugates in particular. Simply put, given a complex number, \(a + bi\), then its complex conjugate is \(a - bi\). The real part remains the same, the imaginary part is the opposite. Let’s look at a complex plot of a complex number and its conjugate:
From the plot we observe that the real part of each is the same distance from the origin, \(a\), along the x-axis which is the real axis. The distance along the y-axis, the imaginary axis, is the same and is the magnitude of the imaginary part, \(b\). The direction along the imaginary axis, however, is the opposite.
What makes complex conjugates interesting is that their product is a real number! For example:
\[ \begin{align} (a + bi)(a - bi) &= a^{2} - abi + abi - b^{2}i^{2} \\ &= a^{2} - b^{2}i^{2} \\ &= a^{2} + b^{2} \end{align} \]
With that review of complex conjugates, recall that the Fundamental Theorem of Algebra guaranteed that for a degree \(n\) polynomial there will always be \(n\) roots. It cautioned, however, that some of the \(n\) roots might not be real, that is, they might be complex. The Complex Conjugate Theorem tells us that if one of the \(n\) roots is complex, that is of the form \(a + bi\), then its complex conjugate, \(a - bi\), will always be another root.
Complex Conjugate Theorem: Given a polynomial, \(f(x)\), with real coefficients, if the complex number \(a + bi\) is a solution to \(f(x) = 0\) (a root), then its conjugate, \(a - bi\) is also a solution (root).
In Example ??.7 we saw that \(x = 1 +\sqrt{2}i\) and \(x = 1 - \sqrt{2}i\) were the roots of \(f(x) = x^{2} - 2x + 3\). The two roots are complex conjugates. The understanding that if a root is complex so, too, will its complex conjugate be a root can be very useful in finding all the roots of a polynomial, \(f(x)\), as the following example illustrates:
It is known that for some polynomial function, \(f(x)\), of degree \(4\), that \(x = -3 - \sqrt{5}i\), \(x = -4\), and \(x = 2\) are roots. Find all the roots of \(f(x)\).
Solution:
Since \(f(x)\) is a degree \(4\) polynomial, we know by the Fundamental Theorem of Algebra that there will be \(4\) roots. Three roots were given, \(x = -3 - \sqrt{5}i\), \(x = -4\), and \(x = 2\), so there is one more to find. Since the one root, \(-3 - \sqrt{5}i\), is a complex root, and \(f(x)\) is a polynomial, we can apply the Complex Conjugate Theorem which says that if \(a + bi\) is a root, so also is its complex conjugate, \(a - bi\). The complex conjugate of \(-3 - \sqrt{5}i\) is \(-3 + \sqrt{5}i\), hence \(x = -3 + \sqrt{5}i\) is another root of \(f(x)\).
The four roots of \(f(x)\), therefore, are: \(x = -4\), \(x = 2\), \(x = -3 - \sqrt{5}i\), and \(x = -3 + \sqrt{5}i\).
There are two implications of the Complex Conjugate Theorem , the first, as we just saw, is that if you know a root to be complex, you immediately know another root, its conjugate. The second implication is that complex roots always go in pairs. If any of the roots guaranteed by the FTA, is complex there will always be another complex root. Thus, if there exists any complex roots there will always be an even number of them.
Concept: If the polynomial function, \(f(x)\), has any complex roots, there will always be an even number of complex roots, with each complex root, \(a + bi\), being paired with its complex conjugate, \(a - bi\).
This concept will be very useful to us as we attempt to find all the roots of a degree \(n\) polynomial in that we can get insight into the types of roots that might exist. The following example illustrates this idea.
Given a degree \(5\) polynomial, \(f(x)\), is it guaranteed that at least one root will be real?
Solution:
From the Fundamental Theorem of Algebra we know that the degree \(5\) polynomial, \(f(x)\), will have \(5\) roots. The Complex Conjugate Theorem tells us that if any of the roots are complex there must be an even number of them. This means that out of the \(5\) possible roots, at most there could be four complex roots, two pairs of complex conjugates. Therefore, the fifth root must be real for if was not, there would be a sixth root which would violate the Fundamental Theorem of Algebra.
So, yes, it is guaranteed that given a degree \(5\) polynomial, \(f(x)\), there must be at least one real root.
Actually, the logic of the above example can be abstracted to the general case that any odd degree polynomial must have at least one real root.
Concept: An odd degree polynomial function, \(f(x)\), is guaranteed to have at least one real root.
In our root finding journey thus far, we’ve discovered that for a polynomial, \(f(x)\), of degree \(n\), there will always be \(n\) roots some of which may be repeated or complex. If a complex root exists, its complex conjugate is also a root. There is one more theorem that we need before we can begin to actually find what these roots may be, the Remainder Theorem.
The Remainder Theorem is generally unknown, overlooked, or under appreciated. At least that’s what it seems to me.
Let’s say that you have the function \(f(x) = -3x^{5} -2x^{4} + 5x^{3} - 6x^{2} + x - 7\) and you were interested in knowing what this function’s output would be at \(x = -2\). That is, what is \(f(-2)\)? Your first inclination would be just evaluate the function at \(x = -2\):
\[ \begin{align} f(-2) &= -3(-2)^{5} - 2(-2)^{4} + 5(-2)^{3} -6(-2)^{2} + (-2) - 7 \\ &= -3(-32) - 2(16) + 5(-8) -6(4) - 2 - 7 \\ &= 96 - 32 - 40 - 24 -9 \\ &= -9 \end{align} \]
Thus, \(f(-2) = -9\). No big deal, right? However, suppose you wanted to evaluate the same function at \(x = 13\), or whatever number you’d like. The evaluation of the function due to its high degree can become difficult to do either by hand or mentally. That’s where the Remainder Theorem comes in.
Remainder Theorem: Given a polynomial, \(f(x)\), with real coefficients, when it is divided by \(x - c\), for some \(c \in \mathbb{C}\), then the remainder, \(r\), is the function evaluated at \(c\). That is, \(f(c) = r\).
In essence the theorem says that if you were to divide a polynomial by \(x - c\), where \(c\) is some number, i.e., \(\frac{f(x)}{x - c}\), then the remainder of the division, let’s call it \(r\), is the function evaluated at \(c\). That is, \(f(c) = r\). I know what you’re thinking, how is this any better than just doing the function evaluation given that you have to do the polynomial division? Well, take a closer look.
To use the Remainder Theorem, we need to find
\[ \frac{f(x)}{x - c} \]
which as we have already seen in Chapter ??, this polynomial division can be done by synthetic division, which is quite simple. Returning to our function, we would need to find \(\frac{-3x^{5} -2x^{4} + 5x^{3} - 6x^{2} + x - 7}{x + 2}\) for here \(c = -2\). Doing this by synthetic division:
\[ \begin{array}{r|rrrrrr} -2 & -3 & -2 & 5 & -6 & 1 & -7 \\ & & 6 & -8 & 6 & 0 & -2 \\ \hline & -3 & 4 & -3 & 0 & 1 & -9 \end{array} \]
The division was done very quickly and easily. The result of the synthetic division tells us that the last number of the division is the remainder. Applying the Remainder Theorem, this remainder, \(r = -9\), should be the function evaluated at \(x = -2\). Or, \(f(-2) = -9\). This the same result we found when we performed the function evaluation directly as seen above.
The Remainder Theorem is an easy way to evaluate a polynomial at any given input \(x = c\), without having to actually evaluate the function directly. Just divide the function by \(x - c\)! And since the division is of the form \(\frac{f(x)}{x - c}\), the division can be easily done using synthetic division. To be honest, I have invoked this theorem many times to do back of the envelop function evaluations. Pretty cool!
The question becomes, however, what has this to do with root finding? Well, remember that when something divides evenly into something else, the remainder is zero. Divide 8 by 4, for example, and you will get a quotient of 2 and a remainder of zero. 4 divides evenly into 8. If you were to divide a polynomial, \(f(x)\), by \(x - c\) and the remainder is zero, that is, \(r = 0\), then the Remainder Theorem tells us that this remainder is the function evaluated at \(c\), which if \(r = 0\) means \(f(c) = 0\). In other words, \(c\) is a root of \(f(x)\)!
The implication of this is profound. To see if any number, \(c\), is a root of \(f(x)\), all we have to do is perform the division, \(\frac{f(x)}{x-c}\) using synthetic division, and if the remainder is zero, it is a root!
Concept: To see if any number, \(c\), is a root of a polynomial \(f(x)\), perform the division, \(\frac{f(x)}{x-c}\) using synthetic division, and if the remainder, \(r\), is zero, it is a root, for by the Remainder Theorem, \(f(c) = r\), or in this case, \(f(c) = 0\).
The following example illustrates this idea.
Given \(f(x) = x^{3} + 2x^{2} - x - 2\) are \(x = -2\) and \(x = 3\) roots?
Solution:
Using the Remainder Theorem, to verify that a suspected root, \(c\), is indeed a root, perform the division, \(\frac{f(x)}{x-c}\), and if the remainder, \(r\), is zero, it is a root. We will use synthetic division to perform the division.
So, for the suspected root, \(x = -2\), perform the division, \(\frac{f(x)}{x+2}\):
\[ \begin{array}{r|rrrr} -2 & 1 & 2 & -1 & -2 \\ & & -2 & 0 & 2 \\ \hline & 1 & 0 & -1 & 0 \end{array} \]
The remainder is \(0\), thus by the Remainder Theorem, \(f(-2) = 0\), meaning that \(x = -2\) is a root. Now, let’s check whether \(3\) is a root by doing the division, \(\frac{f(x)}{x-3}\):
\[ \begin{array}{r|rrrr} 3 & 1 & 2 & -1 & -2 \\ & & 3 & 15 & 42 \\ \hline & 1 & 5 & 14 & 40 \end{array} \]
The remainder is \(40\), thus by the Remainder Theorem, \(f(3) = 40\), which is not zero, meaning that \(x = 3\) is not a root.
As mentioned above, actually doing the division \(\frac{f(x)}{x - c}\), preferably using synthetic division, can often be simpler than doing the function evaluation directly. That said, if you wanted to actually do the function evaluation, to see if \(f(c) = 0\), go ahead. It is not recommended, but it’s your choice.
If you looked closely at the Remainder Theorem you saw the statement: some \(c \in \mathbb{C}\). The \(\mathbb{C}\) here represents the complex numbers, which really implies all numbers, real or complex. This means, that this theorem holds even if a root is complex. Let’s revisit Example ??.7 to verify this.
Given \(f(x) = x^{2} - 2x + 3\) are \(x = -2\) use the Remainder Theorem to verify that \(x = 1 + \sqrt{2}i\) is a root.
Solution:
Using the Remainder Theorem, to verify that a suspected root, \(c\), is indeed a root, perform the division, \(\frac{f(x)}{x-c}\), and if the remainder, \(r\), is zero, it is a root. We will use synthetic division to perform the division.
So, for the suspected root,\(x = 1 + \sqrt{2}i\), perform the division, \(\frac{f(x)}{x - (1 + \sqrt{2}i)}\):
\[ \begin{array}{r|rrr} 1 + \sqrt{2}i & 1 & -2 & 3 \\ & & 1 + \sqrt{2}i & -3 \\ \hline & 1 & -1 + \sqrt{2}i & 0 \end{array} \]
The remainder is \(0\), thus by the Remainder Theorem, \(f(1 + \sqrt{2}i) = 0\), meaning that \(x = 1 + \sqrt{2}i\) is a root.
As this example showed, the Remainder Theorem can be used to determine if any value, \(c\), whether real or complex, is a root. Amazing.
The Remainder Theorem has broad applicability in terms of function evaluation, as we have seen, but we will take most advantage of it within the context of root finding. In particular, we will be using the Remainder Theorem to verify that a suspected root, \(c\), is indeed a root by perform the division, \(\frac{f(x)}{x-c}\), and if the remainder, \(r\), is zero, it is a root.
The challenge, of course, is how do we find the \(c\)’s in the first place! This leads us to the next theorem, the Rational Root Theorem.
To help in our quest to solve a root finding problem, that is, \(f(x) = 0\), we covered several theorems that will assist us (remember, we do not want to lose focus on our goal to understand when the output of a function is zero). A brief summary of those theorems are:
These theorems give us insight into the number of roots there will be for a given polynomial, their potential type, and how to identify if a value of \(x\) is a root. What they did not tell us is how to find (potential) roots. This next theorem, the Rational Root Theorem, will do just that; it will give us insight into what the roots of \(f(x) = 0\) might be.
The Rational Root Theorem will provide a list of potential rational roots of a polynomial with integer coefficients. It will not give the roots specifically, nor will it guarantee that any of these potential roots are indeed roots. The theorem just provides a way to identify the roots that are rational, if there are any.
Rational Root Theorem: Given a polynomial, \(f(x)\), with integer coefficients, then if a rational root exists, it will be in \(p/q\), where \(p\) are the plus/minus factors of the constant coefficient and \(q\) are the plus/minus coefficients of the leading coefficient.
To use this theorem, recall once again the definition of a polynomial: \(f(x) = a_{n}x^{n} + a_{n-1}x^{n-1} + a_{n-2}x^{n-2} + \cdots + a_{2}x^{2} + a_{1}x + a_{0}\). The constant coefficient referred to in the theorem is \(a_{0}\), the leading coefficient is the coefficient in front of the highest power of \(x\), \(a_{n}\). To use this theorem you first find all the factors of \(a_{0}\), including the plus or minus cases, calling these the \(p\)’s. Then you find all the factors of \(a_{n}\), including the plus or minus cases, calling these the \(q\)’s. Once you have done this, then the potential rational roots of \(f(x)\), if any, will be in the ratio of the \(p\)’s and \(q\)’s. This simple example demonstrates this idea.
Given \(f(x) = 8x^{2} + 2x - 3\), use the Rational Root Theorem to identify all the potential rational roots of \(f(x)\).
Solution:
The constant coefficient of this polynomial, \(f(x) = 8x^{2} + 2x - 3\), is \(-3\). The plus or minus factors of \(-3\) are: \(\pm 3, \pm 1\). These are the \(p\)’s. (It is always nice when either the constant of leading coefficient is a prime number, it limits the number of factors!) The leading coefficient is \(8\). The plus or minus factors of \(8\) are: \(\pm 8, \pm 1, \pm 4, \pm 2\). These are the \(q\)’s. So, by the Rational Root Theorem, if a rational root exists, it will be in:
\[ \frac{p}{q} = \frac{\pm 3, \pm 1}{\pm 8, \pm 1, \pm 4, \pm 2} \]
Again, it must be emphasized that the Rational Root Theorem does not guarantee that a rational root exists! All it guarantees is that if a rational root exists it will be within the possibilities identified by \(p/q\). This idea is very important to remember.
Concept: It must be emphasized that the Rational Root Theorem does not guarantee that a rational root exists! All it guarantees is that if a rational root exists it will be within the possibilities identified by \(p/q\).
Once the potential rational roots have been identified, you must check each one. To do this, you would pick a value of \(c\) from the list of potential rational roots and perform the division, \(\frac{f(x)}{x - c}\), most likely using synthetic division. If the remainder is zero, then this value of \(c\) is a root for, remember, by the Remainder Theorem this means \(f(c) = 0\).
Let’s explore this idea in the following example.
Given \(f(x) = 8x^{2} + 2x - 3\), determine which of these possible values of \(x\), if any, \(1\), \(\frac{1}{2}\), and \(-\frac{3}{4}\) are roots of \(f(x)\).
Solution:
In Example ??.12, it was seen that for the polynomial, \(f(x) = 8x^{2} + 2x - 3\), the list of potential rational roots was found to be:
\[ \frac{p}{q} = \frac{\pm 3, \pm 1}{\pm 8, \pm 1, \pm 4, \pm 2} \]
The possible values of the roots given are contained within the list of possibilities. Let’s see which, if any, is a root.
First, consider letting \(c = 1\). Perform \(\frac{f(x)}{x - 1}\):
\[ \begin{array}{r|rrr} 1 & 8 & 2 & -3 \\ & & 8 & 16 \\ \hline & 8 & 16 & 13 \end{array} \]
Since the remainder is \(13\), which is not zero, \(c = 1\) is not a root. Let’s try \(c = \frac{1}{2}\):
\[ \begin{array}{r|rrr} \frac{1}{2} & 8 & 2 & -3 \\ & & 4 & 3 \\ \hline & 8 & 6 & 0 \end{array} \]
Since the remainder is \(0\), \(c = \frac{1}{2}\) is a root. Let’s try \(c = -\frac{3}{4}\):
\[ \begin{array}{r|rrr} -\frac{3}{4} & 8 & 2 & -3 \\ & & -6 & 3 \\ \hline & 8 &-4 & 0 \end{array} \]
Since the remainder is \(0\), \(c = -\frac{3}{4}\) is a root.
The following example will highlight three key ideas to keep in mind when searching for the possible rational roots.
It is known that \(f(x) = x^{4} + 2x^{3} - 3x^{2} - 4x + 4\), has four rational roots. What are these rational roots?
Solution:
The polynomial function is of degree \(4\), therefore, by the FTA it will indeed have \(4\) roots. Should any rational roots exist, they will be in the ratio of the factors of the constant coefficient and the factors of the leading coefficient. The constant coefficient is \(4\) so its plus or minus factors are: \(\pm 4, \pm 1, \pm 2\). These are the \(p\)’s. The leading coefficient is \(1\), so its plus or minus factors is \(\pm 1\). These are the \(1\)’s. *(It is really nice when a coefficient, leading or constant, is not only a prime number but the number \(1\). So, the list of possible rational roots are:
\[ \frac{p}{q} = \frac{\pm 4, \pm 1, \pm 2}{\pm 1} \]
Let’s try the number \(1\):
\[ \begin{array}{r|rrrrr} 1 & 1 & 2 & -3 & -4 & 4\\ & & 1 & 3 & 0 & -4\\ \hline & 1 & 3 & 0 & -4 & 0 \end{array} \]
Since the remainder is \(0\), a rational root is \(1\). Going sequentially through the list from lowest to highest, we would try \(-1\) and \(2\). Doing so would show them not to be roots (you should verify this). Let’s try \(-2\):
\[ \begin{array}{r|rrrrr} -2 & 1 & 2 & -3 & -4 & 4\\ & & -2 & 0 & 6 & -4\\ \hline & 1 & 0 & -3 & 2 & 0 \end{array} \]
Since the remainder is \(0\), a rational root is \(-2\). From the given information in the problem, two out of the four rational roots have found, \(1\) and \(-2\). Thus, there are two more to find. There are only two more to try, \(\pm 4\). Trying these would show them not to be roots (you should verify this). How could this be given that there are no other potential rational roots to try?
Before answering that question, let’s pause this example and review the three ideas that this example was meant to bring out
The first idea that the above example presented is an approach to going through the list of possible rational roots. Actually, it is really more of a suggestion. When you have the list of possible rational roots (the \(\frac{p}{q}\)’s) always start with the smallest integer (which will be \(1\)) and work your way up from there. You could always try and make an educated guess based on the signs of the coefficients of the powers of \(x\) as to whether a root will be positive or negative and get an idea of its magnitude. I do offer a tip or two in Section ??.13, but is up to you as to how you go about this. I usually start with \(1\) and go from there. Just a suggestion.
The second idea that the above example presented is whenever you find a root, immediately try it again to see if it is a repeated root or not. We did not do that in the above example, therefore the entire list was exhausted without finding the necessary four roots. But, this raises another question: How to go about doing this. If we were to try a root again, wouldn’t we get stuck in an infinite loop. It is a root, so wouldn’t trying it again always produce a zero when doing the division? Yes, it would! And that leads us to the third idea.
The third idea is based on understanding what we are doing. For any potential root, \(c\), we are dividing the given polynomial by \(x - c\). This division will produce a quotient and a remainder. If the remainder is zero, \(c\) is a root. But, what is the quotient? If we start with a degree \(n\) polynomial (i.e., \(f(x)\) is of degree \(n\)) and divide it by \(x - c\), which is a degree \(1\) polynomial, then in effect what are doing is dividing a degree \(n\) polynomial by a degree \(1\) polynomial which can be represented as:
\[ \frac{x^{n}}{x} = x^{n-1} \]
Hence, the quotient will always be a degree \(n - 1\) polynomial. When we use synthetic division, the last number represents the remainder, the numbers before it represent the coefficients of this degree \(n - 1\) polynomial. It is to this new polynomial that we perform the synthetic polynomial division on in search of rational roots! The understanding that every time we do synthetic division the quotient is a polynomial of a degree one less than the one we performed the division on is extremely important as we’ll see in the next section.
Concept: When dividing a polynomial, \(f(x)\), by \(x - c\), the quotient will be a polynomial of degree one less than \(f(x)\). If \(f(x)\) is of degree \(n\), the quotient will always be of degree \(n - 1\). If using synthetic division and the remainder is zero (meaning \(c\) is a root), the numbers to the left of the remainder are the coefficients of this degree \(n - 1\) polynomial. When searching for rational roots, every attempt to find an additional root should be make on the polynomial which remained after finding the previous root.
With these understandings, we can resume our work in Example ??.14.
It is known that \(f(x) = x^{4} + 2x^{3} - 3x^{2} - 4x + 4\), has four rational roots. What are these rational roots?
Solution:
To recap, in Part 1, we found two of the four roots, \(1\) and \(-2\). We exhausted the list of potential rational roots thus leaving unable to find the remaining two roots the problem guaranteed that there were. We were lost as to what to do next.
The first root tried was \(1\) and the synthetic division was:
\[ \begin{array}{r|rrrrr} 1 & 1 & 2 & -3 & -4 & 4\\ & & 1 & 3 & 0 & -4\\ \hline & 1 & 3 & 0 & -4 & 0 \end{array} \]
Since \(f(x)\) is of degree \(4\), the quotient is the degree three polynomial \(x^{3} + 3x^{2} - 4\) (for remember, the numbers to the left of the remainder are the coefficients of the degree \(n -1\) polynomial). It is on this polynomial that a subsequent attempt to find a rational root should be made. And, whenever a rational root is found, it is always a good idea to try is this root again to see if it is a repeated root. So, let’s do that for the root just found, \(1\)
\[ \begin{array}{r|rrrr} 1 & 1 & 3 & 0 & -4 \\ & & 1 & 4 & 4 \\ \hline & 1 & 4 & 4 & 0 \end{array} \]
The remainder is \(0\)! This means that \(1\) is another root; i.e., it is a repeated root. The numbers to the left of the remainder, \(0\), are the coefficients of the degree \(n - 1\) polynomial remaining. Since the polynomial upon which we were doing the division in this case was \(x^{3} + 3x^{2} - 4\), which is a degree 3 polynomial, we now have the degree \(2\) polynomial, \(x^{2} + 4x + 4\). We should try \(1\) against this polynomial to see if it is yet another repeated root:
\[ \begin{array}{r|rrr} 1 & 1 & 4 & 4 \\ & & 1 & 5 \\ \hline & 1 & 5 & 9 \end{array} \]
The remainder, \(9\), is not zero, therefore, \(1\) is not another root. So, now we have found three rational roots, \(x = 1\), \(x = 1\), and \(x = -2\). One more to go. Let’s revisit our first discovery that \(-2\) was a root:
\[ \begin{array}{r|rrrrr} -2 & 1 & 2 & -3 & -4 & 4\\ & & -2 & 0 & 6 & -4\\ \hline & 1 & 0 & -3 & 2 & 0 \end{array} \]
As mentioned, we should always try this root against the degree \(n - 1\) polynomial that resulted from the division which, in this case is \(x^{3} - 3x + 2\):
\[ \begin{array}{r|rrrr} -2 & 1 & 0 & -3 & 2\\ & & -2 & 4 & -2\\ \hline & 1 & -2 & 1 & 0 \end{array} \]
The remainder is \(0\), thus \(-2\) is a root which means that it is a repeated root. We should try this root again against the polynomial \(x^{2} - 2x + 1\):
\[ \begin{array}{r|rrr} -2 & 1 & -2 & 1\\ & & -2 & 8\\ \hline & 1 & -4 & 9 \end{array} \]
The remainder, \(9\), is not zero, therefore, \(-2\) is not another (repeated) root.
So, now we have found the four rational roots we were told that the original polynomial, \(f(x) = x^{4} + 2x^{3} - 3x^{2} - 4x + 4\), had: \(x = 1\), \(x = 1\), \(x = -2\), and \(x = -2\).
This section showed how the Rational Root Theorem is a valuable tool for finding potential rational roots of a polynomial, \(f(x)\), with integer coefficients. Combined with the other three theorems, the Fundamental Theorem of Algebra, the Complex Conjugate Theorem, and the Remainder Theorem, we are now able to define an initial process for root finding. I say initial for there is still more to consider, but it is beneficial to pause here and show the results of what we have learned so far.
When presented with a polynomial, \(f(x)\), and asked to find when \(f(x) = 0\) (remember that this is the goal, to find the value, or values, of the input, \(x\), which causes the function’s output to be zero!), the following process is a place to start. We will use \(f(x) = x^{4} - 5x^{2} + 10x - 6\) as the example function in the development of this process.
Identify The Number Of Roots
The first step in the process, though seemingly trivial, is important. You must have a crisp understanding of how many roots there must be and what the possibilities are for those roots. The function, \(f(x) = x^{4} - 5x^{2} + 10x - 6\), is a degree \(4\) polynomial, therefore by the Fundamental Theorem of Algebra there will be \(4\) roots. These roots, however, may not all be unique (some may be repeated) and they need not be real. Since this a degree \(4\) polynomial we cannot say anything definitive about whether there will be at least one real root.
Identify The Possible Rational Roots
Next, we need to (at least) attempt to identify any rational roots. For this, use the Rational Root Theorem. For this example function, \(f(x) = x^{4} - 5x^{2} + 10x - 6\), the constant coefficient is \(6\), the sign doesn’t matter, which has the plus or minus factors: \(\pm 6, \pm 1, \pm 3, \pm 2\), the \(p\)’s. The leading coefficient is \(1\), always a nice number, which has the plus or minus factors: \(\pm 1\). the \(q\)’s. There, by the Rational Root Theorem, if a rational root exists it will be in:
\[ \frac{p}{q} = \frac{\pm 6, \pm 1, \pm 3, \pm 2}{\pm 1} \]
Find The Rational Roots
Once, the list of possible rational roots has been identified, begin the search to find them. A suggestion is to start simple then work your way up, unless you have a reason to begin elsewhere. So, let’s start with \(c = 1\) and use synthetic division to find \(\frac{f(x)}{x - c}\):
\[ \begin{array}{r|rrrrr} 1 & 1 & 0 & -5 & 10 & -6\\ & & 1 & 1 & -4 & 6\\ \hline & 1 & 1 & -4 & 6 & 0 \end{array} \]
The remainder is \(0\), thus \(x = 1\) is a root. The degree \(3\) polynomial that resulted from the division is \(x^{3} + x^{2} - 4x + 6\). It is on this polynomial that we will attempt to find another rational root. It is always recommended that you try the root just found, \(1\) in this case, again to see if it is a repeated root. Trying \(c = 1\) on \(x^{3} + x^{2} - 4x + 6\) yields:
\[ \begin{array}{r|rrrr} 1 & 1 & 1 & -4 & 6\\ & & 1 & 2 & -2\\ \hline & 1 & 2 & -2 & 4 \end{array} \]
The remainder is \(4\) which is not zero, therefore the root \(x = 1\) is not a repeated root. Therefore, \(1\) can no longer be considered a possible root, it has already been identified as a root with a multiplicity of one. Continue traversing the remain list of possible rational roots using whatever system you may have, I would go to the next simplest, \(-1\), and work my way up. Following this approach we would eventually get to try \(c = -3\). Though you can try this against the original function, you should always use the degree \(n - 1\) polynomial that resulted from the last root found. You will see why this makes sense shortly but let’s try \(c = -3\) against \(x^{3} + x^{2} - 4x + 6\) yields:
\[ \begin{array}{r|rrrr} -3 & 1 & 1 & -4 & 6\\ & & -3 & 6 & -6\\ \hline & 1 & -2 & 2 & 0 \end{array} \]
The remainder is \(0\), so \(x = -3\) is another root. Seeing if it is a repeated root we would try it against \(x^{2} - 2x + 2\):
\[ \begin{array}{r|rrr} -3 & 1 & -2 & 2\\ & & -3 & 15 \\ \hline & 1 & -5 & 17 \end{array} \]
The remainder is \(17\), which is not zero, therefore, \(x = -3\) is not a repeated root. So far two (rational) roots have been found, \(x = 1\) and \(x = -3\). Only two more to go!
Now, here is where you have a choice. One choice is that you can continue to search through the remaining possible rational roots for any other possible rational roots. This is NOT recommended! If you realize that at this point after finding the first two roots, the degree of the remaining polynomial is down to degree \(2\). That is a quadratic. We already know how to solve \(f(x) = 0\) when \(f(x)\) is a quadratic. Just use the quadratic formula! So, let’s do this:
\[ \begin{align} x^{2} - 2x + 2 &= 0 x &= \frac{2 \pm \sqrt{4 - 4(1)(2)}}{2(1)} \\ &= \frac{2 \pm \sqrt{4 - 8}}{2} \\ &= \frac{2 \pm \sqrt{-4}}{2} \\ &= \frac{2 \pm 2i}{2} \\ &= 1 \pm i \end{align} \]
Therefore, the two remaining roots are \(x = 1 + i\) and \(x = 1 - i\). First note that these roots are complex and they are complex conjugates, thus satisfying the Complex Conjugate Theorem. But more important is that since these last two roots are complex, they would not have been found by continuing through the remaining potential rational roots! This is a very important idea in the root finding process as we’re defining it: Continue to find potential rational roots until you end up with a degree \(2\) polynomial (a quadratic) and at this point, just use the quadratic formula to find the remaining roots!
Quadratic Formula
The goal is to identify as many roots as possible either by using the Rational Root Theorem, or using other information as we will see, to obtain a remaining degree two polynomial, a quadratic. We know how to solve a quadratic, just use the quadratic formula!
Concept: Given a degree \(n\) polynomial, continue to find rational roots until you get down to a remaining degree two polynomial, meaning \(n - 2\) roots have been found and only two remaining. Cease the search and just use the quadratic formula on the remaining degree two polynomial, a quadratic, to find the remaining roots.
There are several benefits to doing this. First, the need to try and find rational roots from the list of possible rational roots is over. Quite helpful if there still remains a long list of possibilities! Second, and most important, by having a degree two remaining polynomial you can use the quadratic formula which is guaranteed to find all roots of a quadratic, including complex roots, or roots that are not rational, which would not have been found otherwise.
Now that the root finding process has been defined, at least up to this point, we will be expanding on it later, let’s look at an example.
Find \(f(x) = 0\) given \(f(x) = x^{5} - 8x^{4} + 18x^{3} - 2x^{2} - 23x + 6\)
Solution:
The solving of \(f(x) = 0\) is a root finding problem, thus we need to find the values of \(x\) which will cause the output of \(f(x)\) to be \(0\). In other words, we need to find the roots. To do so, the first thing we should do is use determine how many roots there will be and glean any relevant information about what type the roots might be.
The polynomial \(f(x) = x^{5} - 8x^{4} + 18x^{3} - 2x^{2} - 23x + 6\) is degree \(5\). Via the Fundamental Theorem of Calculus we know that there will be five roots, which may or may not be real or unique. Since it is an odd degree, it is via the Complex Conjugate Theorem that we known that at least one of the roots will be real, thus implying that there could be, at a maximum, four complex roots.
The next thing will be to identify the possible rational roots as specified by the Rational Root Theorem. The constant coefficient is \(6\), which has the plus or minus factors: \(\pm 6, \pm 1, \pm 3, \pm 2\), the \(p\)’s. The leading coefficient is \(1\), which has the plus or minus factors: \(\pm 1\). the \(q\)’s. There, by the Rational Root Theorem, if a rational root exists it will be in:
\[ \frac{p}{q} = \frac{\pm 6, \pm 1, \pm 3, \pm 2}{\pm 1} \]
Now that we have the list of possible roots, we can begin the search. It is a good idea to perhaps start with \(c = 1\) and \(c = -1\), and if you did, you would find that these are not roots. So, let’s try \(c = 2\):
\[ \begin{array}{r|rrrrrr} 2 & 1 & -8 & 18 & -2 & -23 & 6\\ & & 2 & -12 & 12 & 20 & -6\\ \hline & 1 & -6 & 6 & 10 & -3 & 0 \end{array} \]
Since the remainder is zero, \(c = 2\) is a root. The degree \(4\) polynomial that remains is \(x^{4} -6x^{3} + 6x^{2} + 10x - 3\). It makes sense to see if this is a repeated root.
\[ \begin{array}{r|rrrrr} 2 & 1 & -6 & 6 & 10 & -3 \\ & & 2 & -8 & -4 & 12 & \\ \hline & 1 & -4 & -2 & 6 & -9 \end{array} \]
The remainder is not zero, therefore, this \(2\) is not a repeated root. Thus, the search continues, but now we will apply any new potential root to the polynomial \(x^{4} -6x^{3} + 6x^{2} + 10x - 3\). If the next potential rational root you try is \(3\), you’ll find that is is a root. The remaining degree \(3\) polynomial would then be \(x^{3} - 3x^{2} - 3x + 1\). After this, should you get to trying \(-1\), you’ll find that to be a root, with a remaining degree \(2\) polynomial of \(x^{2} - 4x + 1\).
Thus far, three rational roots were found, \(x = 2\), \(x = 3\), and \(x = -1\) (they were all checked for being a repeated root, they are not). Only two more roots to find. Since we the remaining polynomial is \(x^{2} - 4x + 1\), which is a degree \(2\) polynomial we can just use the quadratic formula and stop searching for more rational roots from the remaining list of possible rational roots, especially since there is no guarantee that these two roots will even be rational. We can just use the quadratic formula. Doing so, yields:
\[ \begin{align} x &= \frac{4 \pm \sqrt{16 - 4(1)(1)}}{2(1)} \\ &= \frac{4 \pm \sqrt{12}}{2} \\ &= 2 \pm \sqrt{3} \end{align} \]
The last two roots have been found. Thus, the five roots of \(f(x) = x^{5} - 8x^{4} + 18x^{3} - 2x^{2} - 23x + 6\) are \(x = 2\), \(x = 3\), \(x = -1\), \(x = 2 - \sqrt{3}\), and \(2 + \sqrt{3}\). These are the values of \(x\) which will cause the output of \(f(x)\) to be \(0\).
The following graph shows \(f(x) = x^{5} - 8x^{4} + 18x^{3} - 2x^{2} - 23x + 6\) and these five roots.
To see this root finding process applied to the use case of \(f(x) = g(x)\), consider the following simple example.
Find when the outputs of the two functions, \(f(x)\) and \(g(x)\) are equal given \(f(x) = x^{4}\) and \(g(x) = 5x^{2} - 4\).
Solution:
Recall that we can turn the finding of when \(f(x) = g(x)\) into a root finding problem via algebraic manipulation:
\[ \begin{align} f(x) &= g(x) \\ f(x) - g(x) &= 0 \end{align} \]
which for these two functions would be:
\[ \begin{align} x^{4} &= 5x^{2} - 4 \\ x^{4} - 5x^{2} + 4 &= 0 \end{align} \]
Thus we need to find the roots of \(x^{4} - 5x^{2} - 4\). Going through the root finding process, first we observe that the degree is \(4\), therefore, there will be \(4\) roots which may or may not be real or unique. Since this is an even degree polynomial, these four roots can be all real, all complex, or two real and two complex.
The next thing will be to identify the possible rational roots as specified by the Rational Root Theorem. The constant coefficient is \(4\), which has the plus or minus factors: \(\pm 4, \pm 1, \pm 2\), the \(p\)’s. The leading coefficient is \(1\), which has the plus or minus factors: \(\pm 1\). the \(q\)’s. There, by the Rational Root Theorem, if a rational root exists it will be in:
\[ \frac{p}{q} = \frac{\pm 4, \pm 1, \pm 2}{\pm 1} \]
Now that we have the list of possible roots, we can begin the search. It is a good idea to perhaps start with \(c = 1\) and \(c = -1\), and if you did, you would find that these are roots. The remaining degree \(2\) polynomial after these two divisions is \(x^{2} - 4\). Now that we have a degree \(2\) polynomial we can cease doing the search and solve this quadratic using the quadratic formula. However, in this case we can just solve directly:
\[ \begin{align} x^{2} - 4 &= 0 \\ x^{2} &= 4 x &= \pm 2 \end{align} \]
Thus, the remaining two roots are \(x = -2\) and \(x = 2\), which means the four roots are \(x = -1\), \(x = 1\), \(x = -2\), and \(x = 2\).
The following graph does indeed show these to be the roots of \(x^{4} - 5x^{2} + 4\).
But what do these roots represent? They are definitely the roots of \(x^{4} - 5x^{2} + 4\), but what they really represent is that these are the four values of \(x\) at which the output of \(f(x)\) equals the output of \(g(x)\). In other words, these are the x-coordinates of where the two functions intersect. The following graph shows this clearly. One point of intersection was at \(x = -2\). If we were to evaluate the two functions at \(x = -2\) we would see this. First, let’s look at \(f(x) = x^{4}\) evaluated at \(x = -2\):
\[ \begin{align} f(x) &= x^{4} \\ f(-2) &= (-2)^{4} = 16 \end{align} \]
which results in the point on the curve \((-2, 16)\). Now, let’s look at \(g(x) = 5x^{2} - 4\) evaluated at \(x = -2\):
\[ \begin{align} g(x) &= 5x^{2} - 4\\ g(-2) &= 5(-2)^{2} - 4 \\ &= 5(4) - 4 \\ &= 20 - 4 = 16 \end{align} \]
which results in the point on the curve \((-2, 16)\). The same point. The same would be true for the other roots, \(x = -1\), \(x = 1\), and \(x = 2\).
This section defined a process for finding the roots of a polynomial, \(f(x) = 0\), regardless of how it was derived (i.e., the three use cases). To summarize:
Before ending this section, let’s address a question that always seems to come up when discussing the root finding process. We’ve been looking at polynomials with integer coefficients. What if they are not? What if they were rational? The Rational Root Theorem would no longer apply. What is one to do given the key role the Rational Root Theorem plays in the process? Well, no worries. There is a solution to this. It may not be the most desirable, but it is a solution, none-the-less. Let’s consider the function, \(f(x) = x^{3} - \frac{5}{3}x^{2} - \frac{1}{4}x + \frac{5}{12}\), which certainly does not have all integer coefficients. Here is the graph of \(f(x)\):
The roots are clearly \(x = -\frac{1}{2}\), \(x = \frac{1}{2}\), and \(x = \frac{5}{3}\). But how were they found given that the root finding problem that we’re faced with is of the form \(f(x) = 0\) which, in this case, is \(f(x) = x^{3} - \frac{5}{3}x^{2} - \frac{1}{4}x + \frac{5}{12} = 0\). Applying the algebraic principle that one can multiply both sides of an equation by the same number or algebraic expression which will not change the solution to the original equation. So, if we multiply \(f(x) = 0\) by a number which would eliminate the fractions, we would end up with all integer coefficients. In this case, that number is \(12\), which is the common denominator among all the fractions. Let’s do that:
\[ \begin{align} f(x) &= 0 \\ x^{3} - \frac{5}{3}x^{2} - \frac{1}{4}x + \frac{5}{12} &= 0 \\ 12\left[x^{3} - \frac{5}{3}x^{2} - \frac{1}{4}x + \frac{5}{12}\right] &= 12(0) \\ 12x^{3} - 20x^{2} - 3x + 5 &= 0 \end{align} \]
Calling this function \(g(x)\), we now have the root finding problem \(g(x) = 0\), or \(12x^{3} - 20x^{2} - 3x + 5 = 0\). Using the root finding process we’ve defined we know how to go about this. Applying the process you will discover that the roots of \(g(x)\) are \(x = -\frac{1}{2}\), \(x = \frac{1}{2}\), and \(x = \frac{5}{3}\). This is left as an exercise to the reader to verify.
This is a way to handle polynomials with non integer, but rational, coefficients. It should be noted, however, that the newly found function, \(g(x)\) is not the same function as \(f(x)\), indeed it’s graph will be different. But the solution to \(g(x) = 0\) is the same as \(f(x)\), hence, the roots will be the same. We will revisit this topic in Section ??.11, Example ??.26.
As complete of a process of finding the roots of a polynomial this might seem, there are still some issues that must be addressed. These include things like, what if there are no rational roots; or what if there are more than two pairs of complex roots?
Before we can address these, we need to look at another theorem which, in my opinion, is one of the most interesting and important theorems available to you at this level of mathematics. The Factor Theorem.
Before presenting the theorem, it might be useful to review the if and only if conditional, should you not be aware of what that means. And, to understand an if and only if conditional, you need to understand an if then conditional statement. An if then statement has two parts, a hypothesis (or assumption(s)) and a conclusion, and is structured such that If the hypothesis is true then the conclusion applies. An example would be if a triangle is equilateral, then all its angles measure 60 degrees. If the hypothesis, a triangle is equilateral, is true, then the conclusion, all its angles measure 60 degrees is also true. Using mathematical notation, this would be written:
where the symbol, \(\implies\), is read as implies.
Now, let’s look at this statement in the reverse direction: If all the angles of a triangle measure 60 degrees, then the triangle is equilateral. If the hypothesis, all the angles of a triangle measure 60 degrees, then the conclusion, the triangle is equilateral, applies.
Using mathematical notation, this would be written:
Looking at these two statements, we see that they are true in both directions. When this occurs, and if then conditional being true in both directions, they can be combined into an if and only if: A triangle is equilateral if and only if all its angles measure 60 degrees. Using mathematical notation, this would be written:
where the symbol, \(\iff\), is read as if and only if.
Now that we have a sense of what an if and only if statement is, we can take a look at the Factor Theorem:
Factor Theorem: Given a polynomial, \(f(x)\), with real coefficients and some \(c \in \mathbb{C}\), \(f(c) = 0\) \(\iff\) \((x - c)\) is a factor.
Hopefully you were able to read and understand what this theorem is saying, but just to be sure, what this theorem basically says is for some polynomial, \(f(x)\),
Whoa! Take a moment and let this sink in!
Looking at the first part of the theorem, if \(c = 2\) is a root of some polynomial, \(f(x)\), then it is true that \((x - 2)\) is a factor of \(f(x)\)! (Being a factor means it divides evenly into \(f(x)\).) This is true regardless of the type of root. If \(c = -2 + 3i\), is a complex root of \(f(x)\), then \((x - (-2 - 3i))\) is a factor!!
Looking at the second part of the theorem, if \((x + 5)\) is a factor of some polynomial, \(f(x)\), then it is true that \(c = -5\) is a root of \(f(x)\)! Likewise, if \((x - (1 + 2\sqrt{3}))\) is a factor, then \(c = 1 + 2\sqrt{3}\) is a root.
One key takeaway from this theorem is that by using the root finding process, besides finding the value or values of \(x\) which causes the output of a function to be zero, in effect, one is, at the same time, factoring the polynomial function, \(f(x)\).
Concept: Via the Factor Theorem, by finding the roots of a polynomial function, \(f(x)\), one is also, at the same time, finding the factors of the function!
Another key takeaway from this theorem is that if the factors of a function, \(f(x)\), are known then, at the same time, one also knows the roots of the function. (Or if even some subset of the factors are known, some subset of the roots are known.)
Concept: Via the Factor Theorem, if the factors, or some subset) of a polynomial function are known, one also, at the same time, knows the roots of the function,\(f(x)\)!
Let’s look at a simple example.
Find the roots and factors of \(f(x) = x^{4} - x^{3} - 2x^{2} + 6x - 4\)
Solution:
The degree of the polynomial, \(f(x) = x^{4} - x^{3} - 2x^{2} + 6x - 4\), is four, so there will be four roots and, from the Factor Theorem, there should be four factors. Following the root finding process it was determined at \(x = -2\) and \(x = 1\) are rational roots. To be sure, let’s verify the root \(-2\):
\[ \begin{array}{r|rrrrr} -2 & 1 & -1 & -2 & 6 & -4\\ & & -2 & 6 & -8 & 4\\ \hline & 1 & -3 & 4 & -2 & 0 \end{array} \]
Yes, \(x = -2\) is a root. We will now verify the root \(1\) using the remainder polynomial \(x^{3} - 3x^{2} + 4x - 2\):
\[ \begin{array}{r|rrrr} 1 & 1 & -3 & 4 & -2\\ & & 1 & -2 & 2\\ \hline & 1 & -2 & 2 & 0 \end{array} \]
Yes, \(x = 1\) is a root. The remainder polynomial, \(x^{2} - 2x + 2\), is a quadratic, so let’s use the quadratic formula to solve:
\[ \begin{align} x &= \frac{-2 \pm \sqrt{4 - 4(1)(2)}}{2(1)} \\ &= \frac{-2 \pm \sqrt{-4}}{2} \\ &= 1 \pm i \end{align} \]
The two remaining roots are \(x = 1 + i\) and \(x = 1 - i\) which are complex roots and are complex conjugates as guaranteed by the Complex Conjugate Theorem.
Thus the four roots are \(x = -2\), \(x = 1\), \(x = 1 + i\), and \(x = 1 - i\).
From the Factor Theorem, the associated factors would be \((x + 2)\), \((x - 1)\), \((x - (1 + i))\), and \((x - (1 - i))\). We can, and should, verify this:
\[ \begin{align} (x + 2)(x - 1)(x - (1 + i))(x - (1 - i)) &= (x^{2} + x - 2)(x^{2} - 2x + 2) \\ &= x^{4} - x^{3} - 2x^{2} + 6x - 4 \end{align} \]
This is the given function \(f(x) = x^{4} - x^{3} - 2x^{2} + 6x - 4\)
This example showed that not only were we able to find the roots of \(f(x) = x^{4} - x^{3} - 2x^{2} + 6x - 4\), we were also able to, in effect, factor the function:
\[ \begin{align} f(x) &= x^{4} - x^{3} - 2x^{2} + 6x - 4 \\ &= (x + 2)(x - 1)(x - (1 + i))(x - (1 - i)) \end{align} \]
Before continuing, a quick note on convention. Remember, to find roots we are dividing the polynomial function, \(f(x)\), by \(x - c\), or \(\frac{f(x)}{x - c}\), where \(c\) is the root. When a root is a complex root, \(c = a + bi\), it is recommended to express the associated factor as \((x - (a + bi))\). There is no need to distribute the negative; in fact, it can perhaps mask what the root really is. The same convention would hold for a non rational root.
Convention: If a root of a polynomial function, \(f(x)\) is complex root, \(a + bi\), it is recommended to express the associated factor as \((x - (a + bi))\). There is no need to distribute the negative. The same convention would hold for a non rational root.
Let’s consider a little more involved example.
Find the roots and factors of \(f(x) = x^{6} - 4x^{5} + 5x^{4} - x^{2} + 4x -5\). It is known that \(i\) is a root.
Solution:
The degree of the polynomial, \(f(x) = x^{6} - 4x^{5} + 5x^{4} - x^{2} + 4x -5\), is \(6\), so from the FTA we know that there will be \(6\) roots. They need not all be real or unique.
It is known that \(i\) is a root, so immediately by the Complex Conjugate Theorem we know a second root, \(-i\), the complex conjugate. Thus two out of the \(6\) roots are now known, \(x = i\) and \(x = -i\), and the associated factors are \((x - i)\) and \((x + i)\).
We can immediately take advantage of knowing these two factors. The product of these two factors will also be a factor of \(f(x)\). Multiplying the factors together we get: \((x - i)(x+i) = x^{2} + 1\). If we then divide \(f(x)\) by \(x^{2} + 1\), the remainder should be zero (for it is a factor) and the remaining degree four polynomial will be a factor of \(f(x)\).
Doing the polynomial division of \(f(x)\) by \(x^{2} + 1\) yields (left as an exercise to the reader to verify):
\[ \frac{x^{6} - 4x^{5} + 5x^{4} - x^{2} + 4x -5}{x^{2} + 1} = x^{4} -4x^{3} + 4x^{2} + 4x - 5 \]
It is on this polynomial that we will apply the root finding process. The potential rational roots are:
\[ \frac{\pm 5, \pm 1}{\pm 1} \]
Of these limited number of possible rational roots, \(1\) and \(-1\) are roots. To see this, let’s first consider \(1\):
\[ \begin{array}{r|rrrrr} 1 & 1 & -4 & 4 & 4 & -5\\ & & 1 & -3 & 1 & 5\\ \hline & 1 & -3 & 1 & 5 & 0 \end{array} \]
The remainder is zero, so \(1\) is a root, and the remaining degree three polynomial is \(x^{3} - 3x^{2} + x + 5\). Next consider \(-1\):
\[ \begin{array}{r|rrrrr} -1 & 1 & -3 & 1 & 5\\ & & -1 & 4 & -5\\ \hline & 1 & -4 &5 & 0 \end{array} \]
The remainder is zero, so \(-1\) is a root, and the remaining degree two polynomial is \(x^{2} - 4x + 5\). Using the quadratic formula on this:
\[ \begin{align} x &= \frac{4 \pm \sqrt{16 - 4(1)(5)}}{2(1)} \\ &= \frac{4 \pm \sqrt{-4}}{2} \\ &= 2 \pm i \end{align} \]
Thus,
This example reveals something interesting. The function, \(f(x) = x^{6} - 4x^{5} + 5x^{4} - x^{2} + 4x -5\), is a degree \(6\) polynomial which means there are \(6\) roots as guaranteed by the FTA. The list of potential rational roots was very small, only two roots were found and they were not repeated roots. Thus, there remained four roots left to find. Said another way, we now have a root finding problem of \(f(x) = 0\) for a degree four polynomial. However, we now have additional information, there are no rational roots. That means that the four roots are either all complex roots, or all non rational roots, or two of each. At this point, we would not be able to find the roots. The quadratic formula would not work (obviously), and we are unable to reduce the degree 4 polynomial to a degree 2 to even use the quadratic formula. We would be stuck.
It was that extra piece of information that saved the day. It was known that \(i\) is a root. Then we were able to apply the Factor Theorem to our advantage so that combined with our other algebraic knowledge (polynomial division, for example) we were able to reduce the degree four polynomial to a degree two upon which we used the quadratic formula to find the other two roots which were indeed, complex.
The Factor Theorem along with some additional insight allowed us to partly answer the questions posed at the end of the last section: What if there are no rational roots; or what if there are more than two pairs of complex roots. We will be addressing these questions again in later sections.
It was said earlier and seen in these examples that the root finding process allows us to find the roots of basically any degree polynomial, but via the invocation of the Factor Theorem, we were also able to, in effect, factor the function.
Consider the following example.
Simplify the following function:
\[ f(x) =\frac{6x^{4} + x^{3} + 4x^{2} + x - 2}{12x^{3} - 4x^{2} - 5x + 2} \]
Solution:
To simplify \(f(x)\) we will need to determine the factors of the numerator and the factors of the denominator to see if any are in common. Let’s consider first the numerator, which can be represented as \(N(x) = 6x^{4} + x^{3} + 4x^{2} + x - 2\). We will use the Factor Theorem which says that if \(c\) is a root, the \(x - c\) is a factor. This means that we need to find the roots, which is a root finding problem: \(N(x) = 0\). This is a degree four polynomial so we are guaranteed that there will be four roots. We have no guarantee that there will be a real root. To seek any rational roots, the Rational Root Theorem tells us that if a rational root exists it will be in:
\[ \frac{\pm 2, \pm 1}{\pm 6,\pm1,\pm 3,\pm 2} \]
Searching through this list we find that \(\frac{1}{2}\) and \(-\frac{2}{3}\) are the rational roots. Therefore, the corresponding factors are \(\left(x - \frac{1}{2}\right)\) and \(\left(x + \frac{2}{3}\right)\). The remaining two roots are \(i\) and \(-i\). The corresponding factors are \((x + i)\) and \((x - i)\). Therefore, we conclude:
\[ N(x) = 6x^{4} + x^{3} + 4x^{2} + x - 2 = \left(x - \frac{1}{2}\right)\left(x + \frac{2}{3}\right)(x + i)(x - i) \]
There is a slight issue here, however. If you were to multiply the right hand side you would not get the left had side exactly. It would be the left side divided by six. To resolve this we multiply the first factor by two and the second factor by three. This eliminates the denominators in the roots and ensures not only that the resulting polynomial has all integer coefficients but that the two sides are equal. Doing so yields:
\[ N(x) = 6x^{4} + x^{3} + 4x^{2} + x - 2 = \left(2x - 1\right)\left(3x + 2\right)(x + i)(x - i) \]
Now, let’s at the denominator which can be represented as \(D(x) = 12x^{3} - 4x^{2} - 5x + 2\). This means that we need to find the roots, which is a root finding problem: \(D(x) = 0\). This is a degree three polynomial so we are guaranteed that there will be three roots. We have the guarantee that there will be at least one real root. To seek any rational roots, the Rational Root Theorem tells us that if a rational root exists it will be in:
\[ \frac{\pm 2, \pm 1}{\pm 12, \pm 1, \pm 6,\pm 2,\pm 4,\pm 3} \]
Searching through this list we find that \(\frac{1}{2}\) is a rational root with multiplicity of two and \(-\frac{2}{3}\) is the other rational root. Therefore, the corresponding factors are \(\left(x - \frac{1}{2}\right)\), \(\left(x - \frac{1}{2}\right)\), and \(\left(x + \frac{2}{3}\right)\). Therefore, we conclude:
\[ \begin{align} D(x) = 12x^{3} - 4x^{2} - 5x + 2 &= \left(x - \frac{1}{2}\right)\left(x - \frac{1}{2}\right)\left(x + \frac{2}{3}\right) \\ &= \left(x - \frac{1}{2}\right)^{2}\left(x + \frac{2}{3}\right) \end{align} \]
To make sure that the right and left sides are equal (by algebraically removing the denominators in the two roots) we get:
\[ \begin{align} D(x) = 12x^{3} - 4x^{2} - 5x + 2 &= \left(2x - 1\right)^{2}\left(3x + 2\right) \end{align} \]
Returning to the original question to simplify the function, \(f(x)\):
\[ \begin{align} f(x) &= \frac{6x^{4} + x^{3} + 4x^{2} + x - 2}{12x^{3} - 4x^{2} - 5x + 2} \\ \\ &= \frac{\left(2x - 1\right)\left(3x + 2\right)(x + i)(x - i)}{\left(2x - 1\right)^{2}\left(3x + 2\right)} \\ \\ &= \frac{(x + i)(x - i)}{\left(2x - 1\right)} \\ \\ &= \frac{x^{2} + 1}{2x + 1} \end{align} \]
Thus, the as given function, \(f(x) = \frac{6x^{4} + x^{3} + 4x^{2} + x - 2}{12x^{3} - 4x^{2} - 5x + 2}\) simplifies to \(f(x) = \frac{x^{2} + 1}{2x + 1}\).
To verify that this is indeed true, here is the plot of the given function \(f(x) = \frac{6x^{4} + x^{3} + 4x^{2} + x - 2}{12x^{3} - 4x^{2} - 5x + 2}\):
And here is the plot of the simplified function \(f(x) = \frac{x^{2} + 1}{2x + 1}\):
They are the same!
This example highlighted a very important idea. Through the root finding process in combination with the Factor Theorem, allows for the easy factoring of polynomials. This also applies to quadratics, of course, for they are nothing more than a degree two polynomial. Gone are the days are archaic factoring rules and even that there are some quadratics can not be factored. In mathematics, especially in courses such as calculus, being able to simplify a rational function, such as the one in the above example, will be quite helpful, one example being the finding of limits.
Concept: The root finding process in combination with the Factor Theorem, allows for the (easy) factoring of polynomials. This also applies to quadratics, of course, for they are nothing more than a degree two polynomial.
There is another interesting application, if you will, of the Factor Theorem as we’ll see in the next example.
Given \(f(x) = \frac{1}{2}(x+7)^{3}(x-2)^{2}(x-5)^{2}(x+1)^{3}(x+9)^{9}\), find the roots
Solution:
At first glance this seems like a monumental problem when, in fact, it is quite simple. Remember, we are looking for \(f(x) = 0\), which in this case would be \(\frac{1}{2}(x+7)^{3}(x-2)^{2}(x-5)^{2}(x+1)^{3}(x+9)^{9} = 0\). Also remember that whenever you have a product of terms equal to zero, at least one of those terms has to be zero. What this means in this case is (we can ignore the \(\frac{1}{2}\)):
\[ \begin{align} (x+7)^{3} &= 0 \\ (x-2)^{2} &= 0 \\ (x-5)^{2} &= 0 \\ (x+1)^{3} &= 0 \\ (x+9)^{9} &= 0 \end{align} \] Which basically means
\[ \begin{align} (x+7) &= 0 \\ (x-2) &= 0 \\ (x-5) &= 0 \\ (x+1) &= 0 \\ (x+9) &= 0 \end{align} \]
Hence, the roots are \(-7\), \(2\), \(5\), \(-1\), \(-9\). But, wait! Looking at the function, \(f(x) = \frac{1}{2}(x+7)^{3}(x-2)^{2}(x-5)^{2}(x+1)^{3}(x+9)^{9}\), this, if multiplied out would produce a degree \(19\) polynomial. By the FTA there should be, therefore, \(19\) roots. We only identified 5.
So, let’s look at the function, \(f(x) = \frac{1}{2}(x+7)^{3}(x-2)^{2}(x-5)^{2}(x+1)^{3}(x+9)^{9}\) again. We realize that it nothing more than the product of its factors. This told us immediately what the roots are from the factor theorem. There is one catch, however, the factors were raised to powers. When we solved for the roots above, we were taking the roots of each factor raised to a power. What this means is that the power to which a given factor is raised specifies the multiplicity of that root. Hence, the roots are actually
Summing the multiplicities we do indeed get \(19\).
Now we are ready to address the open question, What if there are no rational roots. To begin to answer to this question we need to explore two addition theorems, The Intermediate Value Theorem and Bolzano’s Theorem.
The Intermediate Value Theorem (IVT) is an important theorem. We will use it in its simplest form to help in our root finding quest, but be forewarned, you will see it again in calculus.
Before stating the theorem, we need to have a basic understanding of what it means for a function to be continuous, something you will study in great detail in calculus. For our purposes here, to be continuous basically means that the function is one smooth curve, there are no breaks, no jumps, no holes, nothing but one smooth curve. An elementary way to think of this is that you can draw the graph of the function without lifting your pencil off the paper. Your pencil doesn’t all of a sudden jump to a new location, doesn’t have to skip over a hole, so to speak, nor does it hit a line which it has to jump over. The graph is just one smooth curve.
A function can be continuous over its entire domain or it can be continuous with some interval, \([a,b]\). Either way it is one smooth curve everywhere or within the interval.
Concept: For the purposes here, a function is continuous over its entire domain or with a specific interval, \([a,b]\), if its graph is one smooth curve, no breaks, jumps, or holes. Just one smooth curve.
With this as a basic understanding of a function being continuous, we can state the Intermediate Value Theorem, IVT:
Intermediate Value Theorem: For some function, \(f\), which is continuous in the interval \([a,b]\), \(a < b\), and for some \(k\) such that \(f(a) < k < f(b)\), then there exists a \(c \in (a,b)\) such that \(f(c) = k\). \((a,b,c,k \in \mathbb{R})\)
What this theorem is saying is that assume the function, \(f\), is continuous in the interval \([a,b]\). The function will have the output \(f(a)\) at the left end of the interval. The function will have the output \(f(b)\) at the right end of the interval. For any function output value, \(k\), that lies between these two function outputs, i.e., \(f(a) < k < f(b)\), then there must be a number, \(c\), that lies between \(a\) and \(b\), i.e., \(a < c < b\), such that the function evaluated at this \(c\) is \(k\). That is, \(f(c) = k\).
Hopefully this was clear to you, but to help the following is a visualization of the IVT:
This visualization of the IVT shows that between \(a\) and \(b\) the function is continuous and the outputs are \(f(a)\) and \(f(b)\), respectively. A value \(k\) was picked between these two outputs. There was a value, \(c\), between \(a\) and \(b\), such that \(f(c) = k\). In other words, for any function output value, let’s call it \(k\), that lies between \(f(a)\) and \(f(b)\), there will always be an \(x\) value, let’s call it \(c\), between \(a\) and \(b\) such that the function’s output value for this \(c\), will be \(k\). That is, \(f(c) = k\). This would be true for any \(k\) between the two outputs \(f(a)\) and \(f(b)\)
There are a lot of uses for the IVT, but let’s consider one simple example.
Given \(f(x) = x^{3} - 4x^{2} + x + 8\), use the Intermediate Value Theorem to show that there exists a \(c\) (a real number) such that \(f(c) = 6\)
Solution:
Before using the IVT we must explore where the function is continuous. This function is a degree three polynomial, a cubic, which is continuous everywhere (all polynomials are continuous everywhere as you’ll learn in calculus), so the IVT applies. From the given information, \(k = 6\). So, we should pick an interval \([a,b]\) such that \(f(a)\) and \(f(b)\) surround \(k = 6\). If we let \(a = 0\), then \(f(a) = 8\); if we let \(b = 2\), then \(f(2) = 2\). So, the outputs of \(f(x)\) in \([0,2]\) surround \(k = 6\). The IVT guarantees that there is an input number in \([0,2]\), let’s call it \(c\), such that the function’s output value would be \(k = 6\). The following graph verifies all this.
The IVT does not specify what the number \(c\) is, nor how to find it. It just guarantees that there is one. We will deal with this issue soon. But, in this example, it is clear that \(c = 1\)
Now that we have a general understanding of the Intermediate Value Theorem as defined with the scope of our purposes here, let’s explore the Bolzano’s Theorem whichis really a specific instance of the IVT tuned for root finding.
Like the Intermediate Value Theorem, Bolzano’s Theorem requires that the function of interest be continuous in the interval \([a,b]\) of interest. It is also concerned about the outputs of the function at the two ends of the interval, that is, \(f(a)\) and \(f(b)\). However, in order to use this theorem there are imposed conditions on these outputs, not on what the exact outputs are, but on their sign. In particular, the two outputs must be of the opposite sign in order to apply the theorem. One output must be positive and the other output must be negative. It does not matter which is which, just that they are of opposite signs. For example, if \(f(a) < 0\) (negative), then \(f(b)\) must be positive, i.e., \(f(b) > 0\). If, however, \(f(a) > 0\) (positive), then \(f(b)\) must be negative, i.e., \(f(b) < 0\). These are the conditions of the theorem, along with the fact that the function, \(f(x)\) has to be continuous of course. Thus, Bolzano’s Theorem is stated as:
Bolzano’s Theorem: For some function, \(f\), which is continuous in the interval \([a,b]\) such that \(f(a) < 0 < f(b)\) or \(f(a) > 0 > f(b)\), then there exists at least one \(c \in (a,b)\) such that \(f(c) = 0\). \((a,b,c \in \mathbb{R})\)
As you can see, this theorem is much like the IVT in terms of concept. It is the conditions imposed on the outputs of the function at the two ends of the interval, \([a,b]\) that really set it apart. The following visualization will help understand the theorem.
Imagine you are sitting on the curve of \(f(x)\) at the point \((a,f(a))\) and your goal is to get to the point \((b,f(b))\). To achieve your goal you begin to travel along the curve, for this curve that means you are going down. Since the curve does not have any jumps, breaks, or holes (remember,the function is continuous), you have a smooth slide down the curve. As you’re sliding down you notice that the outputs of the function are getting smaller, still positive, but smaller, for you are approaching the x-axis. A moment or two later you notice that the outputs have become negative. You crossed the x-axis or, more specifically, you went through the x-axis. You continue to slide down and eventually you reach your destination. You are now at \((b,f(b))\).
When you first started you were above the x-axis since \(f(a)\) is positive (\(f(a) > 0\)). When you ended you are now below the x-axis since \(f(b)\) is negative. The only possible way that this could have happened as you were sliding down the curve is to go through the x-axis (again, remember the function is continuous)! There is no other way that this could have happened. You noticed this as the outputs were getting smaller, still positive, but smaller, as you approached the x-axis but once you emerged, the outputs are now negative. In order for this to have happened, there must have been a point at which the output of the function was zero. This occurred at the point \(c\). This means that \(f(c) = 0\). And, the point at which the output of a function is zero is a root. Thus, \(c\) is a root! The same analogy applies if when you started at \((a,f(a))\) you were below the x-axis and traveled upward to the destination \((b,f(b))\).
The take-away is that if you started on one side of the x-axis and traveled along a continuous curve to the other side of the x-axis, you had to have gone through the x-axis. And, the point at which you went through the x-axis is a root of the function. Notice that the theorem said that there is at least one \(c\) in \([a,b]\). The curve could have went up and down going through the x-axis many times, thus there could be more than one root in \([a,b]\). It only matters that where you started is on one side of the x-axis and where you end up is on the other side. If that condition is met, then there is at least one root in \([a,b]\), could be more, but there’s at least one.
To explore how Bolzano’s Theorem works we will explore some examples which will use the function, \(f(x) = x^{4} - 5x^{2} + 4\) whose graph is seen below:
From the graph it is clear that the roots of \(f(x)\) are \(x = -2\), \(x = -1\), \(x = 1\), and \(x = 2\).
Determine if there is at least one root of \(f(x) = x^{4} - 5x^{2} + 4\) in \(\left[0,\frac{3}{2}\right]\).
Solution:
The function is a polynomial which means it is continuous everywhere, thus that condition of Bolzano’s Theorem is met. Now, we need to check to see if the output of the function at the two ends, of the interval, \(a = 0\) and \(b = \frac{3}{2}\), are of opposite signs. It’s clear that \(f(0) = 4\) which is positive. Now, let’s check \(f\left(\frac{3}{2}\right)\)
\[ \begin{align} f\left(\frac{3}{2}\right) &= \left(\frac{3}{2}\right)^{4} - 5\left(\frac{3}{2}\right)^{2} + 4 \\ \\ &= \frac{81}{16} - 5\left(\frac{9}{4}\right) + 4 \\ &= \frac{81}{16} - \frac{45}{4} + 4 \\ \\ &= \frac{81}{16} - \frac{180}{16} + \frac{64}{16} \\ \\ &= -\frac{35}{16} \end{align} \]
From this we see that \(f\left(\frac{3}{2}\right) = -\frac{35}{16}\), which is negative, and \(f(0) = 4\), which is positive. The function, \(f(x) = x^{4} - 5x^{2} + 4\), evaluated at the endpoints of the interval \(\left[0,\frac{3}{2}\right]\) are of opposite signs. We can now apply Bolzano’s Theorem which guarantees that there is at least one root in \(\left[0,\frac{3}{2}\right]\), which the following graph verifies:
It is important to once again note that the theorem does not state what the root it guarantees to be in the interval, nor does it give any information as to how about going about finding it. In this case, it is obvious that the root is \(x = 1\).
Let’s consider another example.
Determine if there is at least one root of \(f(x) = x^{4} - 5x^{2} + 4\) in \(\left[-\frac{1}{2},\frac{1}{2}\right]\).
Solution:
The function is a polynomial which means it is continuous everywhere, thus that condition of Bolzano’s Theorem is met. Now, we need to check to see if the output of the function at the two ends, of the interval, \(a = -\frac{1}{2}\) and \(b = \frac{1}{2}\), are of opposite signs. First check \(f\left(-\frac{1}{2}\right)\):
\[ \begin{align} f\left(-\frac{1}{2}\right) &= \left(-\frac{1}{2}\right)^{4} - 5\left(-\frac{1}{2}\right)^{2} + 4 \\ \\ &= \frac{1}{16} - 5\left(\frac{1}{4}\right) + 4 \\ &= \frac{1}{16} - \frac{5}{4} + 4 \\ \\ &= \frac{1}{16} - \frac{20}{16} + \frac{64}{16} \\ \\ &= \frac{45}{16} \end{align} \]
From this we see that \(f\left(-\frac{1}{2}\right) = \frac{45}{16}\), which is positive. Next, let’s check \(f\left(\frac{1}{2}\right)\):
\[ \begin{align} f\left(\frac{1}{2}\right) &= \left(\frac{1}{2}\right)^{4} - 5\left(\frac{1}{2}\right)^{2} + 4 \\ \\ &= \frac{1}{16} - 5\left(\frac{1}{4}\right) + 4 \\ &= \frac{1}{16} - \frac{5}{4} + 4 \\ \\ &= \frac{1}{16} - \frac{20}{16} + \frac{64}{16} \\ \\ &= \frac{45}{16} \end{align} \]
From this we see that \(f\left(\frac{1}{2}\right) = \frac{45}{16}\), which is positive. Thus, the function evaluated at the two ends of the interval, \(\left[-\frac{1}{2},\frac{1}{2}\right]\), are of the same sign. We can not apply the conclusion of Bolano’s Theorem which would guarantee that there is at least one root in the interval \(\left[-\frac{1}{2},\frac{1}{2}\right]\). The following graph verifies:
This example showed that if the function output at the two ends of the interval, \([a,b]\), are of the same sign there is no root in \([a,b]\). The fact that the function is continuous in \([a,b]\) assures of this.
Now let’s do one more example.
Determine if there is at least one root of \(f(x) = x^{4} - 5x^{2} + 4\) in \(\left[-\frac{5}{2},\frac{3}{2}\right]\).
Solution:
The function is a polynomial which means it is continuous everywhere, thus that condition of Bolzano’s Theorem is met. Now, we need to check to see if the output of the function at the two ends, of the interval, \(a = -\frac{5}{2}\) and \(b = \frac{3}{2}\), are of opposite signs. First check \(f\left(-\frac{5}{2}\right)\):
\[ \begin{align} f\left(-\frac{5}{2}\right) &= \left(-\frac{5}{2}\right)^{4} - 5\left(-\frac{5}{2}\right)^{2} + 4 \\ \\ &= \frac{625}{16} - 5\left(\frac{25}{4}\right) + 4 \\ &= \frac{625}{16} - \frac{125}{4} + 4 \\ \\ &= \frac{625}{16} - \frac{500}{16} + \frac{64}{16} \\ \\ &= \frac{189}{16} \end{align} \]
From this we see that \(f\left(-\frac{5}{2}\right) = \frac{189}{16}\), which is positive. Next, let’s check \(f\left(\frac{3}{2}\right)\):
\[ \begin{align} f\left(\frac{3}{2}\right) &= \left(\frac{3}{2}\right)^{4} - 5\left(\frac{3}{2}\right)^{2} + 4 \\ \\ &= \frac{81}{16} - 5\left(\frac{9}{4}\right) + 4 \\ &= \frac{81}{16} - \frac{45}{4} + 4 \\ \\ &= \frac{81}{16} - \frac{180}{16} + \frac{64}{16} \\ \\ &= -\frac{35}{16} \end{align} \]
From this we see that \(f\left(\frac{3}{2}\right) = -\frac{35}{16}\), which is negative. The function, \(f(x) = x^{4} - 5x^{2} + 4\), evaluated at the endpoints of the interval \(\left[-\frac{5}{2},\frac{3}{2}\right]\) are of opposite signs. We can now apply Bolzano’s Theorem which guarantees that there is at least one root in \(\left[-\frac{5}{2},\frac{3}{2}\right]\), which the following graph verifies:
In this example we saw that Bolzano’s Theorem guaranteed that there was at least one root in the interval \(\left[-\frac{5}{2},\frac{3}{2}\right]\) for the function evaluated at the two endpoints of the interval were of opposite sign. However, as the graph showed there were three roots in that interval, \(x = -2\), \(x = -1\), and \(x = 1\). This is something to keep in mind. We’ll discuss this idea of what if there are more than one root in an interval in a later section.
Hopefully you can see how Bolzano’s Theorem is basically the IVT tuned for root finding. Using the IVT without Bolzano’s Theorem for root finding in an interval \([a,b]\), the goal would be to pick \(k = 0\). But to do this, \(k\) has to be between \(f(a)\) and \(f(b)\) which means they must be of opposite signs. This is why I say that Bolzano’s Theorem is tuned for root finding, it ensures these conditions as part of the theorem assumptions or necessary conditions. When doing root finding we will invoke Bolzano’s Theorem directly.
We now understand how to determine if at least one root of a function, \(f(x)\), exists in an interval, \([a,b]\), via the use of Bolzano’s Theorem. What we still do not know is how to find it. Remember, both the IVT and Bolzano Theorems are what is commonly referred to as existence theorems. They guarantee the that something exists but they do not give (any) information about what it is or how to find it. A bit problematic, perhaps.
Well, once we know that a root exists in an interval, we can use a numerical analysis method to find it. The numerical method we’re going to focus on at this level of your mathematical maturity is the Bisection Method.
Numerical analysis is, arguably, one of the most exciting fields in mathematics and the exploration of the Bisection method is an excellent one to serve as an introduction to numerical analysis.
Loosely speaking, numerical analysis designs and employs algorithmic techniques to find approximate, yet accurate, numeric solutions to problems in mathematics. This is quite useful where there is no closed form solution, where finding an exact solution is prohibitively expensive, or where a solution is needed within the context of a software application. With today’s computing power availability, numerical analysis (inclusive of mathematical models) algorithms and implementations have seen a rise in fields ranging from engineering to physical and life sciences, social science, medicine, business and even the arts. Most (if not all) numerical analysis techniques are iterative where given some initial estimate to the solution, the algorithm is applied iteratively, updating the estimate based on the previous estimate till a desired tolerance (or in some cases, an exact solution) is reached. Numerical analysis is not only concerned with the design of such algorithms (or methods), but is also concerned with their convergence, accuracy, stability and (implementation) complexity.
One area where numerical methods has been employed, and quite prevalent, is in the area of root finding. There are many numerical methods available for root finding, each with their own particular pros and cons. The particular root finding method for finding a root of a function within a given interval we will focus on here is the Bisection Method.
The bisection algorithm is actually quite simple and makes use of Bolzano’s theorem. As with the use of any theorem, the initial conditions, or assumptions, of the theorem must first be checked and verified before the conclusion of the theorem can be applied. In this case, for some function, \(f(x)\) and an interval \([a,b]\):
Once the conditions have been verified, then one can apply the bisection algorithm. The essence of the algorithm is to continually halve an interval till the root is found exactly or found within a desired tolerance. A tolerance is basically to what level of precision you are willing to tolerate. For some applications this might be 2 or 3 decimal places, 10 or 12 decimal place accuracy is required. The algorithm is guaranteed to converge to the root, and it can be estimated as to how many iterations through the iteration is required for convergence. There are different convergence methods available. We will not be concerning ourselves with the details of all this. I just wanted you to be aware of how these types of methods work. We will just set a tolerance of, say, \(0.001\), to limit the number of iterations through the algorithm yet, at the same time, always remember that the accuracy could be improved by setting a higher tolerance.
With all this as an introduction, let’s look at the Bisection Method algorithm. Remember, you would have already verified that a root exists in the interval \([a,b]\) via Bolzano’s Theorem so when you invoke the Bisection Method you are guaranteed to find a root. The Bisection Method algorithm is:
Notice that the algorithm keeps halving the interval in which the root lies. It does so, by adjusting the left or right ends of the interval. This process of honing in on the root is sometimes calling bracketing the root. Thus, the Bisection Method is within a class of numerical methods known as bracketing methods.
If this all sounds complicated, it really is not. A simple example would help bear this out.
Use the Bisection Method to find (estimate) the root of \(f(x) = x - 2\) in the interval \([-3,5]\).
Solution:
This is a very simple root finding problem of \(f(x) = 0\), for it is clear that the root is \(x = 2\). However, the purpose here is to understand the Bisection Method algorithm.
Before invoking the bisection algorithm, we must check the conditions of Bolzano’s Theorem. Since \(f(x)\) is a polynomial, it is continuous everywhere, but the conditions of \(f(a)\) and \(f(b)\) being of opposite signs depends on the interval selected. Executing the bisection algorithm on \([-3,5]\) yields \(f(-3) = -5\), which is negative and \(f(5) = 3\), which is positive. The outputs of the function evaluated at each of end of the interval are of opposite signs, therefore, we can apply Bolano’s Theorem, which guarantees us that at least one root, \(c\), exists in \([-3,5]\). That is, there is at least one \(c\) such that \(f(c) = 0\). It is now okay to begin executing the algorithm:
Stepping through the algorithm. The first iteration will operate on \(a = -3\) and \(b = 5\):
The second iteration will operate on \(a = 1\) and \(b = 5\):
The third iteration will operate on \(a = 1\) and \(b = 3\)::
After three iterations through the algorithm, the root \(x = 2\) was found. This example highlights the point made above that the interval widths are halved each time through the iteration:
For each iteration let’s show visually the search intervals for the root as dictated by the algorithm. Here is the graph of the function, \((x) = x -2\) and the first (initial) interval \([-3,5]\) in which we are seeking to find the root \(x = 2\):
Here is the graph of the function, \((x) = x -2\) and the second interval \([1,5]\) in which we are seeking to find the root \(x = 2\):
And, here is the graph of the function, \((x) = x -2\) and the third interval \([1,3]\) in which we are seeking to find the root \(x = 2\):
With each iteration you can see that the algorithm is honing in on the root. And, it is within this interval, \([1,3]\), in which the algorithm found the root, \(x = 2\), which happened to be at the midpoint of this interval.
This example stepped through the Bisection Method showing how it
works. The calculations in each iteration are not difficult (especially
for this simple example) but can be cumbersome as the complexity of the
function of interest increases. As is the case for most, if not all,
numerical methods which are iterative by definition, it is usually done
in software. A routine, bisectionMethod.R, was
self-developed to actually implement the Bisection Method algorithm. It
steps through the algorithm step-by-step, as we did by hand above,
recording all the key information for each iteration, until either the
desired tolerance was reached or when the number of iterations was
reached. The complete execution of the Bisection Method, iteration by
iteration, in a table should that be of interest. Here is the Bisection
Method results for the above example of \(f(x)
= x - 2\), interval \([-3.5]\),
and a tolerance of \(0.001\).
| i | a | b | c | fOfa | fOfb | fofc |
|---|---|---|---|---|---|---|
| 1 | -3 | 5 | 1 | -5 | 3 | -1 |
| 2 | 1 | 5 | 3 | -1 | 3 | 1 |
| 3 | 1 | 3 | 2 | -1 | 1 | 0 |
The column headings are reasonably self explanatory, but a brief summary follows:
For each iteration, you can see what the signs of the function evaluated at the two end points are and how the left or right ends are adjusted to ensure the condition that the output of the function at the two end points must be of opposite signs.
Not all invocations of the bisection method will be as quick and clean as the above example where an exact solution was found after only three iterations. A different interval will produce a different number of iterations through the algorithm. Consider the interval \([-4,5]\) with a tolerance of \(\epsilon = 0.001\):
| i | a | b | c | fOfa | fOfb | fofc | |
|---|---|---|---|---|---|---|---|
| 10 | 10 | 1.994141 | 2.011719 | 2.002930 | -0.0058594 | 0.0117188 | 0.0029297 |
| 11 | 11 | 1.994141 | 2.002930 | 1.998535 | -0.0058594 | 0.0029297 | -0.0014648 |
| 12 | 12 | 1.998535 | 2.002930 | 2.000732 | -0.0014648 | 0.0029297 | 0.0007324 |
| 13 | 13 | 1.998535 | 2.000732 | 1.999634 | -0.0014648 | 0.0007324 | -0.0003662 |
| 14 | 14 | 1.999634 | 2.000732 | 2.000183 | -0.0003662 | 0.0007324 | 0.0001831 |
| 15 | 15 | 1.999634 | 2.000183 | 1.999908 | -0.0003662 | 0.0001831 | -0.0000916 |
In this case, it took 15 iterations to find (estimate) the root to be \(1.999908\). (Again, a better estimate would have resulted if the tolerance was set higher). The choice of the interval to search for a root matters, but regardless, the Bisection Method is guaranteed to converge to the root, though the number of iterations to do so will increase.
Remember, Bolzano’s Theorem guarantees that there is at least one root of a function in an interval, assuming that the conditions of continuity and the function evaluated at the two ends of the interval are of opposite signs. What would the Bisection Method do in the case where there are multiple roots in the interval? The following example explores this.
Use the Bisection Method to find (estimate) the root of \(f(x) = x^{4} - 5x^{2} + 4\) in the interval \(\left[-\frac{3}{2},\frac{5}{2}\right]\).
Solution:
This function was explored in previous examples, but let’s take a look at it again here highlighting the interval of interest, \(\left[-\frac{3}{2},\frac{5}{2}\right]\). First, we should verify that Bolzano’s Theorem can be used. The function is continuous everywhere (\(f(x)\) is a polynomial) and \(f\left(-\frac{3}{2}\right) = -\frac{35}{16}\), which is negative and \(f\left(\frac{5}{2}\right) = \frac{189}{16}\), which is positive (are of opposite signs), so we can apply Bolzano’s Theorem. Here is the graph of\(f(x) = x^{4} - 5x^{2} + 4\) with the interval \(\left[-\frac{3}{2},\frac{5}{2}\right]\) hightlighted:
From the graph, we see that there are three roots in the interval
\(\left[-\frac{3}{2},\frac{5}{2}\right]\),
\(x = -1\), \(x = 1\), and \(x
= 2\). Now, let’s execute the Bisection Method for this function
in the interval \(\left[-\frac{3}{2},\frac{5}{2}\right]\)
(again, using a tolerance of \(0.001\))
using the bisectionMethod.R routine:
| i | a | b | c | fOfa | fOfb | fofc |
|---|---|---|---|---|---|---|
| 1 | -1.5 | 2.5 | 0.5 | -2.1875 | 11.8125 | 2.8125 |
| 2 | -1.5 | 0.5 | -0.5 | -2.1875 | 2.8125 | 2.8125 |
| 3 | -1.5 | -0.5 | -1.0 | -2.1875 | 2.8125 | 0.0000 |
After only three iterations, the exact root, \(x = -1\) was found.
This example showed that even though there were multiple roots within an interval, the Bisection Method will converge to one of those roots.
There is a lot more that could be said about this issue which, if you ever take a course in numerical analysis, or numerical methods, which I highly recommend you do, you will explore these types of algorithms in a lot more detail, all of which is beyond the level here. Suffice it so say, that the Bisection Method will convergence on a root and the careful consideration of the chosen interval is important. Ideally you want to chose an interval that is tightly bounded about the root of interest.
With our knowledge and understanding of Bolzano’s Theorem and the Bisection Method, we are now in a position to answer the question posed at the end of Section ??.6: What if there are no rational roots?
Using a variety of theorems, each with its own purpose, we’ve been studying the finding of roots of a degree \(n\) polynomial, \(f(x)\), that is \(f(x) = 0\). And in particular, we’ve been focused on polynomials with integer coefficients. The Rational Root Theorem played a key role in this process. It identified any potential rational roots as being in the ratio of the plus or minus factors of the constant coefficient to the plus or minus factors of the leading coefficient. The hope was either all the roots were rational and thus be in the list; or, that the roots that are rational would be (along with perhaps some additional information) sufficient to eventually end up with a degree two polynomial which could then be easily solved via the quadratic formula. What if this was not the case? Would we be stuck?
Also. what if we are faced with a polynomial that does not have integer coefficients. Of the theorems presented, all still apply except for the Rational Root Theorem, (the Intermediate Value Theorem and Bolzano’s Theorem are independent of polynomials, they are defined for any function as long as it is continuous in the interval, \([a,b]\), of interest). The implication of this is that we would not even have any rational roots to get started with, to even try. Would we be stuck?
The answer is no, we would not be stuck. The answer lies in Bolzano’s Theorem and the Bisection Method. They come to the rescue.
Let’s get a sense of how this would work using a simple example.
Find the real root of \(f(x) = x^{3} - x^{2} - x - 1\)
Solution:
This is a degree three polynomial which we know from the FTA will have three roots. It is guaranteed that there will be at least one real root. A plot of the function verifies that there is a real root, but it also shows that there are no other real roots, the other two are complex.
To try and find this real root, we would most likely invoke the Rational Root Theorem to look for rational roots. The only possible choices for a rational root would be \(\pm 1\). Trying \(\frac{f(x)}{x - 1}\) and \(\frac{f(x)}{x + 1}\) would result in a non zero remainder, thus neither \(1\) or \(-1\) are roots. The list of possible rational roots has been exhausted. We are stuck. Or are we?
Looking closely at the graph, we observe, again, that there is indeed a root and it appears to be somewhere between \(\frac{3}{2}\) and \(2\). Now we need to find it. To do so, we will use Bolzano’s Theorem and the Bisection Method for the interval \(\left[\frac{3}{2},2\right]\).
To use Bolzano’s Theorem we first have to verify the conditions: \(f(x)\) is a polynomial so we know that it is continuous in the interval, \(\left[\frac{3}{2},2\right]\), for a polynomial is continuous everywhere. Now we need to check what the signs are of the output of the function at the two endpoints of the interval. First, let’s check \(f\left(\frac{3}{2}\right)\):
\[ \begin{align} f\left(\frac{3}{2}\right) &= \left(\frac{3}{2}\right)^{3} - \left(\frac{3}{2}\right)^{2} - \left(\frac{3}{2}\right) - 1 \\ \\ &= \left(\frac{27}{8}\right) - \left(\frac{9}{4}\right) - \left(\frac{3}{2}\right) - 1\\ \\ &= \left(\frac{27}{8}\right) - \left(\frac{18}{8}\right) - \left(\frac{12}{8}\right) - \left(\frac{8}{8}\right) \\ \\ &= -\left(\frac{11}{8}\right) \end{align} \]
Thus, \(f\left(\frac{3}{2}\right) = -\left(\frac{11}{8}\right)\) which is negative. Next, let’s check \(f(2)\):
\[ \begin{align} f(2) &= (2)^{3} - (2)^{2} - (2) - 1 \\ &= 8 - 4 - 2 -1 \\ &= 1 \end{align} \]
Thus, \(f(2) = 1\) which is positive. Therefore, the function, \(f(x)\), evaluated at the two ends of the interval, \(\left[\frac{3}{2},2\right]\), are of opposite signs. The conditions of Bolzano’s Theorem have been met, so we are guaranteed that there is at least one root in the interval \(\left[\frac{3}{2},2\right]\).
To find it we will use the Bisection Method with a tolerance of \(\epsilon = 0.001\). This could be done by
hand, but here is the output of the bisectionMethod.R
routine:
| i | a | b | c | fOfa | fOfb | fofc | |
|---|---|---|---|---|---|---|---|
| 5 | 5 | 1.812500 | 1.843750 | 1.828125 | -0.1433105 | 0.0245056 | -0.0604973 |
| 6 | 6 | 1.828125 | 1.843750 | 1.835938 | -0.0604973 | 0.0245056 | -0.0182710 |
| 7 | 7 | 1.835938 | 1.843750 | 1.839844 | -0.0182710 | 0.0245056 | 0.0030484 |
| 8 | 8 | 1.835938 | 1.839844 | 1.837891 | -0.0182710 | 0.0030484 | -0.0076285 |
| 9 | 9 | 1.837891 | 1.839844 | 1.838867 | -0.0076285 | 0.0030484 | -0.0022944 |
| 10 | 10 | 1.838867 | 1.839844 | 1.839355 | -0.0022944 | 0.0030484 | 0.0003759 |
After 10 iterations, the root was estimated to be \(1.839355\).
As an example of the effect of the tolerance value, here is the Bisection Method run using the exact same interval of \(\left[\frac{3}{2},2\right]\) but with a tolerance of \(\epsilon = 0.00000001\).
| i | a | b | c | fOfa | fOfb | fofc | |
|---|---|---|---|---|---|---|---|
| 22 | 22 | 1.839287 | 1.839287 | 1.839287 | -1e-06 | 3e-07 | -4e-07 |
| 23 | 23 | 1.839287 | 1.839287 | 1.839287 | -4e-07 | 3e-07 | -1e-07 |
| 24 | 24 | 1.839287 | 1.839287 | 1.839287 | -1e-07 | 3e-07 | 1e-07 |
| 25 | 25 | 1.839287 | 1.839287 | 1.839287 | -1e-07 | 1e-07 | 0e+00 |
| 26 | 26 | 1.839287 | 1.839287 | 1.839287 | -1e-07 | 0e+00 | 0e+00 |
| 27 | 27 | 1.839287 | 1.839287 | 1.839287 | 0e+00 | 0e+00 | 0e+00 |
After 27 iterations (only the last six being displayed) the estimate of the root now is \(1.839287\), which based on the function evaluations at \(a\), \(b\), and \(c\), is pretty accurate!
This example showed the use of the Bisection Method, along with Bolzano’s Theorem to find a non rational root within the context of the root finding case of \(f(x) = 0\). Let’s look at another example where this time we will explore the root finding case of \(f(x) = g(x)\).
Find where the output of \(f(x) = -x^{4} - x^{2} + x + 3\) and \(g(x) = 2x^{3} - x^{2} - 3\) is equal for \(x > 0\) and what that output value is.
Solution:
This is a case where we are trying for find where \(f(x) = g(x)\). This becomes the root finding problem \(f(x) - g(x) = 0\). This new function is:
\[ \begin{align} f(x) - g(x) &= 0 \\ -x^{4} - x^{2} + x + 3 - (2x^{3} - x^{2} - 3) &= 0 \\ -x^{4} - 2x^{3} + x + 6 &= 0 \end{align} \]
To try and find these roots, we would most likely invoke the Rational Root Theorem to look for rational roots. The only possible choices for a rational root would be \(\pm 6, \pm 1, \pm 3, \pm 2\). Left as an exercise to the reader, none of these possible rational roots are roots. The list of possible rational roots has been exhausted. Assuming there is a real root, which would mean there would be two real roots, we will need Bolzano’s Theorem and the Bisection Method to find them.
First, however, let’s take a look at the graph of these two functions, \(f(x) = x^{4} - x^{2} + x + 3\) and \(g(x) = 2x^{3} - x^{2} - 3\) together, limiting the domain to \(x > 0\) for we are only interested in where the output of these two functions are equal for \(x > 0\):
It is clear from the graph that the only place where the two outputs are equal (i.e., the point of intersection) is some where between \(\frac{5}{4}\) and \(\frac{3}{2}\). To find where this point is we will need to first find the function \(f(x) - g(x)\) and then find its roots. Calling this function, \(h\), we get, as we saw above, \(h(x) = -x^{4} - 2x^{3} + x + 6\). It’s graph is:
It is clear from this graph that the root is somewhere between \(\frac{5}{4}\) and \(\frac{3}{2}\), which is consistent with what we saw above from where the two functions intersect. Now all we need to do is find this root. To do so, we will use Bolzano’s Theorem and the Bisection Method for the interval \(\left[\frac{5}{4},\frac{3}{2}\right]\).
To use Bolzano’s Theorem we first have to verify the conditions: \(h(x)\) is a polynomial so we know that it is continuous in the interval,\(\left[\frac{5}{4},\frac{3}{2}\right]\), for a polynomial is continuous everywhere. Now we need to check what the signs are of the output of the function at the two endpoints of the interval. First, let’s check \(h\left(\frac{5}{4}\right)\):
\[ \begin{align} h\left(\frac{5}{4}\right) &= -\left(\frac{5}{4}\right)^{4} - 2\left(\frac{5}{4}\right)^{3} + \left(\frac{5}{4}\right) + 6 \\ \\ &= -\frac{625}{256} - 2\left(\frac{125}{64}\right) + \left(\frac{5}{4}\right) + 6 \\ \\ &= -\frac{625}{256} - \frac{1000}{256} + \frac{320}{256} + \frac{1536}{256} \\ \\ &= \frac{231}{256} \end{align} \]
Thus, \(h\left(\frac{5}{4}\right) = \frac{231}{256}\) which is positive. Next, let’s check \(h\left(\frac{3}{2}\right)\):
\[ \begin{align} h\left(\frac{3}{2}\right) &= -\left(\frac{3}{2}\right)^{4} - 2\left(\frac{3}{2}\right)^{3} + \left(\frac{3}{2}\right) + 6 \\ \\ &= -\left(\frac{81}{16}\right) - 2\left(\frac{27}{8}\right) + \left(\frac{3}{2}\right) + 6 \\ \\ &= -\frac{81}{16} - \frac{108}{16} + \frac{24}{16} + \frac{96}{16} \\ \\ &= -\frac{69}{16} \end{align} \]
Thus, \(h\left(\frac{3}{2}\right) = -\frac{69}{16}\) which is negative. Therefore, the function, \(h(x)\), evaluated at the two ends of the interval, \(\left[\frac{5}{4},\frac{3}{2}\right]\), are of opposite signs. The conditions of Bolzano’s Theorem have been met, so we are guaranteed that there is at least one root in the interval \(\left[\frac{5}{4},\frac{3}{2}\right]\).
To find it we will use the Bisection Method with a tolerance of \(\epsilon = 0.001\). This could be done by
hand, but here is the output of the bisectionMethod.R
routine:
| i | a | b | c | fOfa | fOfb | fofc | |
|---|---|---|---|---|---|---|---|
| 4 | 4 | 1.281250 | 1.312500 | 1.296875 | 0.3797903 | -0.1770172 | 0.1057500 |
| 5 | 5 | 1.296875 | 1.312500 | 1.304688 | 0.1057500 | -0.1770172 | -0.0345324 |
| 6 | 6 | 1.296875 | 1.304688 | 1.300781 | 0.1057500 | -0.0345324 | 0.0358828 |
| 7 | 7 | 1.300781 | 1.304688 | 1.302734 | 0.0358828 | -0.0345324 | 0.0007438 |
| 8 | 8 | 1.302734 | 1.304688 | 1.303711 | 0.0007438 | -0.0345324 | -0.0168771 |
| 9 | 9 | 1.302734 | 1.303711 | 1.303223 | 0.0007438 | -0.0168771 | -0.0080623 |
After 9 iterations, the root of \(h(x)\) was estimated to be \(1.303223\).
How do we interpret what this means. Recall the function, \(h(x)\), was created via the algebraic manipulation of \(f(x) = g(x)\) to be \(h(x) = f(x) - g(x)\). Thus this number is the solution to, or the root of \(h(x) = 0\), specifically in the interval \(\left[\frac{5}{4},\frac{3}{2}\right]\). But, within the context of the problem, this number represents where the outputs of the two functions, \(f(x)\) and \(g(x)\) are equal for \(x > 0\). To find what this output value actually is, we would evaluate either \(f(x)\) or \(g(x)\) at \(x = 1.303223\), though it would be good practice to evaluate both to verify that they are indeed the “same”. Let’s first evaluate \(f(x)\) at \(x = 1.303223\):
\[ \begin{align} f(1.303223) &= -(1.303223)^{4} - (1.303223)^{2} + (1.303223) + 3 \\ &= -2.884529230 - 1.698390188 + 3.303223 \\ &= -0.279696418 \end{align} \]
Now, let’s evaluate \(g(1.303223)\):
\[ \begin{align} g(1.303223) &= 2(1.303223)^{3} - (1.303223)^{2} - 3 \\ &= 2(2.213381156) - 1.698390188 \\ &= -0.271627876 \end{align} \]
The outputs of \(f(x)\) and \(g(x)\) are the “same” at \(x = 1.303223\) and that output is approximately \(-0.27\).
You may wonder why these two outputs are not exactly the same. That is because first the value of \(x = 1.303223\) was an approximation based on the Bisection Method with a tolerance of \(\epsilon = 0.001\). A stricter tolerance would have resulted in a better estimate. Second, the number \(1.303223\) is a real number accurate to only a certain number of decimal places. When used to evaluate the two functions, the error in the estimate is compounded. The more accurate the estimate, the less the error will be. This is also something you will learn more about should you take a numerical methods class.
The bottom line for us, however, is that this example showed how to find when the outputs of two functions are equal when the point of intersection was not a rational number.
So far we’ve been looking at polynomials with integer coefficients. What about a polynomial with non integer coefficients? All the theorems presented apply to these as well except for the Rational Root Theorem. In **Section ??.6*??** we discussed a solution to this situation, which we could apply. Or we can go straight to Bolzano’s theorem.
Find the real roots of \(f(x) = x^{3} - \frac{5}{3}x^{2} - \frac{1}{4}x + \frac{5}{12}\)
Solution:
This problem was already addressed **Section ??.6*??** where we discussed a solution to this problem which is a polynomial with non integer, but rational coefficients. We found the roots to be \(x = -\frac{1}{2}\), \(x = \frac{1}{2}\), and \(x = \frac{5}{3}\).
An alternative approach would have been to straight to Bolzano’s theorem. Using that approach, the first thing to do would be to take a look at the graph:
Let’s apply Bolzano’s Theorem to the first interval \([-1,0]\):
| i | a | b | c | fOfa | fOfb | fofc | |
|---|---|---|---|---|---|---|---|
| 20 | 20 | -0.5 | -0.4999981 | -0.4999990 | 0 | 4.1e-06 | 2.1e-06 |
| 21 | 21 | -0.5 | -0.4999990 | -0.4999995 | 0 | 2.1e-06 | 1.0e-06 |
| 22 | 22 | -0.5 | -0.4999995 | -0.4999998 | 0 | 1.0e-06 | 5.0e-07 |
| 23 | 23 | -0.5 | -0.4999998 | -0.4999999 | 0 | 5.0e-07 | 3.0e-07 |
| 24 | 24 | -0.5 | -0.4999999 | -0.4999999 | 0 | 3.0e-07 | 1.0e-07 |
| 25 | 25 | -0.5 | -0.4999999 | -0.5000000 | 0 | 1.0e-07 | 1.0e-07 |
The root found is \(-\frac{1}{2}\). Now, let’s apply Bolzano’s Theorem to the second interval \([0,1]\):
| i | a | b | c | fOfa | fOfb | fofc |
|---|---|---|---|---|---|---|
| 1 | 0 | 1 | 0.5 | 0.4166667 | -0.5 | 0 |
The root found is \(\frac{1}{2}\). Now, let’s apply Bolzano’s Theorem to the second interval \([1,2]\):
| i | a | b | c | fOfa | fOfb | fofc | |
|---|---|---|---|---|---|---|---|
| 20 | 20 | 1.666666 | 1.666668 | 1.666667 | -1.6e-06 | 3.2e-06 | 8e-07 |
| 21 | 21 | 1.666666 | 1.666667 | 1.666667 | -1.6e-06 | 8.0e-07 | -4e-07 |
| 22 | 22 | 1.666667 | 1.666667 | 1.666667 | -4.0e-07 | 8.0e-07 | 2e-07 |
| 23 | 23 | 1.666667 | 1.666667 | 1.666667 | -4.0e-07 | 2.0e-07 | -1e-07 |
| 24 | 24 | 1.666667 | 1.666667 | 1.666667 | -1.0e-07 | 2.0e-07 | 1e-07 |
| 25 | 25 | 1.666667 | 1.666667 | 1.666667 | -1.0e-07 | 1.0e-07 | 0e+00 |
The root found is \(\frac{5}{3}\). These roots are the same as found before.
This example showed the versatility of Bolzano’s Theorem. It can easily find rational roots as well as any non rational root.
Find the real roots of \(f(x) = \frac{1}{3}x^{3} + \frac{2}{5}x^{2} - \frac{7}{4}x - 2\)
Solution:
\(f(x) = \frac{1}{3}x^{3} + \frac{2}{5}x^{2} - \frac{7}{4}x - 2\) is a degree three polynomial which by the FTA will have three roots. They may not be all real and they may not all be unique. The FTA applies even though the coefficients are not integers. We are guaranteed that there will be at least one real root. The Rational Root Theorem does not apply here for the coefficients are not integers. So, to find a real root, we will need use Bolzano’s Theorem along with the Bisection Method to find a real root. To help narrow down the search, let’s take a look at what the graph of this function looks like:
From the graph, we see that there are three real roots between \(\left[-\frac{5}{2},-2\right]\), \(\left[-\frac{3}{2},-1\right]\), and \(\left[2,\frac{5}{2}\right]\). Let’s find the root believed to be between \(\left[2,\frac{5}{2}\right]\). To verify that there is a root in this interval, we would use Bolzano’s Theorem. This will be left as an exercise to the reader to verify. Once verified, we will use the Bisection Method to find the root.
| i | a | b | c | fOfa | fOfb | fofc | |
|---|---|---|---|---|---|---|---|
| 5 | 5 | 2.250000 | 2.281250 | 2.265625 | -0.1156250 | 0.0467387 | -0.0350939 |
| 6 | 6 | 2.265625 | 2.281250 | 2.273438 | -0.0350939 | 0.0467387 | 0.0056592 |
| 7 | 7 | 2.265625 | 2.273438 | 2.269531 | -0.0350939 | 0.0056592 | -0.0147581 |
| 8 | 8 | 2.269531 | 2.273438 | 2.271484 | -0.0147581 | 0.0056592 | -0.0045596 |
| 9 | 9 | 2.271484 | 2.273438 | 2.272461 | -0.0045596 | 0.0056592 | 0.0005472 |
| 10 | 10 | 2.271484 | 2.272461 | 2.271973 | -0.0045596 | 0.0005472 | -0.0020068 |
Thus, the root in the interval \(\left[2,\frac{5}{2}\right]\) is \(x = 2.271973\). Since this is a degree three polynomial, there are two roots left to find. We can either use the Factor Theorem to reduce this to a degree two polynomial upon which we could then use the quadratic formula, or we can use the Bisection Method to find them Let’s use the Bisection Method. First, let’s find the root believed to be in the interval \(\left[-\frac{5}{2},-2\right]\) (after verifying that there is a root here, which is left as an exercise to the reader).
| i | a | b | c | fOfa | fOfb | fofc | |
|---|---|---|---|---|---|---|---|
| 5 | 5 | -2.375000 | -2.343750 | -2.359375 | -0.0529948 | 0.0072937 | -0.0223722 |
| 6 | 6 | -2.359375 | -2.343750 | -2.351562 | -0.0223722 | 0.0072937 | -0.0074201 |
| 7 | 7 | -2.351562 | -2.343750 | -2.347656 | -0.0074201 | 0.0072937 | -0.0000335 |
| 8 | 8 | -2.347656 | -2.343750 | -2.345703 | -0.0000335 | 0.0072937 | 0.0036375 |
| 9 | 9 | -2.347656 | -2.345703 | -2.346680 | -0.0000335 | 0.0036375 | 0.0018039 |
| 10 | 10 | -2.347656 | -2.346680 | -2.347168 | -0.0000335 | 0.0018039 | 0.0008857 |
Thus, the root in the interval \(\left[-\frac{5}{2},-2\right]\) is \(x = -2.347168\). And, let’s find the third real root, the root in the interval \(\left[-\frac{3}{2},-1\right]\):
| i | a | b | c | fOfa | fOfb | fofc | |
|---|---|---|---|---|---|---|---|
| 5 | 5 | -1.125 | -1.093750 | -1.109375 | 0.0003906 | -0.0435689 | -0.0214160 |
| 6 | 6 | -1.125 | -1.109375 | -1.117188 | 0.0003906 | -0.0214160 | -0.0104689 |
| 7 | 7 | -1.125 | -1.117188 | -1.121094 | 0.0003906 | -0.0104689 | -0.0050281 |
| 8 | 8 | -1.125 | -1.121094 | -1.123047 | 0.0003906 | -0.0050281 | -0.0023160 |
| 9 | 9 | -1.125 | -1.123047 | -1.124023 | 0.0003906 | -0.0023160 | -0.0009620 |
| 10 | 10 | -1.125 | -1.124023 | -1.124512 | 0.0003906 | -0.0009620 | -0.0002855 |
Thus, the root in the interval \(\left[-\frac{3}{2},-1\right]\) is \(x = -1.124512\).
The roots, therefore, for \(f(x) = \frac{1}{3}x^{3} + \frac{2}{5}x^{2} - \frac{7}{4}x - 2\) are \(x = 2.271973\), \(x = -2.347168\), and \(x = -1.124512\). (Note, these are estimates, of course.)
So far we have been focused on polynomial functions. A question you may have is what if the function of interest is not a polynomial. This is addressed in the next section where we’ll see that though the methods used to find the roots may vary, the overall concepts of root finding process does not change.
With the exception of the Intermediate Value Theorem and Bolzano’s Theorem all the theorems discussed in this chapter have the requirement that the function for which the roots are desired must be a polynomial. The Intermediate Value Theorem and Bolzano’s Theorem also applies to functions which are not polynomials as long as the function is continuous in the interval of interest, \([a,b]\). The Bisection Method applies to any function as long as the condition \(f(a) < 0 < f(b)\) or \(f(a) > 0 > f(b)\) is met when seeking a root in \([a,b]\).
What does not change, however, are the concepts of root finding. That is, \(f(x) = 0\), \(f(x) = k\), and \(f(x) = g(x)\) are still root finding problems regardless of what type the functions are.
Concept: The concepts of root finding do not change when dealing with non polynomial functions. That is, \(f(x) = 0\), \(f(x) = k\), and \(f(x) = g(x)\) are still root finding problems regardless of what type the functions are.
To explore this idea, consider the following examples which will we look at from a root finding point-of-view. This first example is of the form \(f(x) = 0\).
Given \(f(x) = \sqrt{2x - 3}\), find when the output is zero.
Solution:
This example is asking when \(\sqrt{2x - 3} = 0\). This is a root finding problem of the form \(f(x) = 0\). We are looking for the value, or values, of \(x\) that will cause the function, \(f(x)\), to have an output of zero. Let’s find this value or values:
\[ \begin{align} f(x) &= 0 \\ \sqrt{2x - 3} &= 0 \\ \left[\left(2x - 3\right)^{1/2}\right]^{2} &= 0^{2} \\ 2x - 3 &= 0 \\ x &= \frac{3}{2} \end{align} \]
Thus \(x = \frac{3}{2}\) would cause \(f(x)\) to have zero as its output. In other words, \(x = \frac{3}{2}\) is a root.
Here is the graph of \(f(x) = \sqrt{2x - 3}\):
It is clear that \(x = \frac{3}{2}\) is when the function’s output is zero.
This example showed the concept of solving \(f(x) = 0\) for a non polynomial function. That is, to find when the function’s output is equal to zero. The next example explores a root finding problem of the form \(f(x) = k\), that is, when the output of the function is some value, \(k\).
Given \(f(x) = \sqrt{x^{2} - 5x + 4}\), find when the output is \(2\).
Solution:
This example is asking when \(\sqrt{x^{2} - 5x + 4} = 2\). This is a root finding problem of the form \(f(x) = k\). We are looking for the value, or values, of \(x\) that will cause the function, \(f(x)\), to have an output of \(2\) Let’s find this value or values, by recognizing that when given \(f(x) = k\), this becomes a root finding problem via the algebraic manipulation: \(f(x) - 2 = 0\). It is this resulting function of which we are trying to find the roots.
\[ \begin{align} f(x) &= 2 \\ \sqrt{x^{2} - 5x + 4} &= 2 \\ x^{2} - 5x + 4 &= 4 \\ x^{2} - 5x + 4 - 4 &= 0 \\ x^{2} - 5x &= 0 \end{align} \]
This resulting function, let’s call it \(g\), so \(g(x) = x^{2} - 5x\), is the function whose roots are of interest. This is a simple degree two polynomial whose roots are:
\[ \begin{align} g(x) &= 0 \\ x^{2} - 5x &= 0 \\ x(x - 5) &= 0 \\ x = 0 &\text{ or } x - 5 = 0 \\ x = 0 &\text{ or } x = 5 \end{align} \]
Thus \(x = 0\) and \(x = 5\) are the roots of \(g(x) = x^{2} - 5x\). What does this mean? These values of \(x\) are those which would cause the output of \(f(x) = \sqrt{x^{2} - 5x + 4}\) to be \(2\). The following graph shows this explicitly:
From the graph, it is clear to see that, indeed, \(f(0) = 2\) and \(f(5) = 0\).
Recall from above that we called the function that resulted from the algebraic manipulation of \(f(x) = 2\), \(g(x)\). It was found to be \(g(x) = x^{2} - 5x\) with roots \(x = 0\) and \(x = 5\). These roots of \(g(x)\) are the values of the input, \(x\), to \(f(x)\) which would cause the output of \(f(x)\) to be \(2\). That is \(f(x) = 2\). The following graph visually shows this idea.
This example showed the concept of solving \(f(x) = k\) for a non polynomial function. That is, to find when the function’s output is equal to some output value, \(k\). The next example explores a root finding problem of the form \(f(x) = g(x)\). That is, when the output of the function, \(f\), equals the output of the function, \(g\).
Find when the outputs of \(f(x) = x^{2} - 3x + 1\) and \(g(x) = 2x^{1/2} + \frac{1}{2}x^{1/3} - 3\) are equal.
Solution:
This example is asking when the output of \(f(x) = x^{2} - 3x + 1\) equals the output of \(g(x) = 2x^{1/2} + \frac{1}{2}x^{1/3} - 3\). This is a root finding problem of the form \(f(x) = g(x)\). We are looking for when the output, or outputs, of \(f(x)\) equals that of the output, or outputs, of \(g(x)\). This implies that we are looking for when the two functions intersect. To help see this, let’s look at the graph of \(f(x)\) and \(g(x)\):
From the graph there appears to be two points of intersection. One being somewhere between \(x = \frac{1}{2}\) and \(x = 1\). The other somewhere between \(x = 3\) and \(x = \frac{7}{2}\). To actually find these points of intersection of \(f(x)\) and \(g(x)\), this becomes a root finding problem of the type \(f(x) = g(x)\), which turns into \(f(x) - g(x) = 0\):
\[ \begin{align} f(x) &= g(x) \\ f(x) - g(x) &= 0 \\ x^{2} - 3x + 1 - (2x^{1/2} +\frac{1}{2}x^{1/3} - 3) &= 0 \\ x^{2} - 3x - 2x^{1/2} - \frac{1}{2}x^{1/3} + 4 &= 0 \end{align} \]
It is this function, let’s call it \(h(x)\), whose roots we need to find. Let’s look at the graph of this function:
From the graph there appears to be two roots. One being somewhere between \(x = \frac{1}{2}\) and \(x = 1\). The other somewhere between \(x = 3\) and \(x = \frac{7}{2}\). These match the region of intersection we noticed on the graph above of \(f(x)\) and \(g(x)\). It is clear that \(h(x)\) is not a polynomial, so the find, or estimate, what these roots are we will use Bolzano’s Theorem along with the Bisection Method. It if clear from the graph that the output of \(h(x)\) is of opposite signs about each root, and that the function is continuous in any potential interval about each root, so we can safely apply the theorem. With this confidence, we will use the Bisection Method with tolerance \(\epsilon = 0.001\), and first let’s find (estimate) the root in the interval \(\left[\frac{1}{2},1\right]\):
| i | a | b | c | fOfa | fOfb | fofc | |
|---|---|---|---|---|---|---|---|
| 5 | 5 | 0.7812500 | 0.8125000 | 0.7968750 | 0.0383307 | -0.0466833 | -0.0045261 |
| 6 | 6 | 0.7812500 | 0.7968750 | 0.7890625 | 0.0383307 | -0.0045261 | 0.0168145 |
| 7 | 7 | 0.7890625 | 0.7968750 | 0.7929688 | 0.0168145 | -0.0045261 | 0.0061223 |
| 8 | 8 | 0.7929688 | 0.7968750 | 0.7949219 | 0.0061223 | -0.0045261 | 0.0007926 |
| 9 | 9 | 0.7949219 | 0.7968750 | 0.7958984 | 0.0007926 | -0.0045261 | -0.0018681 |
| 10 | 10 | 0.7949219 | 0.7958984 | 0.7954102 | 0.0007926 | -0.0018681 | -0.0005381 |
Thus, the (estimate) of the root in the interval \(\left[\frac{1}{2},1\right]\) is \(x = 0.7954102\). Now, let’s (estimate) find the root in the interval \(\left[3,\frac{7}{2}\right]\):
| i | a | b | c | fOfa | fOfb | fofc | |
|---|---|---|---|---|---|---|---|
| 5 | 5 | 3.062500 | 3.093750 | 3.078125 | -0.0346920 | 0.0436677 | 0.0042303 |
| 6 | 6 | 3.062500 | 3.078125 | 3.070312 | -0.0346920 | 0.0042303 | -0.0152952 |
| 7 | 7 | 3.070312 | 3.078125 | 3.074219 | -0.0152952 | 0.0042303 | -0.0055485 |
| 8 | 8 | 3.074219 | 3.078125 | 3.076172 | -0.0055485 | 0.0042303 | -0.0006631 |
| 9 | 9 | 3.076172 | 3.078125 | 3.077148 | -0.0006631 | 0.0042303 | 0.0017826 |
| 10 | 10 | 3.076172 | 3.077148 | 3.076660 | -0.0006631 | 0.0017826 | 0.0005595 |
Thus, the (estimate) of the root in the interval \(\left[3,\frac{7}{2}\right]\) is \(x = 3.076660\).
These roots of the function, \(h(x) = x^{2} - 3x - 2x^{1/2} - \frac{1}{2}x^{1/3} + 4\) created by \(f(x) - g(x)\) are the points of intersection of \(f(x)\) and \(g(x)\). Or more specifically, they are the points which the outputs of \(f(x)\) and \(g(x)\) are equal. The following graph visually shows this idea.
The above examples showed that the concepts of root finding still apply even when the function(s) are not polynomials. The means by which the roots are found vary, and, depending on what the function is (are), some, or most, of the root finding theorems explored previously may or may not apply.
This chapter presented a root finding process which, at first glance, may seem a bit overwhelming. In particular is the application of the Rational Root Theorem. In situations where both the constant and leading coefficients are either \(1\) or prime numbers the number of possible rational roots is quite small, just two, \(\pm 1\), if they are both \(1\). But if these coefficients are such that either, or both, have many plus or minus factors, the number of possible rational roots can be quite large. It was stated that you will need to go through this entire list of possible rational roots or at least till you were able to reduce the remaining polynomial to a degree \(2\) quadratic which then can be solved by the quadratic formula. There are, however, some things you can do to help narrow the search.
The first is to look carefully at the starting coefficients of the polynomial of which you are trying to find the roots. If they are all positive, then right away you know that your first choice of a possible rational root cannot be positive. Under the multiply / add paradigm of synthetic division it is easy to see why there’s no way that a positive \(c\) can produce a zero remainder. You will be just adding a positive number to a number which is already positive.
The second thing you may want to consider is to look at the magnitude of the starting coefficients. This may help you decide what may be a good first choice of a possible rational root. Another thing to consider is the signs of the coefficients. This, too, may help you decide what may be a good first choice of a possible rational root. Other than the first suggestion (all positive coefficients), perhaps the best suggest would be to rely on your intuition. Or, as stated, just go through the list methodically.
There are, however, techniques that may help get an idea of what the signs of the roots may be. The best known, perhaps, is the Descartes’ Rule of Signs. This rule (actually a theorem) offers a way to determine the possible number of positive and negative roots by counting the number of sign changes in the coefficients. To be honest, I always found the Descartes’ Rule of Signs a bit confusing and cumbersome to use, especially for higher degree polynomials. But, that may be just me. But, I offer this to you as something you may want to investigate.
Vieta’s Formulas
I am intrigued by these formulas. They won’t help in determining what a starting possible root is, but they do give insight into the roots as a whole which may, or may not, be useful. Thus, I present them to you.
First, recall the definition of a polynomial: \(f(x) = a_{n}x^{n} + a_{n-1}x^{n-1} + a_{n-2}x^{n-2} + \cdots + a_{2}x^{2} + a_{1}x^{1} + a_{0}\). This definition clearly identifies the coefficients associated with each power of \(x\).
The first Vieta Formula is the sum of the roots, which says given a degree \(n\) polynomial with \(n\) roots \(r_{1}, r_{2}, \cdots , r_{n}\), then the sum of the roots are:
\[ \sum_{i = 1}^{n} r_{i} = \frac{-a_{n-1}}{a_{n}} \] In other words, you know what the sum of the roots of a polynomial must be. This can be useful to verify what you believe the roots are, or to determine, for example, what the last root must be. To see this rule in action, consider the degree \(3\) polynomial \(f(x) = x^{3} - 2x^{2} - 5x + 6\). The three roots are \(x = 1\), \(x = -2\), and \(x = 3\). The sum of these three roots is:
\[ \begin{align} \sum_{i = 1}^{3} r_{i} &= 1 + -2 + 3 = 2 \end{align} \]
Then, according to Vieta’s formula this should equal \(\frac{-a_{n-1}}{a_{n}}\). In this case, \(n = 3\), \(a_{n-1} = a_{3-1} = a_{2} = -2\), and \(a_{n} = a_{3} = 1\). Then:
\[ \begin{align} \frac{-a_{n-1}}{a_{n}} &= \frac{-(-2)}{1} = 2 \end{align} \]
They match! Vieta’s formula works regards of the type of the roots, real, complex or both. Consider \(f(x) = x^{3} - 2x + 4\) which has the roots \(x = -2\), $x = 1 +i $, and \(x = 1 - i\):
\[ \begin{align} \sum_{i = 1}^{n} r_{i} &= \frac{-a_{n-1}}{a_{n}} \\ -2 + (1 + i) + (1 -i) &= \frac{-(0)}{1} \\ 0 &= 0 \end{align} \]
They match. Note, than when there are complex roots the imaginary parts of the roots will always zero out for, remember, they are complex conjugates.
The second Vieta Formula is the product of the roots, which says given a degree \(n\) polynomial with \(n\) roots \(r_{1}, r_{2}, \cdots , r_{n}\), then the product of the roots are:
\[ \prod_{i = 1}^{n} r_{i} = (-1)\frac{a_{0}}{a_{n}} \]
In other words, you know what the products of the roots of a polynomial must be. To see this let’s revisit the first polynomial above, \(f(x) = x^{3} - 2x^{2} - 5x + 6\), with roots \(x = 1\), \(x = -2\), and \(x = 3\):
\[ \begin{align} \prod_{i = 1}^{3} r_{i} &= (-1)\frac{a_{0}}{a_{3}} \\ (1)(-2)(3) &= (-1)\frac{6}{1} \\ -6 &= -6 \end{align} \]
They match! Next, let’s revisit the second polynomial from above \(f(x) = x^{3} - 2x + 4\) which has a real root and two complex roots, \(x = -2\), \(x = 1 + i\), and \(x = 1 - i\):
\[ \begin{align} \prod_{i = 1}^{3} r_{i} &= (-1)\frac{a_{0}}{a_{3}} \\ (-2)(1 + i)(1 - i) &= (-1)\frac{4}{1} \\ (-2)(2) &= -4 \\ -4 &= -4 \end{align} \]
They match. Note, that when there are complex roots they will always be complex conjugates which means that their product is always a real number.
Again, Vieta’s Formulas are intriguing, at least to me, so I wanted to at least make you aware of them.
In this Why You Should Care we will explore three high level areas indicative of where root finding can play an important role within a broad spectrum of applications and purposes. These three high level areas are meant to give you a sense of how pervasive root finding is, not to mention its importance, and how it somehow always seems to pop up when least expected. The areas to be discussed here are (not in any particular priority or importance): factoring / simplification, optimization, and, though simulated, a real world example.
Factoring / Simplification
Any polynomial of any degree, especially with integer coefficients, can be factored using what was learned in this chapter. That is amazing! And, this is without having to remember any archaic rules. This idea was hinted at and explored in Example ??.18 above where it was shown how the function \(f(x) = \frac{6x^{4} + x^{3} + 4x^{2} + x - 2}{12x^{3} - 4x^{2} - 5x + 2}\) was simplified to \(f(x) = \frac{x^{2} + 1}{2x + 1}\). This is not to say that being able to recognize a perfect square or cubic can not be helpful, but I contend it is not required if you understood what was presented in this chapter.
And why should you care? Well, often by being able to factor a polynomial, it can result in the simplification of a given function which can assist in finding a solution to a given problem which might otherwise be thought unsolvable. This will prove to be a valuable skill in higher math courses, calculus just being one.
One of the first things discussed in a first level calculus course is the concept of a limit, the foundation of differential and integral calculus. It is not important to understand this concept here (it can be challenging to wrap your head around) so suffice it to say that a limit of a of a polynomial function, \(f(x)\), as \(x\) approaches a number is the the function evaluated at that number. That is, \(\lim_{x \to c} = f(c)\). Among the properties of limits the limit of a quotient:
\[ \begin{align} \lim_{x \to c} \frac{N(x)}{D(x)} &= \frac{\lim_{x \to c}N(x)}{\lim_{x \to c}D(x)} \end{align} \]
With that, consider
\[ \begin{align} \lim_{x \to -1} \frac{x^{3} + 3x^{2} - 22x -24}{x^{4} + x^{3} - 7x^{2} - x + 6} &= \frac{\lim_{x \to -1}x^{3} + 3x^{2} - 22x -24}{\lim_{x \to - 1}x^{4} + x^{3} - 7x^{2} - x + 6} \\ &= \frac{(-1)^{3} + 3(-1)^{2} - 22(-1) - 24}{(-1)^{4} + (-1)^{3} - 7(-1)^{2} - (-1) + 6} \\ &= \frac{0}{0} \end{align} \]
There’s obviously a problem here. Is the limit \(0\)? Is the limit \(\infty\)? Is the limit undefined? We don’t know. That’s why a limit result such as \(\frac{0}{0}\) is called an indeterminate limit. One method you’ll learn at the get-go is to see if you an algebraically manipulate this function to eliminate what might be causing the denominator to be zero. One way to approach this is to see if the expression can be simplified. This would require factoring the polynomial in the numerator and denominator to see if any cancellation can be one. This, then becomes a root finding problem.
Setting \(N(x) = 0\) and finding the three roots (left as an exercise to the reader to verify), will result in roots \(x = -1\), \(x = 4\), and \(x = 6\). Therefore:
\[ \begin{align} N(x) &= x^{3} + 3x^{2} - 22x -24 \\ &= (x+1)(x-4)(x+6) \end{align} \]
Doing likewise for \(D(x) = 0\), the roots are \(x - -1\), \(x = 1\), \(x = 2\) and \(x = -3\) (again, left as an exercise to the reader to verify). Therefore:
\[ \begin{align} D(x) &= x^{4} + x^{3} - 7x^{2} - x + 6 \\ &= (x+1)(x-1)(x-2)(x+3) \end{align} \]
The original limit problem now becomes:
\[ \begin{align} \lim_{x \to -1} \frac{x^{3} + 3x^{2} - 22x -24}{x^{4} + x^{3} - 7x^{2} - x + 6} &= \lim_{x \to -1} \frac{(x+1)(x-4)(x+6)}{(x+1)(x-1)(x-2)(x+3)} \\ \\ &= \lim_{x \to -1} \frac{(x-4)(x+6)}{(x-1)(x-2)(x+3)} \\ \\ &= \frac{\lim_{x \to -1} (x-4)(x+6)}{\lim_{x \to -1} (x-1)(x-2)(x+3)} \\ \\ &= -\frac{-25}{12} \end{align} \]
So, what originally seemed like an indeterminate limit has been determined to be \(-25/12\), all made possible by root finding.
Optimization
The idea of optimization is pervasive in just about any industry. That is, there’s usually something that needs to minimized or maximized. In business it might be minimizing cost while maximizing profit. In engineering it might be to maximize power generation systems. In medicine it might be to maximize patient medication systems. In statistics it might be to minimize the error in a regression model. In neural networks, AI, it might be to minimize the error in a classification model. The list goes on.
At the heart of optimization is the idea that one has a function that is designed for whatever purpose, and one wants to know where the function produces a maximum or minimum output. This is a major application of differential calculus. For the purposes here, assume there is a function, \(f(x)\), that you want to understand where its maximum or minimum output values are. To accomplish this you would find the derivative of the function which is known as \(f'(x)\). (You will learn how to find the derivative of a function in calculus.). Without going into detail, it is sufficient for us here that the derivative represents the slope of the tangent line at any point on the curve of \(f(x)\).
The idea, then, is to set \(f'(x) = 0\), a root finding problem, to find the roots. The slope of the tangent line on the curve of \(f(x)\) will be zero at this value of the root. This implies that the tangent line at this point will be a horizontal line, for he slope of a horizontal line is zero. This all means that the point of a function at which the slope of the tangent line is zero will be either a minimum or maximum of the function.
Let’s look at an example. Consider the function \(f(x) = \frac{1}{4}x^{4} - \frac{9}{3}x^{3} + \frac{23}{2}x^{2} - 15x + 8\). Looking at the graph of this function, it appears that the function has two minimum output values and one maximum output value in the interval \([0,6]\):
The challenge is to find where these points actually are, assuming they are indeed minimum or maximum output values of the function. To rise to this challenge, we need the derivative of the function, \(f(x) = \frac{1}{4}x^{4} - \frac{9}{3}x^{3} + \frac{23}{2}x^{2} - 15x + 8\). The derivative, \(f'(x)\), is \(f'(x) = x^{3} - 9x^{2} + 23x - 15\). What we need to do is find where this function, \(f'(x)\), causes the output of \(f(x)\) to be zero. That is, we need to solve \(f'(x) = 0\), which is a root finding problem. Using the techniques learned here, we find the roots to be \(x = 1\), \(x = 3\), and \(x = 5\) (left to the reader to verify). The following is the graph of \(f'(x)\) which clearly show the roots to be \(x = 1\), \(x = 3\), and \(x = 5\).
Remember that for any \(x\), \(f'(x)\) is the slope of the tangent line at that point, \(x\), on the curve of \(f(x)\). Hence, the roots of \(f'(x)\), would be where the slope of the tangent line would be zero, or horizontal. In the graph of \(f(x) = \frac{1}{4}x^{4} - \frac{9}{3}x^{3} + \frac{23}{2}x^{2} - 15x + 8\) above, we conjectured that the function has two minimum output values and one maximum output value in the interval \([0,6]\). If that was the case, then the slope of the tangent lines at these point should be \(0\), which means that they should be horizontal. The following graph will provide some insight.
The tangent lines at \(x = 1\), \(x = 3\), and \(x = 5\) are horizontal, implying that their slopes are horizontal. This means that there will be a minimum or maximum output value of the function, \(f(x) = \frac{1}{4}x^{4} - \frac{9}{3}x^{3} + \frac{23}{2}x^{2} - 15x + 8\).
The following graph shows the relationship between the roots of the derivative, \(f'(x)\), and the slopes of the tangent lines on the curve of \(f(x)\) at each of these roots and the points at which the function, \(f(x)\), has a minimum or maximum output value. As the graph shows, the roots of \(f'(x)\) correspond to where \(f(x)\) has a minimum or maximum output value. And, since the derivative, \(f'(x)\), represents the slope of the tangent line on the curve of \(f(x)\), a root of \(f'(x)\) means that the slope of the tangent line on the curve of \(f(x)\) will be zero, which is a horizontal line.
We now know that the function, \(f(x) = \frac{1}{4}x^{4} - \frac{9}{3}x^{3} + \frac{23}{2}x^{2} - 15x + 8\), has a minimum output value at \(x = 1\) and \(x = 5\), and a maximum output value at \(x = 3\). What we don’t know is what these minimum and output values are. To get what these values are all that is needed is to evaluate the function at each of these values. That is, these values would be \(f(1)\), \(f(3)\), and \(f(5)\). It is left as an exercise to the reader to find what these values are.
Root finding plays an important role in optimization. That is, by finding the roots of a function’s derivative, the locations of where the function’s output is a minimum or maximum value. (Note: The roots of a function’s derivative are also known as critical numbers. There is a nuance to consider when talking about critical numbers, however, which will be left for your calculus class, but the general idea holds, the roots of the derivative of a function’s derivative identifies where the function will have a min or max.)
A Real World Example
Though simulated, this is indeed a real world example. Suppose that it is known that the concentration of a drug in the blood stream as a function of time is given by:
\[ p(t) = 0.06484656t^{5} - 0.698878314t^{4} + 2.37688889t^{3} - 2.92915344t^{2} + 2.1542328t \]
That is, assume time \(t = 0\) is when the drug was introduced into the body, concentration of this drug over time is given by \(p(t)\). To visualize the drug the concentration in the blood, in units per mL, over time, in days, the following is the plot of \(p(t)\):
As the graph shows, the concentration of the drug in the blood stream starts as zero at time \(t = 0\), then begins to slowly rise till it reaches a maximum value, then begins to decrease as time goes on. This behavior is what is expected for a drug in the body.
There are several things a doctor may want to know, however. One might be when the concentration of the drug in blood stream reaches the maximum value. This is an optimization problems that was discussed above. To find this, we would need to know the derivative, \(p'(t)\) which is provided here:
\[ p'(t) = 0.3242328t^{4} - 2.7955136t^{3} + 7.13066667t^{2} - 5.858307t + 2.1542328 \]
The roots of this function will tell us where \(p(t)\) will have a min or a max output value. This is the root finding problem of \(p'(t) = 0\). We will have to rely on the Bisection Method to find what this root, or roots, is. Let’s take a look at the graph of \(p'(t)\) to get a sense of where these roots might be.
From the graph, it appears that the root of \(p'(t)\), is somewhere between \(t = 2.75\) and \(t = 3\). To actually find the root let’s use the Bisection Method looking for the root in the interval \([2.75,3]\) with a tolerance of \(\epsilon = 10^{-7}\). The following table shows the output of the last six iterations of the Bisection Method:
| i | a | b | c | fOfa | fOfb | fofc | |
|---|---|---|---|---|---|---|---|
| 18 | 18 | 2.866375 | 2.866377 | 2.866376 | 2.1e-06 | -4.3e-06 | -1.1e-06 |
| 19 | 19 | 2.866375 | 2.866376 | 2.866375 | 2.1e-06 | -1.1e-06 | 5.0e-07 |
| 20 | 20 | 2.866375 | 2.866376 | 2.866376 | 5.0e-07 | -1.1e-06 | -3.0e-07 |
| 21 | 21 | 2.866375 | 2.866376 | 2.866376 | 5.0e-07 | -3.0e-07 | 1.0e-07 |
| 22 | 22 | 2.866376 | 2.866376 | 2.866376 | 1.0e-07 | -3.0e-07 | -1.0e-07 |
| 23 | 23 | 2.866376 | 2.866376 | 2.866376 | 1.0e-07 | -1.0e-07 | 0.0e+00 |
The root is estimated to be \(t = 2.886376\) which means that the concentration of the drug in the blood stream reaches a maximum value at (approximately) \(3\) days after being first introduced into the body. To find what that maximum value is, should that be of interest, all that is needed is to evaluate \(p(t)\) at this value of \(t\): \(p(2.886376) = 3.454706546\) (left as an exercise to the reader to verify).
Another thing a doctor might want to know is when the concentration of the drug in the body is \(2\), for it would be unsafe to introduce more of the drug into the body when the concentration already in the body is greater than \(2\). To find this would be a root finding problem of \(p(t) = 2\). That is:
\[ \begin{align} p(t) &= 2 \\ 0.06484656t^{5} - 0.698878314t^{4} + 2.37688889t^{3} - 2.92915344t^{2} + 2.1542328t &= 2 \\ 0.06484656t^{5} - 0.698878314t^{4} + 2.37688889t^{3} - 2.92915344t^{2} + 2.1542328t - 2 &= 0 \end{align} \]
So, to find when the concentration of the drug in the bloodstream is \(2\), we need to find the solution to \(0.06484656t^{5} - 0.698878314t^{4} + 2.37688889t^{3} - 2.92915344t^{2} + 2.1542328t - 2 = 0\). Let’s see what the graph looks like to see where those roots will be:
From the graph, it appears that there are two roots of \(p(t) - 2 = 0\). One root is somewhere between \(t = 1.5\) and \(t = 2\). The second root is somewhere between \(t = 3.5\) and \(t = 4\). To actually find these roots let’s use the Bisection Method with a tolerance of \(\epsilon = 10^{-7}\). Let’s first find the estimate of the root in the interval \([1.5,2]\). The following table shows the output of the last six iterations of the Bisection Method:
| i | a | b | c | fOfa | fOfb | fofc | |
|---|---|---|---|---|---|---|---|
| 19 | 19 | 1.723438 | 1.72344 | 1.723439 | -3.2e-06 | 2e-07 | -1.5e-06 |
| 20 | 20 | 1.723439 | 1.72344 | 1.723440 | -1.5e-06 | 2e-07 | -6.0e-07 |
| 21 | 21 | 1.723440 | 1.72344 | 1.723440 | -6.0e-07 | 2e-07 | -2.0e-07 |
| 22 | 22 | 1.723440 | 1.72344 | 1.723440 | -2.0e-07 | 2e-07 | 0.0e+00 |
| 23 | 23 | 1.723440 | 1.72344 | 1.723440 | 0.0e+00 | 2e-07 | 1.0e-07 |
| 24 | 24 | 1.723440 | 1.72344 | 1.723440 | 0.0e+00 | 1e-07 | 1.0e-07 |
The root in the interval \([1.5,2]\) is estimated to be \(1.723440\). Now, let’s find the root in the interval \([3.5,4]\) again using the Bisection Method with a tolerance of \(\epsilon = 10^{-7}\). The following table shows the output of the last six iterations of the Bisection Method:
| i | a | b | c | fOfa | fOfb | fofc | |
|---|---|---|---|---|---|---|---|
| 19 | 19 | 3.789524 | 3.789526 | 3.789525 | 1e-06 | -4.6e-06 | -1.8e-06 |
| 20 | 20 | 3.789524 | 3.789525 | 3.789525 | 1e-06 | -1.8e-06 | -4.0e-07 |
| 21 | 21 | 3.789524 | 3.789525 | 3.789524 | 1e-06 | -4.0e-07 | 3.0e-07 |
| 22 | 22 | 3.789524 | 3.789525 | 3.789524 | 3e-07 | -4.0e-07 | -1.0e-07 |
| 23 | 23 | 3.789524 | 3.789524 | 3.789524 | 3e-07 | -1.0e-07 | 1.0e-07 |
| 24 | 24 | 3.789524 | 3.789524 | 3.789524 | 1e-07 | -1.0e-07 | 0.0e+00 |
The root in the interval\([3.5,4]\) is estimated to be \(3.789524\).
Here is the graph of \(p(t)\) showing the maximum concentration of the drug in the body at (roughly) \((2.9,3.45)\) and when the concentration is at a level of \(2\) (roughly), \((1.7323,2)\) and \((3.7895,2)\).
A thing to note, however, is that the concentration of the drug in the body is \(2\) at two places. Once as the concentration is increasing at time \(t = 1.72344\), and once after hitting the peak concentration level as the concentration is decreasing at time \(t = 3.7895\). It would only be safe at this point to administer more of the drug should the doctor deem it necessary. This is why it is important to always know the characteristics of the function driving these types of decisions.
We looked at three high level areas of relevance to root finding: factoring / simplification, optimization, and, though simulated, a real world example. These were chosen to give you a sense of how important root finding is. Root finding plays a critical role in a broad spectrum of industries and applications and the ability to identify that role is key. It also plays a very important role in mathematics at any level!
This is Why You Should Care!!
This is the most important chapter in the book. Your understanding of root finding is critical as it has applicability in a variety of applications and mathematical areas. In essence, there are three use cases, or contexts, where root finding plays a vital role:
A major focus in the chapter was on polynomial functions where a process for finding roots of any degree polynomial was presented. Along with this, it was seen how if knowing a root of the polynomial, one also knows a factor. This allows the factoring of polynomials beyond which are commonly seen in rote exercises. Non polynomial functions were also explored and it was seen that the concept of root finding still applies (that is, the three cases) but the means by which roots are found vary.
The exciting field on mathematics, numerical methods or analysis, was introduced via the Bisection Method. The Bisection Method is an algorithmic, iterative numerical method used to find roots of any function. It’s main use in this chapter was to find non rational roots of polynomials or roots of non polynomial functions.
To assist in root finding, a root finding process was introduced. This process relied on a number of theorems that are critical in root finding but also have applicability in higher level mathematics. The theorems discussed were:
There are a number of ways you will see the Fundamental Theorem of Algebra expressed depending on the level of formality and context. For our purposes here (consistent with where we are at mathematically), the definition of the Fundamental Theorem of Algebra, or FTA, we will be using is as follows:
Given a polynomial, \(f(x)\), with real coefficients and of degree \(n\), then there will always be \(n\) roots. The roots may not all be unique (i.e., repeated roots with some multiplicity) and roots may not be real (i.e. can be complex).
Given a polynomial, \(f(x)\), with real coefficients, if the complex number \(a + bi\) is a solution to \(f(x) = 0\) (a root), then its conjugate, \(a - bi\) is also a solution (root).
Given a polynomial, \(f(x)\), with real coefficients, when it is divided by \(x - c\), for some \(c \in \mathbb{C}\), then the remainder, \(r\), is the function evaluated at \(c\). That is, \(f(c) = r\).
Given a polynomial, \(f(x)\), with integer coefficients, then if a rational root exists, it will be in \(p/q\), where \(p\) are the plus/minus factors of the constant coefficient and \(q\) are the plus/minus coefficients of the leading coefficient.
Given a polynomial, \(f(x)\), with real coefficients and some \(c \in \mathbb{C}\), \(f(c) = 0\) \(\iff\) \((x - c)\) is a factor.
Note: \(\iff\) is the symbol for if and only if
For some function, \(f\), which is continuous in the interval \([a,b]\), \(a < b\), and for some \(k\) such that \(f(a) < k < f(b)\), then there exists a \(c \in (a,b)\) such that \(f(c) = k\). \((a,b,c,k \in \mathbb{R})\)
For some function, \(f\), which is continuous in the interval \([a,b]\) such that \(f(a) < 0 < f(b)\) or \(f(a) > 0 > f(b)\), then there exists a \(c \in (a,b)\) such that \(f(c) = 0\). \((a,b,c \in \mathbb{R})\)
In this chapter, we will look at function translation. What does it mean to do a function translation? Borrowing from geometry, a translation is the moving every point of a figure by the same distance in a given direction. Hence, a function translation is the moving of a function, point-by-point, by the exact same amount in whatever direction is desired. That is, every point \((x,y)\) on the graph of a function, \(f(x)\), gets moved to a new point \((x_{new},y_{new})\) using some rule.
Another way to think of this idea is the taking of a function as it exists in two-dimensional space and moving it in its entirety to another place in two-dimensional space. Or you can think of this way: you have a function plotted in two-dimensional space, you literally lift the function in its entirety off the plane and move it to another location in two-dimensional space. The graph of the function did not change; that is its shape, curvature etc. remains the same. The only thing that changed is where it exists in the two-dimensional plane.
CONCEPT: Function translation is the moving of a function from one location in two-dimensional space in its entirety to another location in two dimensional space.
There are two ways that a function can be translated. The first is the function can be moved up or it can be moved down in location. This is known as a vertical shift, or translation, of the function. The second is the function can be moved left or it can be moved right in location. This is known as a horizontal shift, or translation, of the function. These translations can be done individually or in combination.
Assume we have a function, \(f(x)\), which exists somewhere in two-dimensional space. To move it, or translate it to another location by applying a horizontal and/or vertical shift is accomplished via:
\[ f(x - c) + d \]
where \(c\) and \(d\) are real numbers. The \(c\) specifies the horizontal shift. The \(d\) represents the vertical shift.
CONCEPT: A function, \(f(x)\), can be translated to another location via \(f(x - c) + d\), where \(c\) is the horizontal shift and \(d\) is the vertical shift (\(c\) and \(d\) are real numbers). The two translations can be done individually and/or in combination.
We will look at each in turn.
(It should be noted that this chapter will explore the idea of taking an existing function and moving it in its entirety to a different location. We are not concerned with how the existing function came to be. Thus, things like stretches and reflections will not be discussed. These might have been involved in creating a function but are of no concern to us here. We are only concerned with translating an existing function regardless of how it was created.)
A vertical shift, or translation, is the moving of a function, in its entirety, up or down. Each point on the curve moves up or down by the same distance. In other words, for some function, \(f(x)\), the moving up or down is achieved via \(f(x) + d\), where \(d\) is a real number.
To help glean some insight into the workings of a vertical shift, let’s explore some general cases.
Consider the following graph of some function, \(f(x)\):
Now, let’s shift the function up \(4\) units. In this case, we are performing the translation of the form \(f(x) + d\) where here, \(d = 4\), i.e., \(f(x) + 4\). The graphs of \(f(x)\) and \(f(x) + 4\) are:
From the graphs of \(f(x)\) and \(f(x) + 4\) we notice a few things:
Let’s next consider another function, \(f(x)\):
Now, let’s shift the function down \(2\) units In this case, we are performing the translation of the form \(f(x) + d\) where here, \(d = -2\), i.e., \(f(x) - 2\). The graphs of \(f(x)\) and \(f(x) - 2\) are:
From the graphs of \(f(x)\) and \(f(x) - 2\) we notice a few things:
The above examples showed, within the context of a root being the x-intercept, that the roots of \(f(x)\) are not the roots of the translated function, \(f(x) + d\), where \(d\) is any real number, positive or negative. The examples were simple in that it was easy to find the roots of the translated function from looking at the graph. However, this is not always the case! We need an algebraic means to determine the roots of the translated function.
Remember that in a vertical shift, a constant, \(d\), is added to the function to produce the translated function \(f(x) + d\). The entire function is shifted up or down by \(d\) units. That means that a point \((x,f(x))\) becomes the point \((x,f(x)+d)\) on the translated function. The \(x\) coordinates remain the same. Thus, to find a root of the translated function you are looking for the point \((x,f(x))\) on \(f(x)\) that becomes \((x,f(x)+d)\) on the translated function, where \(f(x) + d = 0\). Why \(f(x) + d = 0\)? Because being a root implies that the output of a function evaluated there will be \(0\). In other words, to find a root of the translated function, \(f(x) + d\), we need to find where the output of \(f(x)\) is equal to \(-d\). Or, stated algebraically, \(f(x) = -d\). This is a root finding problem of the form \(f(x) = k\), where in this case, \(k = -d\)
CONCEPT: The finding of the roots of the translated function is a root finding problem of the form \(f(x) = k\), where in this case, \(k = -d\)
The above examples showed that there is no direct relationship between a real root of \(f(x)\) and a root of \(f(x) + d\). Knowing a root of \(f(x)\) does not translate directly into a root of \(f(x) + d\). This is all because under a vertical translation, the outputs of the translated function are different. To explicitly find the roots is the root finding problem \(f(x) = -d\). Nor is there any direct relationship among complex roots of \(f(x)\) and \(f(x) + d\). Under a vertical shift, complex roots move both horizontally and vertically within the complex plane. Remembering that a root is where the function’s output is zero, the complex roots are adjusted diagonally downward and outward along the real and imaginary axes so as to ensure that the function’s output is still zero. This is all above the scope of our intended purpose here, though some of these ideas will be explored in the exercises. The key takeaway is that there is no direct relationship between the roots of \(f(x)\) and \(f(x) + d\). To find the roots exercise the root finding problem of \(f(x) = k\), where \(k = -d\). We will see later, however, that there is a relationship between roots under a horizontal translation.
What is interesting, however, is that under a vertical translation, real roots of \(f(x)\) may become complex roots of \(f(x) + d\); or complex roots of \(f(x)\) may become real roots of \(f(x) + d\).
As a very simple example of this idea, consider a quadratic, \(f(x)\), which is concave up and has a vertex above the x-axis. It is clear that the two guaranteed roots of \(f(x)\) are complex. Now, consider the translated function, \(f(x) + d\) where \(d\) is sufficient to bring the vertex below the x-axis. The roots of the translated function, \(f(x) + d\), are now real as illustrated by:
From these observations of the functions we explored above, we can make several general conclusions for a function, \(f(x)\) being vertically shifted up or down by \(d\) units, \(f(x) + d\). These conclusions are true for any function and the vertically translated function. There are, of course, other characteristics of a function which might change but those would be unique to that particular type of function as we’ll see in some examples below.
CONCEPT: A vertical shift of a function, \(f(x)\), by some \(d\), where \(d\) is any real number, positive or negative, produces a new function, \(f(x) + d\). The effects of such a vertical translation include:
It was stated that a vertical shift of a function, \(f(x)\), by some \(d\), where \(d\) is any real number, positive or negative, produces a new translated function, \(f(x) + d\). If we let this new function be \(g(x)\), then \(g(x) = f(x) + d\), we say that the function \(g\), is related to the function \(f\) by a vertical shift of \(d\) units. This is an important idea for it can be quite useful to know that two functions are the same function just one being a translation of the other.
CONCEPT: A vertical shift of a function, \(f(x)\), by some \(d\), where \(d\) is any real number, positive or negative, produces a new translated function, \(f(x) + d\). If we let this new translated function be \(g(x)\), then \(g(x) = f(x) + d\). We say that the function \(g\), is related to the function \(f\) by a vertical shift of \(d\) units.
Let’s look at some examples of vertical translation, the first being the finding of the translated points for points on a given function.
Given \(f(x) = -x^{3} -3x^{2} + 7x + 3\) with known points on the curve \((-1,-6)\), \((0,3)\), \((1,6)\), and \((2,-3)\). Find where these points are on \(f(x) - 2\)
Solution:
Let’s first look at the graph of \(f(x)\) as a visualization of the question.
On the graph we see the existing points of interest, \((-1,-6)\), \((0,3)\), \((1,6)\), and \((2,-3)\).
The translation of \(f(x)\) represents a vertical translation since it is of the form \(f(x) + d\). In this problem, \(d = -2 < 0\) so the function is shifted down \(2\) units. To determine where the points of interest will be on the translated function, let’s first use our understanding of the effects of a vertical shift, or translation, of a function. The entire function is shifted up or down by the \(d\) in \(f(x) + d\). If \(d < 0\), each point is shifted down, \(d\) units. If \(d > 0\), each point is shifted up, \(d\) units. Thus, this allows for the determination of where any point, \((x,y)\), on \(f(x)\) will be on \(f(x) + d\). The translated point would be \((x,y+d)\).
In this problem, \(d = -2 < 0\) so the translated function is shifted down \(2\) units. Therefore, any point, \((x,y)\), on \(f(x)\) will be translated to the point \((x,y-2)\) on \(f(x) - 2\). Using this understanding we can proceed to find where the points of interest will be on the translated function, \(f(x) - 2\):
\[ \begin{align} (-1,-6) \to (-1,-6-2) &= (-1,-8) \\ (0,3) \to (0,3-2) &= (0,1) \\ (1,6) \to (1,6-2) &= (1,4) \\ (2,-3) \to (2,-3-2) &= (2,-5) \end{align} \]
In lieu of using our understanding of the effects of a vertical shift, or translation, of a function, we could have found what the translated function is and then evaluate it at each of the \(x\) coordinates of the points of interest. If we call this translated function, \(g(x)\) then:
\[ \begin{align} g(x) &= f(x) - 2 \\ &= (-x^{3} -3x^{2} + 7x + 3) - (2) \\ &= -x^{3} -3x^{2} + 7x + 1 \end{align} \]
Evaluating \(g(x)\) at each of the x-coordinates of the give points yields:
\[ \begin{align} g(1) &= -8 \\ g(0) &= 1 \\ g(1) &= 4 \\ g(2) &= -5 \end{align} \]
Thus, the translated points found using our understanding of the effects of a vertical shift, or translation, of a function and via the evaluation of the translated function at each of the \(x\) coordinates of the points of interest are the same (at they should be).
The following graph shows the function, \(f(x) = -x^{3} -3x^{2} + 7x + 3\), along with the translated function, \(f(x) - 2 = -x^{3} -3x^{2} + 7x + 1\) and the points of interest on \(f(x)\) and their respective translations.
The above example showed how using the understanding of the effects of a vertical shift of a function can be applied to understanding the relationship between points on the function and their respective translated points. This is a very useful idea.
Next, let’s look at some examples of relationship between a function and the function which is produced by doing a vertical translation.
Given \(f(x) = x^{4} - x^{3} - 4x^{2} + 2x - 4\), find the function that results from the vertical shift of \(f(x)\) up by \(6\) units.
Solution:
Let’s call the function that results from the vertical translation of \(f(x)\), \(g(x)\). Since the translation of \(f(x)\) is up by \(6\) units, then \(d = 6\). Thus, this translated function is related to \(f(x)\) by, \(g(x) = f(x) + 6\). The actual translated function is:
\[ \begin{align} g(x) &= f(x) + 6 \\ &= (x^{4} - x^{3} - 4x^{2} + 2x - 4) + 6 \\ &= x^{4} - x^{3} - 4x^{2} + 2x + 2 \end{align} \]
The graph of \(f(x)\) and \(g(x) = f(x) + 6\) is:
Given \(f(x) = \sqrt{-2x+1}\), find the function that results from the vertical shift of \(f(x)\) down by \(3\) units.
Solution:
Let’s call the function that results from the vertical translation of \(f(x)\), \(g(x)\). Since the translation of \(f(x)\) is down by \(3\) units, then \(d = -3\). Thus, this translated function is related to \(f(x)\) by, \(g(x) = f(x) - 3\). The actual translated function is:
\[ \begin{align} g(x) &= f(x) - 3 \\ &= \left(\sqrt{-2x + 1}\right) - 3\\ &= \sqrt{-2x + 1} - 3 \end{align} \]
The graph of \(f(x)\) and \(g(x) = f(x) - 3\) is:
The above examples highlighted two aspects of function translation, vertical translation in this case:
Another aspect of function translation is the determination of the characteristics of a translated function, such as domain, range, and x- and y-intercepts directly from the original function. We’ve already addressed this above. That said, however, let’s take a moment to take a further look at how the x-intercepts of the given function, \(f(x)\), are related to the x-intercepts of \(g(x) = f(x) + d\), if at all. What this really means is the understanding of how the roots of \(f(x)\) are related to the roots of \(g(x) = f(x) + d\), the translated function.
From our understanding of vertical translation we know that a root, \(x\), of \(f(x)\), which has the ordered pair, \((x,0)\), will become the point \((x,d)\) on the translated function, \(f(x) + d\). This means that a root of \(f(x)\) is not a root of \(f(x) + d\). We want to go the other way. What is the point, \((x,y)\), on \(f(x)\) that becomes the point, \((x,0)\), on \(f(x) + d\)? The answer is \((x,d)\). So, the question now is what is this \(x\)?
Recall that \(f(x) = k\) can be rewritten as \(f(x) - k = 0\), which is a root finding problem. If we let \(k = -d\), then
\[ \begin{align} f(x) &= -d \\ f(x) + d &= 0 \end{align} \]
This is our translated function! So, to find what the roots are of the translated function, we solve the root finding case of \(f(x) = -d\), which becomes \(f(x) + d = 0\). Another way to think of this is the point \((x,-d)\) on \(f(x)\) will be become the point \((x,0)\) on the translated function \(f(x) + d\).
Now that we have this understanding, let’s look at some examples of determining the characteristics of a translated function, \(f(x) + d\), directly from the original function, \(f(x)\).
Given \(f(x) = x^{2} - 4x + 4\). Consider the translated function \(f(x) - 4\). Find and state the domain, range, y-intercept, and x-intercept of both.
Solution:
Let’s first consider the given function, \(f(x) = x^{2} - 4x + 4\). This is a degree \(2\) polynomial, a quadratic to be specific. The domain of all polynomials is all real numbers, \((-\infty,\infty)\). The y-intercept is \((0,f(0)) = (0,4)\). The finding of the x-intercepts is a root finding problem of the case \(f(x) = 0\), this \(x^{2} - 4x + 4 = 0\). Using the root finding process described in Chapter ?? we would find the roots to be \(x = 2\) and \(x = 2\). Thus, the x-intercepts are \((2,0)\) and \((2,0)\). To find the range, it would be helpful to know the vertex of \(f(x)\). Using
\[ \begin{align} \left(\frac{-b}{2a},f\left(\frac{-b}{2a}\right)\right) &= \left(\frac{4}{2},f\left(\frac{4}{2}\right)\right) \\ &= \left(2,f(2)\right) \\ &= \left(2,0\right) \end{align} \]
The vertex is \((2,0)\) and since the quadratic is concave up (\(a = 1 > 0)\), the range is \([0,\infty)\).
Here’s the graph of \(f(x) = x^{2} - 4x + 4\):
Next, let’s consider the translated function, \(f(x) - 4\). We will answer the questions first using the understanding of what this translation means and the general conclusions stated above for a vertical translations. Recall that a vertical shift is given by \(f(x) + d\), where \(d\) is any positive or negative number. In this case, \(d = -4\), so this represents a vertical shift of \(f(x)\) down by \(4\) units. This means that every point on \(f(x)\) will be moved down by \(4\) units.
Since this is a vertical translation, the domain of the translated function is the same as the original function. Hence, the domain is all real numbers, or \((-\infty,\infty)\). The y-intercept will be the shift of \((0,4)\) down \(4\) to produce the y-intercept of \((0,0)\). Since this is a quadratic, the range depends on where the vertex is. Since the vertex of \(f(x)\) is \((2,0)\), the vertex of the translated function will be \((2,-4)\). Hence, the range is \([-4,\infty)\). The finding of the roots of the translated function, which may yield the x-intercepts, is a root finding problem of the form of \(f(x) = -d\), which in this case is \(f(x) = -(-4) = 4\). Using the root finding process, which in this case is quite simple:
\[ \begin{align} f(x) &= 4 \\ x^{2} - 4x + 4 &= 4 \\ x^{2} - 4x &= 0 \\ x(x - 4) &= 0 \end{align} \]
Thus the roots are \(x = 0\) and \(x = 4\). So, the x-intercepts are: \((0,0)\) and \((4,0)\).
Let’s look at the graphs of the two functions:
The conclusions made as to the characteristics of the translated function (domain, range, intercepts, and vertex) are clearly seen to be true from the graph of the original function, \(f(x)\), and the translated function, \(f(x) - 4\).
The following table summarizes these characteristics:
| \(f(x) = x^{4} - 4x + 4\) | \(f(x) - 4 = x^{4} - 4x\) | |
|---|---|---|
| Domain | \(\left(-\infty,\infty\right)\) | \(\left(-\infty,\infty\right)\) |
| Range | \([0,\infty)\) | \([-4,\infty)\) |
| y-intercept | \((0,4)\) | \((0,0)\) |
| x-intercept | \((2,0)\) and \((2,0)\) | \((0,0)\) and \((4,0)\) |
| Vertex | \((2,0)\) | \((2,-4)\) |
.
The approach taken to this problem was, where possible, to use our understanding of the effects of a vertical shift, or translation, of a function. The entire function is shifted up or down by the \(d\) in \(f(x) + d\). If \(d < 0\), each point is shifted down, \(d\) units. If \(d > 0\), each point is shifted up, \(d\) units. Thus, this allows for the determination of where any point, \((x,y)\), on \(f(x)\) will be on \(f(x) + d\). The corresponding point would be \((x,y+d)\).
This example showed how the characteristics of a translated function can be gleaned by using the understanding of how a vertical translation works. In addition, this example showed that there might be other characteristics of a function which might change but those would be unique to that particular type of function. Here, the function, \(f(x)\), was a quadratic which has a vertex. This is a key characteristic not present in other functions. Yet, once the vertex of \(f(x)\) was found, this becomes just another point on the curve. Thus, the vertex would of the translated function is the vertex of \(f(x)\) shifted down \(4\) units in this case.
Now, let’s look at another example.
Given \(f(x) = 6x^{3} + 13x^{2} + 2x - 5\). Consider the translated function \(f(x) + 3\). Find and state the domain, range, y-intercept, and x-intercept of both.
Solution:
Let’s first consider the given function, \(f(x) = 6x^{3} + 13x^{2} + 2x - 5\). This is a degree \(3\) polynomial. The domain of all polynomials is all real numbers, \((-\infty,\infty)\). The y-intercept is \((0,f(0)) = (0,-5)\). Since this is a degree \(3\) polynomial the range would also be all real numbers.
The finding of the x-intercepts is a root finding problem of the case \(f(x) = 0\), thus \(x^{2} - 4x + 4 = 0\). Using the root finding process described in Chapter ?? we would find the roots to be \(x = -\frac{5}{3}\), \(x = -1\), and \(x = \frac{1}{2}\). Thus, the x-intercepts are \(\left(-\frac{5}{3},0\right)\), \(\left(-1,0\right)\), and \(\left(\frac{1}{2},0\right)\).
Here is the graph of \(f(x) = 6x^{3} + 13x^{2} + 2x - 5\):
Next, let’s consider the translated function, \(f(x) + 3\). We will answer the questions first using the understanding of what this translation means and the general conclusions stated above for a vertical translations. Recall that a vertical shift is given by \(f(x) + d\), where \(d\) is any positive or negative number. In this case, \(d = 3\), so this represents a vertical shift of \(f(x)\) up by \(3\) units. This means that every point on \(f(x)\) will be moved up by \(3\) units.
Since this is a vertical translation, the domain of the translated function is the same as the original function. Hence, the domain is all real numbers, or \((-\infty,\infty)\). The y-intercept will be the shift of \((0,-5)\) up \(3\) to produce the y-intercept of \((0,-2)\). Since this is a degree \(3\) polynomial the range will remain all real numbers, or \((-\infty,\infty)\).
The finding of the roots of the translated function, which may yield the x-intercepts, is a root finding problem of the form of \(f(x) = -d\), which in this case is \(f(x) = -3\). Using the root finding process described in Chapter ?? we would discover that there are no rational roots. What we do know, however, is that wherever \(f(x) = -3\), those values of \(x\) will be the roots of the translated function. Let’s take another look at the graph of \(f(x) = 6x^{3} + 13x^{2} + 2x - 5\) focusing on where \(f(x) = -3\):
From the graph, we get a sense of where the roots are. There appears to that all of the guaranteed three roots are real and they fall somewhere within the intervals \(\left[-2,-\frac{3}{2}\right]\), \(\left[-1,-\frac{1}{2}\right]\), and \(\left[0,\frac{1}{2}\right]\). To find these roots, we will use the Bisection Method described in Chapter ??.
First, consider the interval \(\left[-2,-\frac{3}{2}\right]\). Here are the Bisection Method results for \(f(x) = -3\), in this interval using a tolerance of \(\epsilon = 10^{-7}\), displaying the last \(6\) iterations of the method:
| i | a | b | c | fOfa | fOfb | fofc | |
|---|---|---|---|---|---|---|---|
| 19 | 19 | -1.898634 | -1.898632 | -1.898633 | -2.45e-05 | 8.9e-06 | -7.8e-06 |
| 20 | 20 | -1.898633 | -1.898632 | -1.898632 | -7.80e-06 | 8.9e-06 | 6.0e-07 |
| 21 | 21 | -1.898633 | -1.898632 | -1.898633 | -7.80e-06 | 6.0e-07 | -3.6e-06 |
| 22 | 22 | -1.898633 | -1.898632 | -1.898633 | -3.60e-06 | 6.0e-07 | -1.5e-06 |
| 23 | 23 | -1.898633 | -1.898632 | -1.898633 | -1.50e-06 | 6.0e-07 | -5.0e-07 |
| 24 | 24 | -1.898633 | -1.898632 | -1.898633 | -5.00e-07 | 6.0e-07 | 0.0e+00 |
The Bisection Method estimated the root to be \(x = -1.898633\).
Next, consider the interval \(\left[-1,-\frac{1}{2}\right]\). Here are the Bisection Method results for \(f(x) = -3\), in this interval using a tolerance of \(\epsilon = 10^{-7}\), displaying the last \(6\) iterations of the method:
| i | a | b | c | fOfa | fOfb | fofc | |
|---|---|---|---|---|---|---|---|
| 19 | 19 | -0.5739326 | -0.5739307 | -0.5739317 | 1.6e-06 | -1.17e-05 | -5.0e-06 |
| 20 | 20 | -0.5739326 | -0.5739317 | -0.5739322 | 1.6e-06 | -5.00e-06 | -1.7e-06 |
| 21 | 21 | -0.5739326 | -0.5739322 | -0.5739324 | 1.6e-06 | -1.70e-06 | 0.0e+00 |
| 22 | 22 | -0.5739326 | -0.5739324 | -0.5739325 | 1.6e-06 | 0.00e+00 | 8.0e-07 |
| 23 | 23 | -0.5739325 | -0.5739324 | -0.5739325 | 8.0e-07 | 0.00e+00 | 4.0e-07 |
| 24 | 24 | -0.5739325 | -0.5739324 | -0.5739324 | 4.0e-07 | 0.00e+00 | 2.0e-07 |
The Bisection Method estimated the root to be \(x = -0.5739324\).
And, finally, consider the interval \(\left[0,\frac{1}{2}\right]\).. Here are the Bisection Method results for \(f(x) = -3\), in this interval using a tolerance of \(\epsilon = 10^{-7}\), displaying the last \(6\) iterations of the method:
| i | a | b | c | fOfa | fOfb | fofc | |
|---|---|---|---|---|---|---|---|
| 19 | 19 | 0.3058968 | 0.3058987 | 0.3058977 | -1.8e-05 | 4.2e-06 | -6.9e-06 |
| 20 | 20 | 0.3058977 | 0.3058987 | 0.3058982 | -6.9e-06 | 4.2e-06 | -1.3e-06 |
| 21 | 21 | 0.3058982 | 0.3058987 | 0.3058984 | -1.3e-06 | 4.2e-06 | 1.4e-06 |
| 22 | 22 | 0.3058982 | 0.3058984 | 0.3058983 | -1.3e-06 | 1.4e-06 | 1.0e-07 |
| 23 | 23 | 0.3058982 | 0.3058983 | 0.3058982 | -1.3e-06 | 1.0e-07 | -6.0e-07 |
| 24 | 24 | 0.3058982 | 0.3058983 | 0.3058983 | -6.0e-07 | 1.0e-07 | -3.0e-07 |
The Bisection Method estimated the root to be \(x = 0.3058983\).
Having found these three roots, we now know the x-intercepts of the translated function, \(f(x) + 3\), rounded to two decimal places: \((-1.89,0)\), \((-0.57,0)\), and \((0.31,0)\).
Let’s look at the graphs of the two functions which show these characteristics and relationships:
The following table summarizes these characteristics:
| \(f(x) = 6x^{3} + 13x^{2} + 2x - 5\) | \(f(x) + 3 = 6x^{3} + 13x^{2} + 2x - 2\) | |
|---|---|---|
| Domain | \(\left(-\infty,\infty\right)\) | \(\left(-\infty,\infty\right)\) |
| Range | \(\left(-\infty,\infty\right)\) | \(\left(-\infty,\infty\right)\) |
| y-intercept | \((0,-5)\) | \((0,-2)\) |
| x-intercept | \(\left(-\frac{5}{3},0\right)\), \(\left(-1,0\right)\), and \(\left(-\frac{1}{2},0\right)\), | \((-1.89,0)\), \((-0.57,0)\), and \((0.31,0)\) |
The approach taken to the above problem was, where possible, to use our understanding of the effects of a vertical shift, or translation, of a function. As expected, the finding of the x-intercepts of the translated function required the understanding that this became a root finding problem of the form \(f(x) = -d\). This is another example of the importance of the root finding process and the methods used in that process.
It should be noted that we could have found the related translated function \(g(x) = f(x) + 3\) first and then determined its characteristics directly. In some cases that might be the preferred way, in some others, may be not. The use our understanding of the effects of a vertical shift, or translation, of a function, however, solidifies that understanding which will be helpful as we move forward.
Before moving on to the exploration of a horizontal shift (translation) of a function, \(f(x)\), let’s consider two examples highlighting the idea that under a vertical shift real roots may become complex or complex roots may become real.
Given \(f(x) = x^{2} - x - 2\). Explore the roots of \(f(x)\) under the vertical shift up of \(3\).
Solution:
Let’s first look at the graph of \(f(x) = x^{2} - x - 2\).
We see that the roots of \(f(x)\) are \(x = -1\) and \(x = 2\), with the associated x-intercepts \((-1,0)\) and \((2,0)\), respectively. The vertex is at \(\left(\frac{1}{2},-\frac{9}{4}\right)\). Given that the vertical translation is \(3\) units up, or \(f(x) + 3\), we would expect the vertex to move from \(\left(\frac{1}{2},-\frac{9}{4}\right)\) to \(\left(\frac{1}{2},-\frac{9}{4} + 3\right) = \left(\frac{1}{2},\frac{3}{4}\right)\). The vertex is now above the x-axis. Since \(f(x)\) is concave up, we would expect the roots to be no longer real, but complex!
Let’s take a look at \(f(x)\) and \(f(x) + 3\):
We do indeed see the vertex has moved from \(\left(\frac{1}{2},-\frac{9}{4}\right)\) to \(\left(\frac{1}{2},-\frac{9}{4} + 3\right) = \left(\frac{1}{2},\frac{3}{4}\right)\). And, as expected, the graph of \(f(x) + 3\) does not cross the x-axis. The roots, therefore, must be complex.
Finding the roots of \(f(x) + 3\) is the root finding problem of \(f(x) = -d\), or, in this case where \(d = 3\), \(f(x) = -3\). Calling this function \(g(x) = f(x) + 3\) we get:
\[ \begin{align} g(x) &= f(x) + 3 \\ &= (x^{2} - x - 2) + 3 \\ &= x^{2} - x + 1 \end{align} \]
Using the quadratic formula to find the roots:
\[ \begin{align} x &= \frac{1 \pm \sqrt{1 - 4(1)(1)}}{2} \\ &= \frac{1 \pm \sqrt{3}i}{2} \end{align} \]
Thus, the roots are \(x = \frac{1 + \sqrt{3}i}{2}\) and \(x = \frac{1 - \sqrt{3}i}{2}\). The roots, indeed, went from being real on the function, \(f(x)\), to being complex on the translated function, \(f(x) + 3\)
Here is the complex plot which helps to visualize the real roots of \(f(x)\) becoming the complex roots of the translated function, \(f(x) + 3\):
This example showed that the possibility that real roots of a function, \(f(x)\), may become complex roots of the vertically translated function, \(f(x) + d\). Let’s consider another example.
Given \(f(x) = x^{2} - 4x + 5\). Explore the roots of \(f(x)\) under the vertical shift down of \(2\).
Solution:
Let’s first look at the graph of \(f(x) = x^{2} - 4x + 5\).
We see that there are no x-intercepts, which makes sense since the vertex, \((2,1)\) is above the x-axis and the quadratic is concave up. This implies, therefore, that there are no real roots, they must be complex. Let’s use the quadratic formula to find the roots:
\[ \begin{align} x &= \frac{4 \pm \sqrt{16 - 4(1)(5)}}{2} \\ &= \frac{4 \pm \sqrt{-4}}{2} \\ &= 2 \pm i \end{align} \]
Yes, the two roots, \(x = 2 + i\) and \(x = 2 - i\) are, indeed, complex.
Given that the vertical translation is \(2\) units down, or \(f(x) - 2\), we would expect the vertex to move from \(\left(2,1\right)\) to \(\left(2,1-2\right) = \left(2,-1\right)\). The vertex is now below the x-axis. Since \(f(x)\) is concave up, we would expect the roots to be no longer complex, but real!
Let’s take a look at \(f(x)\) and \(f(x) - 2\):
We do indeed see the vertex has moved from \(\left(2,1\right)\) to \(\left(2,1-2\right) = \left(2,-1\right)\). And, as expected, the graph of \(f(x) - 2\) does cross the x-axis. The roots, therefore, must be real.
Finding the roots of \(f(x) - 2\) is the root finding problem of \(f(x) = -d\), or, in this case where \(d = -2\), \(f(x) = 2\). Calling this function \(g(x) = f(x) - 2\) we get:
\[ \begin{align} g(x) &= f(x) - 2 \\ &= (x^{2} - 4x + 5) - 2 \\ &= x^{2} - 4x + 3 \end{align} \]
Using the quadratic formula to find the roots:
\[ \begin{align} x &= \frac{4 \pm \sqrt{16 - 4(1)(3)}}{2} \\ &= \frac{4 \pm \sqrt{4}}{2} \\ &= 2 \pm 1 \end{align} \]
Thus, the roots are \(x = 3\) and \(x = 1\). Thus, the x-intercepts are \((1,0)\) and \((3,0)\) as the above graph of \(f(x) - 2\) showed. More importantly, however, the roots, indeed, went from being complex on the function, \(f(x)\), to being real on the translated function, \(f(x) - 2\).
Here is the complex plot which helps to visualize the complex roots of \(f(x)\) becoming the real roots of the translated function, \(f(x) - 2\):
This example showed that the possibility that complex roots of a function, \(f(x)\), may become real roots of the vertically translated function, \(f(x) + d\).
And, now, let’s look at the shifting of a function horizontally.
A horizontal shift, or translation, is the moving of a function, in its entirety, left or right. Each point on the curve moves left or right by the same distance. For some function, \(f(x)\), the moving left or right is achieved via \(f(x - c)\), where \(c\) is a real number.
The specification of a horizontal shift, \(f(x - c)\), is quite different than that of a vertical shift. Recall that a vertical shift of some function, \(f(x)\), is defined as \(f(x) + d\). This is relatively easy to understand. For any given \(x\), within the domain of \(f(x)\), of course, which is the input to \(f(x)\) is still the input fed into the translated function. What changes, or the difference between the original function and the translated function, is the output. The mapping of the original function, \((x,f(x))\), now becomes the mapping \((x,f(x)+d)\). Or, if you prefer, \((x,y)\) becomes \((x,y+d)\). This reflects the idea that the original function, in its entirety, is shifted, or raised, up or down depending on the value of \(d\). If \(d > 0\), up; if \(d < 0\), down.
Now, let’s take a look at the specification of a horizontal shift, \(f(x - c)\). Where did this come from and how do we interpret it? To begin to answer these questions, we need to remember that a horizontal shift moves the function in its entirety left or right by \(c\) units. What this means is that the input to the original function, \(f(x)\), is different than the input to the translated function. What was \(x\) is now \(x - c\). The mapping of the original function, \((x,f(x))\), now becomes the mapping \((x-c,f(x-c))\). However, since the original function is just shifted left or right, the outputs of the two functions are the same. That is, \(f(x) = f(x -c)\). This is the important idea of a horizontal shift. The mapping of the original function, \((x,f(x))\), now becomes the mapping \((x-c,f(x))\). Or, if you prefer, \((x,y)\) becomes \((x-c,y)\).
CONCEPT: The output values of the function, \(f(x)\), and the associated translated function, \(f(x - c)\), are the same. The inputs which map to these same outputs are different.
Now that we understand this, assume a value of a given \(x\) produced the output \(f(x)\) and assume a horizontal shift right. The given \(x\) would now become \(x + c\), which is bigger. If we were to evaluate the function \(f\) at this new input, we would get a different output, which we said above cannot happen. To ensure that the new point, \(x + c\), produces the same input, we must subtract \(c\) from the input. In other words, to ensure that the outputs remain the same, the inputs must be the same. Therefore, moving \(x\) right by \(c\) yields \(x + c\), so we need to correct this by \(x + c - c\). Hence, \(f(x - c)\) represents the horizontal shift of \(f(x)\) to the right \(c\) units.
A similar argument can be made if the shift was to the left. The point \(x\) now becomes \(x - c\), which is smaller. We correct this by adding \(c\). Hence, \(f(x + c)\) represents the horizontal shift of \(f(x)\) to the left \(c\) units.
This seems a bit counter intuitive. Looking at \(f(x - c)\) and \(f(x + c)\) one might intuit that the former is a shift left since the \(c\) is being subtracted, and the latter is a shift right since the \(c\) is being added. No, it is the opposite.
The reconciliation of this seemingly paradoxical interpretation is not only the above argument (which is key) but to think of it this way. The standard notation for a horizontal shift if \(f(x - c)\). If we think of the parameter, \(c\), as having both magnitude (amount of the shift) and direction (negative for left or positive for right), then if \(c\) > 0, \(f(x - c)\) is a horizontal shift right by \(c\) units. If \(c < 0\), then \(f(x - c) = f(x + c)\) is a horizontal shift left by \(c\) units.
CONCEPT: A horizontal shift/translation of a function \(f(x)\) is given by \(f(x - c)\). If \(c\) > 0 then \(f(x - c)\) is a horizontal shift right by \(c\) units. If \(c < 0\) then \(f(x - c) = f(x + c)\) is a horizontal shift left by \(c\) units.
To help glean some insight into the workings of a horizontal shift, let’s explore some general cases.
Consider the following graph of some function, \(f(x)\), and the function shifted right \(3\) units:
From the graphs of \(f(x)\) and \(f(x - 3)\) we notice a few things:
Let’s consider a second function, \(f(x)\), and the function shifted left \(2\) units, \(f(x - 3)\)
From the graphs of \(f(x)\) and \(f(x + 2)\) we notice a few things:
Next, let’s consider a third function, \(f(x)\), and the function shifted right \(4\) units, \(f(x - 4)\)
From the graphs of \(f(x)\) and \(f(x - 4)\) we notice a few things:
As some of these graphs of functions and their respective translations showed, sometimes it is not readily apparent what the y-intercept of the translated function will be. The reason for this is simple: In the above cases we were asking the question, given a point on \(f(x)\) where would that point be on the translated function. We did that for the y-intercepts of \(f(x)\) above. That told us where the point \((0,y)\) ended up on the translated function, it did not tell us anything about what the y-intercept is for the translated function.
As far as what the y-intercept would be for the translated function, we were asking the wrong question. The question is what is the point on \(f(x)\), \((x,y)\), which, under the horizontal translation would have its \(x\) coordinate be \(0\). The challenge is to find this \(x\), which is relatively straightforward. We know that the translated point would have an x-coordinate of \(x + c\). We also know that if this point is to be the y-intercept of the translated function, the translated x-coordinate has to be \(0\). Said another way: \(x + c = 0\). Solving for \(x\) we get \(x = -c\). Thus the point on \(f(x)\) is \((-c,f(-c))\). Since any point on \(f(x)\), when horizontally translated, has the same y-coordinate, and since this point when translated would have an x-coordinate of \(0\), the y-intercept of the translated function, \(f(x - c)\), is \((0,f(-c))\).
CONCEPT: The y-intercept of the translated function, \(f(x - c)\), is \((0,f(-c))\)
Let’s see a quick example. Suppose we have two functions, \(f(x) = x^{3} - 2x^{2} - x + 2\) and \(g(x) = x^{3} - 14x^{2} + 63x - 90\). It is clear that \((0,2)\) is the y-intercept of \(f(x)\). It is also clear that \((0,-90)\) is the y-intercept of \(g(x)\). Let’s assume that \(f(x)\) is translated \(4\) units to the right. The translated function is \(f(x - 4)\). The y-intercept of the translated function should be \((0,f(-c))\), which in this case since \(c = 4\) should be \((0,f(-4))\). Finding \(f(-4)\):
\[ \begin{align} f(-4) &= (-4)^{3} - 2(-4)^{2} - (-4) + 2 \\ &= -64 - 2(16) + 4 + 2 \\ &= -64 - 32 + 6 \\ &= -96 + 6 \\ &= -90 \end{align} \]
Thus, the y-intercept is \((0,-90)\). It turns out that \(g(x)\), which was seen above to have a y-intercept of \((0,-90)\), is \(f(x - 4)\). That is \(f(x - 4) = x^{3} - 14x^{2} + 63x - 90\) and its y-intercept is \((0,-90)\). This is what was found from \((0,f(-4))\).
And, finally, let’s consider a fourth example but this time the focus will be the effect of a horizontal shift on the roots of the translated function. From our discussion of root finding in Chapter ??, when we talk about roots we are interested in where the output of the function is \(0\). For any real root, this would also coincide with where the function crosses the x-axis, the x-intercept. This would imply, therefore, that a root of a translated function, \(f(x - c)\), in the real plane is just the root of \(f(x)\) horizontally shifted left or right, depending on \(c\). However, what about any roots that are complex? Normally we wouldn’t be concerned about these for, in general, function translation is real plane focused. But here we are concerned for the complex roots are also where the output of the function is \(0\). This adds an added level of complexity, no pun intended.
So, let’s consider a degree \(3\) function, \(f(x)\) shifted left \(2\) units, \(f(x + 2)\).
Focusing only on the roots of the functions, we see that \((1,0)\) is a root of \(f(x)\). It is also the x-intercept. From what we’ve gleaned of a horizontal translation, since \(c = -2\) we would expect this x-intercept point (a.k.a., the root) to be shifted left by \(2\) units to become \((-1,0)\). The graph shows this to be true.
However, since \(f(x)\) is of degree \(3\), we know that there are guaranteed to be \(3\) roots, one of which must be real. Since the graph indicates that there is only one real root, the other two must be complex. These other two roots would be \(x = a + bi\) and \(x = a - bi\). We have seen that a real root of \(f(x)\) horizontally shifted left or right, depending on \(c\), becomes a root of the translated function, \(f(x - c)\). To see the relationship, if any, of the complex roots of \(f(x)\) and the translated function, consider the following graph of some function, \(f(x)\), and the translated function \(f(x + 2)\) (i.e., \(f(x)\) shifted \(2\) units to the left)
The graph shows the relationship of the real root is what is expected, horizontally shifted by \(2\) to the left. Without going into all the details (they may be beyond the scope here), it turns out that there is a relationship between the complex root. Recall that a complex number, \(a + bi\), has a real part, \(a\), and an imaginary part, \(bi\). The real part is adjusted by \(c\), the complex part remains the same. That is, the complex root, \(a + bi\), becomes the root, \((a + c) + bi\), on the translated function, \(f(x - c)\).
Unlike what we saw for a vertical transformation where there was no relationship between the roots, including complex roots, of \(f(x)\) and the vertically translated function, \(f(x) + d\), there is a relationship between the roots, real and complex, of \(f(x)\) and the horizontally translated function, \(f(x - c)\). Also, unlike what we saw for a vertical transformation where real roots may become complex roots, and vice versa, real roots of \(f(x)\) remain real roots of the translated function, \(f(x - c)\); complex roots of \(f(x)\) remain complex roots of the translated function, \(f(x - c)\).
CONCEPT: In a horizontal shift, the real roots of \(f(x)\) remain real roots, complex roots remain complex roots. A real root, \(x\) of \(f(x)\) becomes the real root \(x + c\) of \(f(x - c)\). A complex root, \(a + bi\), of \(f(x)\) becomes the complex root, \((a + c) + bi\), of \(f(x - c)\).
From these observations of the functions we explored above, we can make several general conclusions for a function, \(f(x)\) being horizontally shifted left or right by \(c\) units, \(f(x - c)\). These conclusions are true for any function and the horizontally translated function. There are, of course, other characteristics of a function which might change but those would be unique to that particular type of function as we’ll see in some examples below.
CONCEPT: A horizontal shift of a function, \(f(x)\), by some \(c\), where \(c\) is any real number, positive or negative, produces a new function, \(f(x - c)\). The effects of such a horizontal translation include:
It was stated that a horizontal shift of a function, \(f(x)\), by some \(c\), where \(c\) is any real number, positive or negative, produces a new translated function, \(f(x - c)\). If we let this new function be \(g(x)\), then \(g(x) = f(x - c)\), we say that the function \(g\), is related to the function \(f\) by a horizontal shift of \(c\) units. This is an important idea for it can be quite useful to know that two functions are the same function just one being a translation of the other.
CONCEPT: A horizontal shift of a function, \(f(x)\), by some \(c\), where \(c\) is any real number, positive or negative, produces a new translated function, \(f(x - c)\). If we let this new translated function be \(g(x)\), then \(g(x) = f(x - c)\). We say that the function \(g\), is related to the function \(f\) by a horizontal shift of \(c\) units.
Let’s look at some examples of horizontal translation, the first being the finding of the translated points for points on a given function.
Given \(f(x) = x^{2} - 2x + 2\) with known points on the curve \((0,2)\), \((1,1)\), and \((2,2)\). Find where these points are on \(f(x - 1)\). Also, determine the y-intercept of the translated function.
Solution:
Let’s first look at the graph of \(f(x)\) as a visualization of the question.
On the graph we see the existing points of interest, \((0,2)\), \((1,1)\), and \((2,2)\).
The translation of \(f(x)\) represents a horizontal translation since it is of the form \(f(x - c)\). In this problem, \(c = 1 > 0\) so the function is shifted right \(1\) unit. To determine where the points of interest will be on the translated function, let’s first use our understanding of the effects of a horizontal shift, or translation, of a function. The entire function is shifted left or right by the \(c\) in \(f(x - c)\). If \(c < 0\), each point is shifted left, \(c\) units. If \(c > 0\), each point is shifted right, \(c\) units. Thus, this allows for the determination of where any point, \((x,y)\), on \(f(x)\) will be on \(f(x - c)\). The translated point would be \((x+c,y)\) (note that the y coordinate, or the output of \(f(x)\), remains the same).
In this problem, \(c = 1 > 0\) so the translated function is shifted right \(1\) unit. Therefore, any point, \((x,y)\), on \(f(x)\) will be translated to the point \((x+1,y)\) on \(f(x -1)\). Using this understanding we can proceed to find where the points of interest will be on the translated function, \(f(x - 1)\):
\[ \begin{align} (0,2) \to (0+1,2) &= (1,2) \\ (1,1) \to (1+1,1) &= (2,1) \\ (2,2) \to (2+1,2) &= (3,2) \end{align} \]
To find the y-intercept of the translated function, recall that we are looking for the point \((x,y)\) on \(f(x)\) which when translated right by \(1\) unit, in this example, results in the x-coordinate being \(0\). As was showed above, this point is \((-c,f(-c))\). Since \(c = 1\) here, the point is \((-1,f(-1))\). Evaluating \(f(x)\) at \(x = -1\):
\[ \begin{align} f(-1) &= (-1)^{2} - 2(-1) + 2 \\ &= 1 + 2 + 2 \\ &= 5 \end{align} \]
Thus point on \(f(x)\), \((-1,5)\), which when translated via the horizontal shift of \(c = 1\)
\[ (-1,5) \to (-1+1,5) = (0,5) \]
becomes the y-intercept of the translated function.
The following graph shows the function, \(f(x) = x^{2} - 2x + 2\), along with the translated function, \(f(x - 1)\) and the points of interest on \(f(x)\) and their respective translations. The point on \(f(x)\), \((-1,5)\), which when translated, becomes the y-intercept of \(f(x - 1)\), \((0,5)\), is also shown.
This example showed what’s involved in determining the y-intercept. The point \((-c,f(-c))\) on \(f(x)\) is the point which gets translated to \((0,f(-c))\) on \(f(x - c)\).
Now, let’s look at the relationship between a function and the function which results from a horizontal translation.
Given \(f(x) = x^{4} - x^{3} - 4x^{2} + 2x - 4\), find the function that results from the horizontal shift of \(f(x)\) right by \(3\) units.
Solution:
Let’s call the function that results from the horizontal translation of \(f(x)\), \(g(x)\). Since the translation of \(f(x)\) is right by \(3\) units, then \(c = 6\). Thus, this translated function is related to \(f(x)\) by, \(g(x) = f(x - 3)\). The actual translated function is:
\[ \begin{align} g(x) &= f(x - 3) \\ &= (x-3)^{4} - (x-3)^{3} - 4(x-3)^{2} + 2(x-3) - 4 \\ &= (x^{4} - 12x^{3} + 54x^{2} - 108x + 81) - (x^{3} -9x^{2} + 27x - 27) - (4x^{2} - 24x + 36) + (2x - 6) - 4 \\ &= x^{4} - 13x^{3} + 59x^{2} - 109x + 62 \end{align} \]
The graph of \(f(x)\) and \(g(x) = f(x - 3)\) is:
Given \(f(x) = \sqrt{3x + 2}\), find the function that results from the horizontal shift of \(f(x)\) left by \(3\) units.
Solution:
Let’s call the function that results from the horizontal translation of \(f(x)\), \(g(x)\). Since the translation of \(f(x)\) is left by \(3\) units, then \(c = -3\). Thus, this translated function is related to \(f(x)\) by, \(g(x) = f(x + 3)\). The actual translated function is:
\[ \begin{align} g(x) &= f(x + 3) \\ &= \sqrt{3(x+ 3)+2} \\ &= \sqrt{3x + 11} \end{align} \]
The graph of \(f(x)\) and \(g(x) = f(x + 3)\) is:
Given \(g(x) = x^{3} + 5x^{2} + 9x + 3\), you know that it is a horizontal translated function of some other function, \(f(x)\), via a shift left of \(2\) units. Find \(f(x)\).
Solution:
From the given information we know that \(g(x) = f(x + 2)\), the function \(f(x)\), shifted left by \(2\) units. That means that the functions \(g\) and \(f\) are related by the horizontal shift of \(2\) units. Knowing that \(g\) is left of \(f\) by \(2\) units means, therefore, that \(f\) is right of \(g\) by \(2\) units. Thus, \(f\) is related to \(g\) by \(f(x) = g(x - 2)\). We can do the algebra to find \(f(x)\):
\[ \begin{align} f(x) &= g(x - 2) \\ &= (x - 2)^{3} + 5(x - 2)^{2} + 9(x - 2) + 3 \\ &= (x^{3} - 6x^{2} + 12x - 8) + (5x^{2} - 20x + 20) + (9x - 18) + 3 \\ &= x^{3} - x^{2} + x - 3 \end{align} \]
Thus, \(f(x) = x^{3} - x^{2} + x - 3\) and the two functions are related via: \(g(x) = f(x+2)\) and \(f(x) = g(x - 2)\),
The graph of \(f(x) = g(x - 2)\) and \(g(x) = f(x+2)\) is:
And now, let’s look at some examples of determining the characteristics of a translated function, \(f(x - c)\), directly from the original function, \(f(x)\).
Given \(f(x) = x^{4} - 2x^3 + x^2 + 2x - 2\) which undergoes the horizontal translation, \(f(x - 3)\). Find the domain, range, y-intercept, x-intercept, and the roots of \(f(x)\) and \(f(x - 3)\).
Solution:
Let’s first look at the graph of \(f(x)\) as a visualization of the question.
Since \(f(x)\) is a polynomial its domain it all real numbers, \((-\infty,\infty)\). The y-intercept if \((0,-2)\). Using the root finding process from Chapter ??, we find the roots to be \(x = -1\), \(x = 1\), \(x = 1 + i\), and \(x = 1 - i\). Thus, the x-intercepts are \((-1,0)\) and \((1,0)\). From the graph, the range is estimated to be \([\approx -2.5,\infty)\). (Note: The Range was actually found to be \([-2.486415,\infty)\) by finding the derivative of \(f(x)\), then setting the derivative equal to \(0\) and using the Bisection Method on \([-1,0]\)).
Using our understanding of a horizontal translation, which in this case is \(f(x - 3)\), or \(f(x)\) shifted \(3\) units to the right, let’s determine what the associated characteristics are expected to be for \(f(x - 3)\).
Though the domain of \(f(x - 3)\) could be different from that of \(f(x)\) under a horizontal translation, in this case the domain of \(f(x)\), \((-\infty,\infty)\), is also the domain of \(f(x - 3)\) for it, too, is still a polynomial.
Under a horizontal translation, the range of \(f(x)\) is also the range of \(f(x - 3)\) which is \([\approx -2.5,\infty)\).
Under a horizontal translation, the y-intercept of \(f(x - c)\) is the point \((0,f(-c))\), where in this case, \(c = 3\). Evaluating \(f(-3)\):
\[ \begin{align} f(-3) &= (-3)^{4} - 2(-3)^{3} + (-3)^{2} + 2(-3) - 2 \\ &= 81 + 54 + 9 - 6 - 2 \\ &= 136 \end{align} \]
Thus, the y-intercept of \(f(x - 3)\) is \((0,136)\).
Under a horizontal translation, the real roots of \(f(x)\) are shifted by \(c\) and the real part of any complex roots are shifted by \(c\), the imaginary part remains the same. Thus:
\[ \begin{align} x = -1 &\to x = -1 + 3 = 2 \\ x = 1 &\to x = 1 + 3 = 4 \\ x = 1 + i &\to x = (1+3) + i = 4 + i \\ x = 1 - i &\to x = (1+3) - i = 4 - i \end{align} \]
From these roots we have the x-intercepts of \(f(x - 3)\) to be \((2,0)\) and \((4,0)\)
Here is the graph of \(f(x)\) and \(g(x) = f(x-3)\) along with showing the translation of the x-intercepts (real roots). The y-intercept of \(f(x)\) is also shown, but the point \((0,136)\) is too high for the current scale. The expected characteristics based on our understanding of a horizontal translation are the same as what the graph shows!
The following table summarizes these characteristics:
| \(f(x)\) | \(f(x - 3)\) | |
|---|---|---|
| Domain | \(\left(-\infty,\infty\right)\) | \(\left(-\infty,\infty\right)\) |
| Range | \([\approx -2.5,\infty)\) | \([\approx -2.5,\infty)\) |
| y-intercept | \((0,-2)\) | \((0,136)\) |
| x-intercept | \((-1,0)\) and \((1,0)\) | \((2,0)\) and \((4,0)\) |
.
Here is the visualization of the roots of \(f(x)\), both real and complex, and how the effect of the horizontal translation to determine the roots of \(f(x - 3)\)
It should be pointed out that once the characteristics of \(f(x)\) were found, the characteristics of the translated function, \(f(x - 3)\), were found based only on our understanding of a horizontal translation. The actual related function, \(g(x) = f(x -3)\), was not found at all.
For completeness, let’s find \(g(x) = f(x -3)\):
\[ \begin{align} f(x - 3) &= (x - 3)^{4} - 2(x - 3)^{3} + (x - 3)^{2} + 2(x - 3) - 2 \\ &= x^{4} - 14x^{3} + 73x^{2} - 166x + 136 \end{align} \]
Using this function \(f(x - 3) = x^{4} - 14x^{3} + 73x^{2} - 166x + 136\) independently to find its characteristics we would find that they match that which were derived exclusively using our knowledge of a horizontal translation. (Left as an exercise to the reader to independently find the characteristics of \(f(x - 3) = x^{4} - 14x^{3} + 73x^{2} - 166x + 136\).)
Note: This example was thoroughly reviewed in the Appendix Function Translation.
Let’s revisit the function, \(f(x) = \sqrt{3x + 2}\), seen in Example ??.10. This function is a square root function, so let’s see the application of our understanding of a horizontal translation on a non polynomial function.
Given \(f(x) = \sqrt{3x + 2}\) which undergoes the horizontal translation, \(f(x + 3)\). Find the domain, range, y-intercept, x-intercept, and the roots of \(f(x)\) and \(f(x + 3)\).
Solution:
Let’s first look at the graph of \(f(x)\) as a visualization of the question.
The domain of \(f(x) = \sqrt{3x + 2}\), found by solving \(\sqrt{3x + 2} = 0\), is \(\left[-\frac{2}{3},\infty\right)\). The range of \(f(x)\) as seen from the graph is \((0,\infty)\). The y-intercept is \((0,\sqrt{2})\). The root, of \(f(x)\), found by solving \(f(x) = 0\), is \(x = -\frac{2}{3}\). Thus, the x-intercept of \(f(x)\) is \(\left(-\frac{2}{3},0\right)\).
Using our understanding of a horizontal translation, which in this case is \(f(x + 3)\), or \(f(x)\) shifted \(3\) units to the left, let’s determine what the associated characteristics are expected to be for \(f(x + 3)\).
The first thing to note is that the root will be translated \(3\) units to the left. The root \(x = -\frac{2}{3}\), therefore, will become:
\[ \begin{align} -\frac{2}{3} - 3 &= -\frac{2}{3} - \frac{9}{3} \\ &= -\frac{11}{3} \end{align} \]
Thus the root is \(x = -\frac{11}{3}\). This also gives us the x-intercept, \(\left(-\frac{11}{3},0\right)\), and also tells us the domain, \(\left[-\frac{11}{3},\infty\right)\).
To find the y-intercept, we know that it will be \((0,f(-c))\) or, in this case \((0,f(3))\), since \(c = -3\). This results in the y-intercept of \((0,\sqrt{11})\).
We now have the characteristics of both functions which the following table summarizes:
| \(f(x)\) | \(f(x +3)\) | |
|---|---|---|
| Domain | \(\left[-\frac{2}{3},\infty\right)\) | \(\left[-\frac{11}{3},\infty\right)\) |
| Range | \([0,\infty)\) | \([0,\infty)\) |
| y-intercept | \((0,\sqrt{2})\) | \((0,\sqrt{11})\) |
| x-intercept | \(\left(-\frac{2}{3},0\right)\) | \(\left(-\frac{11}{3},0\right)\) |
| Roots | \(-\frac{2}{3}\) | \(-\frac{11}{3}\) |
.
Using this function \(f(x +3) = \sqrt{3x+11}\) independently to find its characteristics we would find that they match that which were derived exclusively using our knowledge of a horizontal translation. (Left as an exercise to the reader to independently find the characteristics of \(f(x +3) = \sqrt{3x+11}\).)
This example involved a non polynomial function. The principles of horizontal translation still apply.
And now, let’s look at a combined translation. That is a function, \(f(x)\), undergoing both a horizontal and vertical translation, \(f(x - c) + d\).
In the above two sections we explored function translations, first a vertical translation, then a horizontal translation. In each case we studied the effects each translation had on the original function, \(f(x)\), in terms of a particular point on the curve, the domain, range, roots, and other function characteristics. In this section we will take a look at what happens when both of these translations take place. That is, given a function, \(f(x)\), \(f(x - c) + d\) represents the function after undergoing a horizontal shift by \(c\) units left or right and a vertical shift by \(d\) units up or down.
First, it is worth repeating, and should not be forgotten, that, just like a horizontal or vertical shift, the net effect here is that original function, \(f(x)\), was translated, or moved, in its entirety, to another location in two dimensional space. Thus a horizontal and vertical translation does not effect the shape of the function being translated. The shifted function maintains the shape of the original function.
CONCEPT: A function, \(f(x)\), can be translated, in its entirety, to another location in two dimensional space via \(f(x - c) + d\), where \(c\) is the horizontal shift and \(d\) is the vertical shift (\(c\) and \(d\) are real numbers).
Looking at \(f(x - c) + d\) and applying what we learned from the study of a horizontal and vertical shift individually, it is clear that a point, \((x,y)\), on \(f(x)\) will become the point, \((x+c,y+d)\), on the translated function.
CONCEPT: A point, \((x,y)\), on \(f(x)\) will become the point, \((x+c,y+d)\), on the translated function, \(f(x - c) + d\)
It is also true that when translating a function both horizontally and vertically, the order of how the translations are applied does not matter. The function can be first translated horizontally and then that translated function shifted vertically. Or, the function can be first translated vertically and then that translated function shifted horizontally. In other words, the order of how the translations are applied does not matter.
CONCEPT: A function, \(f(x)\), undergoing both a horizontal and vertical translation can be first translated horizontally and then that translated function shifted vertically. Or, the function can be first translated vertically and then that translated function shifted horizontally. The order of how the translations are applied does not matter.
To understand the characteristics of the resultant translated function, \(f(x - c) + d\), the lessons learned from the study of each type of translation, horizontal or vertical, must be combined. Domains might change, ranges might change, etc. How they change is determined by the combination of the effects of each translation.
These are the three new insights of \(f(x - c) + d\), a horizontally and vertically translated function:
Our study of \(f(x - c) - d\) will be via the following examples.
Given \(f(x) = x^{2} - 4x + 5\) which undergoes a translation of \(2\) units to the right and \(3\) units down, determine where the point \((2,1)\), the vertex, will be on the translated function by first applying the vertical translation and then the horizontal translation.
Solution:
A translation of \(f(x)\) both horizontally and vertically is of the form \(f(x - c) + d\), where \(c\) represents the horizontal shift and \(d\) represents the vertical shift. In this example \(c = 2\) since \(f(x)\) is being shifted \(2\) units to the right; \(d = -3\) since \(f(x)\) is being shifted \(3\) units down. Thus, the translation is \(f(x - 2) - 3\).
From our understanding of the translation of \(f(x - c) + d\), a point, \((x,y)\), on \(f(x)\) will be translated to the point \((x+c,y+d)\) on \(f(x - c) + d\). So, the point \((2,1)\), the vertex of \(f(x)\) becomes the point \((2+2,1-3) = (4,-2)\), the vertex of \(f(x - c) + d\).
Let’s see if this is true by doing the vertical translation first and then the horizontal translation.
From the lessons learned by the study of vertical translations, the point \((2,1)\) will be translated to the point \((2,1-3) = (2,-2)\). This point will then be translated horizontally resulting in the point \((2+2,-2) = (4,-2)\). This is expected location of \((2,1)\) when undergoing both translations.
The following graph of the function \(f(x)\), the vertically translated function, \(f(x) - 3\), and the then horizontally translated function, \(f(x - 2) - 3\). The point \((2,1)\) is followed during each translation.
This example showed the progression of the point \((2,1)\), the vertex, on \(f(x) = x^{2} - 4x + 5\) to its final location, \((4,-2)\), on the translated function \(2\) units right and \(3\) units down when the vertical translation was performed first followed by the horizontal shift.
Let’s see what happens when the translations are reversed.
Given \(f(x) = x^{2} - 4x + 5\) which undergoes a translation of \(2\) units to the right and \(3\) units down, determine where the point \((2,1)\), the vertex, will be on the translated function by first applying the horizontal translation and then the vertical translation.
Solution:
A translation of \(f(x)\) both horizontally and vertically is of the form \(f(x - c) + d\), where \(c\) represents the horizontal shift and \(d\) represents the vertical shift. In this example \(c = 2\) since \(f(x)\) is being shifted \(2\) units to the right; \(d = -3\) since \(f(x)\) is being shifted \(3\) units down. Thus, the translation is \(f(x - 2) - 3\).
From our understanding of the translation of \(f(x - c) + d\), a point, \((x,y)\), on \(f(x)\) will be translated to the point \((x+c,y+d)\) on \(f(x - c) + d\). So, the point \((2,1)\), the vertex of \(f(x)\) becomes the point \((2+2,1-3) = (4,-2)\), the vertex of \(f(x - c) + d\).
Let’s see if this is true by doing the horizontal translation first and then the vertical translation.
From the lessons learned by the study of horizontal translations, the point \((2,1)\) will be translated to the point \((2+2,1) = (4,1)\). This point will then be translated vertically resulting in the point \((4,1-3) = (4,-2)\). This is expected location of \((2,1)\) when undergoing both translations.
The following graph of the function \(f(x)\), the horizontally translated function, \(f(x - 2)\), and the then vertically translated function, \(f(x - 2) - 3\). The point \((2,1)\) is followed during each translation.
This example showed the progression of the point \((2,1)\), the vertex, on \(f(x) = x^{2} - 4x + 5\) to its final location, \((4,-2)\), on the translated function \(2\) units right and \(3\) units down when the horizontal translation was performed first followed by the vertical shift.
This example, along with the previous one, demonstrated that a point, \((x,y)\), on \(f(x)\) becomes the point \((x+c,y+d)\) on \(f(x - c) + d\) and that the order in which the translations are performed, vertical first then horizontal, or horizontal first then vertical, does not matter. The location to which the function, \(f(x)\), is moved (in its entirety) is the same regardless of the order in which the translations were applied.
Now, let’s explore this same function, \(f(x) = x^{2} - 4x + 5\), in more detail. That is, how the combination of both a horizontal and vertical translation effect the function’s characteristics.
Given \(f(x) = x^{2} - 4x + 5\) which undergoes a translation of \(2\) units to the right and \(3\) units down, find the domain, range, y-intercept, x-intercept, and the roots of \(f(x)\) and the translated function.
Solution:
A translation of \(f(x)\) both horizontally and vertically is of the form \(f(x - c) + d\), where \(c\) represents the horizontal shift and \(d\) represents the vertical shift. In this example \(c = 2\) since \(f(x)\) is being shifted \(2\) units to the right; \(d = -3\) since \(f(x)\) is being shifted \(3\) units down. Thus, the translation is \(f(x - 2) - 3\).
Let’s first consider the function \(f(x) = x^{2} - 4x + 5\). This function was discussed previously in Example ??.7 where it was found that the vertex was \((2,1)\); the domain is all real numbers, \((-\infty,\infty)\), it is a polynomial after all; the range is \([1,\infty)\); the y-intercept is \((0,5)\); and, the roots are \(x = 2 + i\) and \(x = 2 - i\), which are complex, therefore there are no x-intercepts.
And, now let’s consider the translated function \(f(x - 2) - 3\). The above two examples examined the function, \(f(x) = x^{2} - 4x + 5\), and the translated function, \(f(x - 2) - 3\), demonstrating that the order of translation doesn’t matter. Shifting horizontally first, then vertically, produces the same translated function if the vertical shift was done first, then the horizontal shift. But what are the resulting characteristics of this translated function, \(f(x - 2) - 3\)?
Looking at the domain first, we learned that only a horizontal shift would potentially effect the domain. In this case, however, the function \(f(x)\) is a polynomial and will remain a polynomial under any kind of translation. So, the domain of the translated function remains all real numbers, \((-\infty,\infty)\). We also learned that the range is potentially effected by a vertical shift. In this case, the vertical shift is \(3\) units down, so the expectation is that the range would accordingly be effected. Since \(f(x)\) is a quadratic whose range is determined by the location of the Vertex and the concavity. The new location of the vertex resulted from a horizontal shift of \(2\) units right (which wouldn’t change the range) and then \(3\) units down landing at the point \((4,-2)\). Since, the concavity remains up, the range of the translated function would be \([-2,\infty)\).
The y-intercept is effected by both the horizontal shift and vertical shift. Looking at the horizontal shift first, we learned that the location of the y-intercept becomes \((0,f(-c))\), where \(f(x)\) is the original function. In this case, \(c = 2\), so under the horizontal shift the original y-intercept, \((0,5)\), moves to \((0, f(-2)) = (0,17)\). Next, apply the vertical shift. We also learned that the y-intercept goes from \((0,y)\) to \((0,y+d)\) under a vertical translation. Having already moved the y-intercept under the horizontal translation to \((0,17)\), it is from this location that we apply the vertical shift to get \((0,17-3) = (0,14)\)
The finding of the x-intercept(s), if any, is a bit more involved. It is often best done by looking at the roots. We learned that under a horizontal translation, the real roots of the original function, \(f(x)\) are shifted by \(c\) and the real part of any complex roots are also shifted by \(c\), the imaginary parts remain the same. A vertical shift is a bit more complicated. We saw that to find the roots of a vertically translated function it is a root finding problem of the form \(f(x) = -d\), where \(d\) is the vertical shift amount. Combining a horizontal and vertical translation is a combination of the two and the order of shifting can make a difference in the effort involved. Sometimes it may be more advantageous to trace the roots starting with the vertical shift. Wisdom is needed.
In this example, let’s see what the new roots would be under the vertical translation. Since \(d = -3\), then this is a root finding problem of \(f(x) = -(-3)\), or \(f(x) = x^{2} - 4x + 2\). Applying the quadratic formula yields the roots \(x = 2 + \sqrt{2}\) and \(x = 2 - \sqrt{2}\). Note that the roots went from being complex, \(2 \pm i\), to being real. Now we can apply the horizontal translation. Since the roots are real, the new roots are simply these real roots shifted by \(c = 2\) to produce the roots \(x = 4 + \sqrt{2}\) and \(x = 4 - \sqrt{2}\).
To visualize the translation of the roots, first, here is the complex plot of the translation of the roots of \(f(x)\) and the vertically shifted function, \(f(x) - 3\) showing the complex roots are now real:
Again, the complex roots, \(x = 2 + i\) and \(x = 2 - i\) are now real, \(x = 2 + \sqrt{2}\) and \(x = 2 - \sqrt{2}\). These real roots will be translated horizontally to \(x = 4 + i\) and \(x = 4 - i\) under the horizontal shift right of \(2\) units as seen in this complex plot (note, the roots remain real). Here is the complex plot showing the horizontal translation of the real roots:
So, as we determined, the roots of the translated function, \(f(x - 2) - 3\), are \((4 + \sqrt{2},0)\) and \((4 - \sqrt{2},0)\). Here is the complex plot of the translation of the complex roots of \(f(x)\) to the real roots of \(f(x - 2) - 3\):
Now that the roots are known, the real roots become the x-intercepts. In this case, the x-intercepts of \(f(x - 2) -3)\) are \((4 + \sqrt{2},0)\) and \((4 - \sqrt{2},0)\)
The following table summarizes the characteristics of \(f(x)\) and \(f(x - 2) - 3\):
| \(f(x)\) | \(f(x - 2) - 3\) | |
|---|---|---|
| Domain | \(\left(-\infty,\infty\right)\) | \(\left(-\infty,\infty\right)\) |
| Range | \([1,\infty)\) | \([-2,\infty)\) |
| y-intercept | \((0,5)\) | \((0,14)\) |
| x-intercept | None | \((4-\sqrt{2},0)\) and \((4+\sqrt{2},0)\) |
| Roots | \(2 - i\), \(2 + i\) | \(4-\sqrt{2}\) and \(4+\sqrt{2}\) |
| Vertex | \((2,1)\) | \((4,-2)\) |
.
Notice that the determination of the characteristics of the translated function, \(f(x - 2) - 3\), was done using only the knowledge gleaned from our study of horizontal and vertical translations. The finding of the actual translated function was not done at all. This can be quite helpful for the finding of the translated function is sometimes not that easy to do. That said, let’s find the translated function, \(f(x - 2) - 3\), for completeness and to verify the conclusions made above using only our understanding of vertical and horizontal translations.
\[ \begin{align} f(x - 2) - 3 &= (x-2)^{2} - 4(x-2) + 5 - 3 \\ &= x^{2} - 4x + 4 - 4x + 8 + 2 \\ &= x^{2} - 8x + 14 \end{align} \] Therefore, \(f(x - 2) - 3 = x^{2} - 8x + 14\) from which all the above gleaned characteristics can be easily determined and will verify the determinations above made exclusively by using our knowledge of horizontal and vertical translations. (This is left as an exercise for the reader.)
Here is the plot of \(f(x)\) and \(f(x - 2) - 3\) for a visualization of the function and the translated function from which all the above defined characteristics may be observed.
This example showed how the lessons learned from the study of a horizontal and a vertical translation individually were applied to a translation involving both horizontal and vertical translations. It was seen that it is not as straightforward as individual translation were in terms of finding the characteristics of the translated function. Indeed, there may be more than one way to determine these and that’s where experience plays an important role.
The above example was also interesting in that it showed how the only roots, which were complex, became real under a translation. Let us look at another example where the function of interest, \(f(x)\), has both real and complex roots.
Given \(f(x) = x^{3} - x^{2} + x - 1\) which undergoes a translation of \(1\) unit to the right and \(4\) units up, find the domain, range, y-intercept, x-intercept, and the roots of \(f(x)\) and the translated function.
Solution:
A translation of \(f(x)\) both horizontally and vertically is of the form \(f(x - c) + d\), where \(c\) represents the horizontal shift and \(d\) represents the vertical shift. In this example \(c = 1\) since \(f(x)\) is being shifted \(1\) unit to the right; \(d = 4\) since \(f(x)\) is being shifted \(4\) units up Thus, the translation is \(f(x - 1) + 4\).
Let’s first consider the function \(f(x) = x^{3} - x^{2} + x - 1\). This is a degree \(3\) polynomial so its domain is all real numbers as is its range. The y-intercept is \((0,-1)\). Since it is a degree \(3\) polynomial we are guaranteed that there is at least one real root. Using the root finding process described in Chapter ?? we find the roots to be \(x = 1\), \(x = i\), and \(x = -i\). This implies, therefore, that the x-intercept is \((1,0)\). Here is the graph of \(f(x) = x^{3} - x^{2} + x - 1\):
And, since there are real and complex roots, let’s take a look at the complex plot for these roots:
And, now let’s consider the translated function \(f(x - 1) + 4\). This is a combined horizontal shift, with \(c = 1\), and a vertical shift, with \(d = 4\). This is a still a degree \(3\) polynomial under the translation so its domain is also all real numbers as is its range.
The y-intercept is effected by both the horizontal shift and vertical shift. Looking at the horizontal shift first, we learned that the location of the y-intercept becomes \((0,f(-c))\), where \(f(x)\) is the original function. In this case, \(c = 1\), so under the horizontal shift the original y-intercept, \((0,-1)\), moves to \((0, f(-1)) = (0,-4)\). Next, apply the vertical shift. We also learned that the y-intercept goes from \((0,y)\) to \((0,y+d)\) under a vertical translation. Having already moved the y-intercept under the horizontal translation to \((0,-4)\), it is from this location that we apply the vertical shift to get \((0,-4+4) = (0,0)\)
The y-intercept being \((0,0)\), also gives us an x-intercept. Are there more? Even though we know one x-intercept it is often best to determine the x-intercepts by looking at the roots. Let’s apply the wisdom gleaned from the previous example, that it may be more advantageous to trace the roots starting with the vertical shift. So, let’s do that.
In this example, let’s see what the new roots would be under the vertical translation. Since \(d = 4\), then this is a root finding problem of \(f(x) = -4\), or \(f(x) = x^{3} - x^{2} + x + 3\). Applying the root finding process described in Chapter ??, we would discover a rational root of \(x = -1\):
\[ \begin{array}{r|rrrr} -1 & 1 & -1 & 1 & 3 \\ & & -1 & 2 & -3 \\ \hline & 1 & -2 & 3 & 0 \end{array} \]
Applying the quadratic formula to the now degree \(2\) polynomial, \(x^{2} - 2x + 3\), we would find the other two roots to be \(x = 1 + \sqrt{2}i\) and \(x = 1 - \sqrt{2}i\). Thus, the roots of \(f(x)\) resulting from the vertical shift of \(d = 4\) went from \(1\), \(i\), and \(-i\) to \(-1\), \(1 + \sqrt{2}i\), and \(1 - \sqrt{2}i\).
Now we can apply the horizontal translation. Since there is a real root, \(-1\), of the vertically shifted function, the new real root is simply this real root shifted by \(c = 1\) to produce the root \(x = 0\). Under a horizontal translation, a complex root, \(a + bi\), becomes \((a + c) + bi\). Hence, the complex roots, \(1 + \sqrt{2}i\), and \(1 - \sqrt{2}i\), are now translated to \(2 + \sqrt{2}i\), and \(2 - \sqrt{2}i\).
Based on this analysis, the roots of \(f(x - 1) + 4\) are \(x = 0\), \(x = 2 + \sqrt{2}i\), and \(x = 2 - \sqrt{2}i\).
To visualize the translation of the roots, first, here is the complex plot of the translation of the roots of \(f(x)\) and the vertically shifted function, \(f(x) + 4\) showing the translation of the real and complex roots:
And, now let’s visualize the translation of these vertically translated roots under the horizontal translation of \(c = 1\) unit to the right:
Unlike the vertical translation in which there is no direct relationship between the complex, we can clearly see the relationship between the real root and the complex roots is the same: the real component is translated by \(x = c\), the imaginary part remains the same.
Here’s is the complex plot of the roots of \(f(x)\) and the roots of \(f(x - 1) + 4\):
The plot shows how the roots of the original function, \(f(x) = x^{3} - x^{2} + x + 1\), were translated to the roots of \(f(x - 1) + 4\). As mentioned before, the combination of a vertical and horizontal translation presents difficulties unseen in each individual translation, but the understanding of what those are assists greatly in the analysis of a combined translation.
Now that we have completed our analysis, the following table summarizes the characteristics of the original function, \(f(x) = x^{3} - x^{2} + x - 1\), and the translated function, \(f(x - 1) + 4\).
| \(f(x)\) | \(f(x - 1) + 4\) | |
|---|---|---|
| Domain | \(\left(-\infty,\infty\right)\) | \(\left(-\infty,\infty\right)\) |
| Range | \((-\infty,\infty)\) | \((-\infty,\infty)\) |
| y-intercept | \((0,-1)\) | \((0,0)\) |
| x-intercept | \((1,0)\) | \((0,0)\) |
| Roots | \(1\), \(i\), and \(-i\) | \(0\), \(2-\sqrt{2}i\) and \(2+\sqrt{2}i\) |
.
The determination of the characteristics of the translated function, \(f(x - 1) + 4\), was done mainly using only the knowledge gleaned from our study of horizontal and vertical translations. The finding of the actual translated function was not done at all. This can be quite helpful for the finding of the translated function is sometimes not that easy to do. That said, let’s find the translated function, \(f(x - 1) + 4\), for completeness and to verify the conclusions made above using only our understanding of vertical and horizontal translations.
\[ \begin{align} f(x - 1) + 4 &= (x-1)^{3} - (x - 1)^{2} + (x - 1) - 1 + 4 \\ &= x^{3} - 4x^{2} + 6x - 4 + 4 \\ &= x^{3} - 4x^{2} + 6x \end{align} \] Therefore, \(f(x - 1) + 4 = x^{3} - 4x^{2} + 6x\) from which all the above gleaned characteristics can be (easily) determined and will verify the determinations above made exclusively by using our knowledge of horizontal and vertical translations. (This is left as an exercise for the reader.)
Here is the plot of \(f(x)\) and \(f(x - 1) + 4\) for a visualization of the function and the translated function from which many of the above defined characteristics may be observed (see complex plot above for the complex roots).
Note: This example was thoroughly reviewed in the Appendix Function Translation.
This example provided another example of what goes into the determination of the characteristics of a horizontally and vertically translated function. Admittedly, sometimes it may be easier to actually find the translated function, \(f(x - c) + d\), first and then use it to determine the characteristics. However, it is imperative that the concepts of function translation are understood, thus these examples.
Now, let’s look at one more example. This time we will be exploring a non polynomial function.
Given \(f(x) = \sqrt{x}\) which undergoes a translation of \(1\) unit to the right and \(2\) units down, find the domain, range, y-intercept, x-intercept, and the roots of \(f(x)\) and the translated function.
Solution:
A translation of \(f(x)\) both horizontally and vertically is of the form \(f(x - c) + d\), where \(c\) represents the horizontal shift and \(d\) represents the vertical shift. In this example \(c = 1\) since \(f(x)\) is being shifted \(1\) unit to the right; \(d = -2\) since \(f(x)\) is being shifted \(2\) units down Thus, the translation is \(f(x - 1) - 2\).
Let’s first consider the function \(f(x) = \sqrt{x}\), the well known square root function. Here is the graph of \(f(x) = \sqrt{x}\).
The domain of \(f(x) = \sqrt{x}\) is \(x \ge 0\), or \(\left[0,\infty\right)\). To the range is \(\left[0,\infty\right)\). The y- and x-intercepts are \((0,0)\), and the root is \(x = 0\).
And, now let’s consider the translated function \(f(x - 1) - 2\). This is a combined horizontal shift, with \(c = 1\), and a vertical shift, with \(d = -2\). The domain of this translated function is unaffected by the vertical shift. It is, however, effected by the horizontal shift right by \(1\) unit. Thus, the domain of \(f(x - 1) - 2\) is \([1,\infty)\). The range is affected by the vertical shift so the range of \(f(x - 1) - 2\) is \([-2,\infty)\).
The y-intercept is effected by both the horizontal shift and vertical shift. Looking at the horizontal shift first, we learned that the location of the y-intercept becomes \((0,f(-c))\), where \(f(x)\) is the original function. In this case, \(c = -1\). Since \(-1\) is outside t domain of \(f(x)\), there is no y-intercept of the translated function.
To determine the x-intercepts we need to look at the roots. Let’s apply the wisdom gleaned from the previous examples, that it may be more advantageous to trace the roots starting with the vertical shift. So, let’s do that. Under a vertical shift, the roots are \(f(x) = -d\) where, in this case \(d = -2\). This then becomes \(f(x) = 2\), or \(\sqrt{x} = 2\), which yields the root \(x = 4\). Thus, under the vertical shift the x-intercept is \((4,0)\). Now, applying the horizontal shift of \(1\) unit to the right yields the x-intercept of \(f(x - 1) - 2\) to be \((4+1,0) = (5,0)\).
Now that we have completed our analysis, the following table summarizes the characteristics of the original function, \(f(x) = \sqrt{x}\), and the translated function, \(f(x - 1) - 2\).
| \(f(x)\) | \(f(x - 1) - 2\) | |
|---|---|---|
| Domain | \([0,\infty)\) | \([1,\infty)\) |
| Range | \([0,\infty)\) | \([-2,\infty)\) |
| y-intercept | \((0,0)\) | \(None\) |
| x-intercept | \((0,0)\) | \((5,0)\) |
| Roots | \(0\) | \(5\) |
.
The determination of the characteristics of the translated function, \(f(x - 1) - 2\), was done mainly using only the knowledge gleaned from our study of horizontal and vertical translations. The finding of the actual translated function was not done at all. This can be quite helpful for the finding of the translated function is sometimes not that easy to do. That said, let’s find the translated function, \(f(x - 1) - 2\), for completeness and to verify the conclusions made above using only our understanding of vertical and horizontal translations.
\[ \begin{align} f(x - 1) - 2 &= \sqrt{x - 1} - 2 \end{align} \] Therefore, \(f(x - 1) - 2 = \sqrt{x - 1} - 2\) from which all the above gleaned characteristics can be (easily) determined and will verify the determinations above made exclusively by using our knowledge of horizontal and vertical translations. (This is left as an exercise for the reader.)
Here is the plot of \(f(x)\) and \(f(x - 1) - 2\) for a visualization of the function and the translated function from which many of the above defined characteristics may be observed.
The plot shows how the roots of the original function, \(f(x) = \sqrt{x}\), were translated to the roots of \(f(x - 1) - 2\). As mentioned before, the combination of a vertical and horizontal translation presents difficulties unseen in each individual translation, but the understanding of what those are assists greatly in the analysis of a combined translation.
This section presented the translation of a given function, \(f(x)\), undergoing both a horizontal and vertical shift. In other words, the function was moved vertically (up or down) and horizontally (left or right) in its entirety to a new location in two dimensional space. This newly located function will have some, if not all, of the characteristics of the original function changed. The determination of these new characteristics is not as straightforward as when a function undergoes only a horizontal or vertical translation. The lessons learned from these individual one directional translations need to be carefully applied to determine what the characteristics are of the bi-directional translation.
The translation of a function horizontally, vertically, or both, is an important idea with many significant applications in many different areas such as engineering, business, and modeling. In this Why You Should Care section we will look at two: Trigonometric Functions and Mathematical Modeling. In addition, we will look at using function translation to create a function, and place, anywhere in two dimensional space derived from the Well Known Functions.
Trigonometric Functions
Trigonometric functions are extremely important mathematical functions. We will look at two of the fundamental trigonometric functions, the sine and cosine functions, within the context of function translation. These, and the other trigonometric functions will be explored in detail in Chapter ??.
The sine function is given by \(f(\theta) = \sin \theta\), where \(\theta\) is an angle measurement. The angle measure is in either degrees or radians. We will use degrees for most are familiar with that angle measurement; such as \(360^{o}\) in a circle, \(90^{o}\) is a right angle, etc. Radians, however, is the angle measurement generally used in mathematics as a subject. Again, Chapter ?? will explore all this in great detail.
Here is the graph of the sine function for angles in \([-360,360]\) degrees:
One thing to note is that the sine function (and the cosine function) is cyclic and the pattern seen will repeat in both directions forever. Think if it as keep going around a circle in both the positive and negative directions. Also note from looking at the graph, that the function, \(f(\theta) = \sin \theta\), has roots \(\theta\) equal to \(-360\), \(-180\), \(0\), \(180\), and \(360\).
Now let’s consider the sine function, \(f(\theta) = \sin \theta\) shifted \(90^{o}\) to the left (the sine function shifted \(90\) degrees to the left). That is, \(f(\theta + 90)\). In lieu of doing a complete analysis of the translation, we will focus only on the roots of \(f(\theta)\) and their translation under \(f(\theta + 90)\). From what we learned from our study of a horizontal translation, a root of \((\theta,0)\) on \(f(\theta)\) becomes the root \(((\theta + c),0)\) on the translated function \(f(\theta - c)\). Here, \(c = 90\), so the roots of \(f(\theta + 90)\) should be:
\[ \begin{align} (-360,0) &\to (-360-90,0) = (-450,0) \\ (-180,0) &\to (-180-90,0) = (-270,0) \\ (0,0) &\to (0-90,0) = (-90,0) \\ (180,0) &\to (180-90,0) = (90,0) \\ (360,0) &\to (360-90,0) = (270,0) \\ \end{align} \]
Let’s look at the graph of \(f(\theta)\) along with \(f(\theta + 90)\).
As expected, the roots of \(f(\theta)\) were shifted \(90^{o}\) to the left to become the roots of \(f(\theta + 90)\).
This is all very interesting, and validates what be learned, but, again, Why Should You Care. To answer this question, let’s look at \(f(\theta + 90)\). Given that \(f(\theta) = \sin \theta\) then \(f(\theta + 90) = \sin(\theta + 90)\). What is \(\sin(\theta + 90)\)? To answer this question, let’s introduce a trigonometric identity, known as the sum/difference identity of the sine function, which says
\[ \begin{align} \sin(\alpha \pm \beta) &= \sin \alpha \cos \beta \pm \sin \beta \cos \alpha \end{align} \]
where \(\alpha\) and \(\beta\) are two angles.
In our case we are looking at \(\sin(\theta + 90)\) which becomes:
\[ \begin{align} \sin(\theta + 90) &= \sin \theta \cos 90 + \sin 90 \cos \theta \end{align} \]
From the graph it is clear that \(\sin 90 = 1\), and with the given fact that \(\cos 90 = 0\), then we get
\[ \begin{align} \sin(\theta + 90) &= \sin \theta (0) + (1) \cos \theta \\ &= \cos \theta \end{align} \]
Therefore, \(\sin(\theta + 90) = \cos \theta\). Whoa!
Let’s just take a quick look at the graph of the cosine function, \(\cos \theta\):
Comparing the graph of \(\cos \theta\) to the above graph of \(f(\theta + 90) = \sin(\theta + 90)\) we see that they are exactly the same! What this means is that there is a relationship between these two fundamental trigonometric functions: the cosine function is the sine function shifted \(90^{o}\) to the left!! In engineering terms, another way to say this is that the two functions are 90 degrees out of phase.
Again, the trigonometric functions will be explore in detail in Chapter ??. The takeaway here is that just given a few bits of perhaps unknown information, the knowledge gleaned by the study of function translation was sufficient to discover this all important relationship between these two fundamental trigonometric functions, the cosine and sine functions.
Again. Whoa.
Mathematical Modeling
This is a dramatization of a personal real world experience, perhaps over simplified yet quite relevant to function translation. Assume you have a model developed by a third party (an outside source) that you use to run a part of your business. You do not have access to the model itself for it is proprietary information of the third party. In fact, the only access to the model is via its graph. You are only concerned with the input values between \(1\) and \(6\).Your business needs have changed sufficient enough that the model needs to be changed. It is felt that the current model would suffice if its graph (which you have access to) was shifted to the right \(2\) units and up \(1\) unit. In other words, if we call the current model \(f(x)\), then you need \(f(x -2) + 1\). But how to accomplish this when you have only the graph of \(f(x)\)?
Well, after close scrutiny of the graph you were able to see four readily identifiable points, \((1,0)\), \((3,2)\), \((4,1)\), and \((6,3)\). Here is the graph of the model, which is now being referred to as \(f(x)\), and the four identified points.
The idea, then, would be translate these identifiable points on the current model within the range of interest to what they would be on the desired new model, \(f(x - 2)) + 1\). From your knowledge of vertical and horizontal translations, you know that a point, \((x,y)\), on the function, \(f(x)\), will be translated to the point \((x + c,y + d)\) on the translated function, \(f(x - c) + d\). Realizing that \(c = 2\) and \(d = 1\) for your desired translation you are able to translate the four identified points:
\[ \begin{align} (1,0) &\to (1+2,0+1) = (3,1) \\ (3,2) &\to (3+2,2+1) = (5,3) \\ (4,1) &\to (4+2,1+1) = (6,2) \\ (6.3) &\to (6+2,3+1) = (8,4) \end{align} \]
Here is the translated model, \(f(x - 2) + 1\):
Based on your knowledge of function translation you were able translate the graph of an existing business model to another location in two dimensional space to solve an important business need.
Though this being a simplified version of a real world experience, it does highlight the importance of understanding the concepts of function translation!
For the curious, the business model, \(f(x)\), and the translated model, \(f(x - 2) + 1\), used here are:
\[ \begin{align} f(x) &= \frac{4}{15}x^3 - \frac{14}{5}x^{2} + \frac{131}{15}x - \frac{31}{5} \\ \\ f(x - 2) + 1 &= \frac{4}{15}x^3 - \frac{22}{5}x^{2} + \frac{347}{15}x - 36 \end{align} \]
These were developed using a well known theorem that basically says given \(n\) data points, there exists a unique \(n - 1\) degree polynomial that goes through those \(n\) points. This is one my favorite theorems.
Well Known Functions
The ability to create, and place, a function derived from a well known function via function translation is a valuable skill. The reasons that you may want to do so are varied and numerous ranging from mathematical modeling to pure academic.
Let’s first consider the well known function, the quadratic, \(f(x) = x^{2}\). From our understanding of the basic quadratic, \(f(x) = x^{2}\), we know that the vertex is \((0,0)\). Let’s say that we desire the vertex to be \((-2,3)\).
Using our understanding of function translation in both the horizontal and vertical directions, \(f(x - c) + d\), we know that a point \((x,y)\) on the original function moves to the point \((x + c, y + d)\), where \(c\) is the horizontal shift and \(d\) is the vertical shift. So, for our desired translation, where \((0,0)\) becomes \((-2,3)\):
\[ \begin{align} (0,0) &\to (0 + c, 0 + d) = (-2,3) \end{align} \]
Therefore, \(c = -2\) and \(d = 3\). The translated function, then, is \(f(x + 2) + 3\). Finding this function:
\[ \begin{align} f(x + 2) + 3 &= (x + 2)^{2} + 3 \\ &= (x^{2} + 4x + 4) + 3 \\ &= x^{2} + 4x + 7 \end{align} \]
Here is the graph of the original function, \(f(x)\), and the translated function, \(f(x + 2) + 3\):
The vertex was indeed moved from \((0,0)\) to \((-2,3)\)
The observant student will notice that the translation function of \(f(x) = x^{2}\) to \(f(x + 2) + 3 = (x + 2)^{2} + 3\) is identical to \((x -h)^{2} + k\). What is \((x -h)^{2} + k\)? You’ll recall that this is the alternate form of a quadratic \(f(x) = ax^{2} + bx + c\) and that when written as \((x -h)^{2} + k\), the vertex is \((h,k)\).
Next, let’s consider the well known function, the square root function, \(f(x) = \sqrt{x}\). From our understanding of the basic square root function, \(f(x) = \sqrt{x}\), we know that the point \((0,0)\) is not only the x- and y-intercept, it also is the point that determines the domain and range of the function, which in this case is \([0,\infty)\) for both.
Let’s say that we want to translate this function so that the resultant domain is \([3,\infty)\) and the range is \([-4,\infty)\). That means the point \((0,0)\) is translated to the point \((3,-4)\). Thus:
\[ \begin{align} (0,0) &\to (0 + c, 0 + d) = (3,-4) \end{align} \]
Therefore, \(c = 3\) and \(d = -4\). The translated function, then, is \(f(x - 3) - 4\). Finding this function:
\[ \begin{align} f(x - 3) - 4 &= \sqrt{x - 3} - 4 \end{align} \]
Here is the graph of the original function, \(f(x)\), and the translated function, \(f(x - 3) - 4\):
The translated function, \(f(x - 3) - 4\), does, indeed, have the desired domain of \([3,\infty)\) and range of \([-4,\infty)\). The point \((0,0)\) is indeed translated to the point \((3,-4)\).
(It was stated that the reasons that you may want to create, and place, a function derived from a well known function via function translation are varied and numerous ranging from mathematical modeling to pure academic. Truth be told, I use this technique quite often in the creation of new functions for student exercises and assessments. Shhhhh, mum’s the word!)
This chapter explored the idea of taking an existing function and moving it in its entirety to a different location in two dimensional space via function translation. The translation could be horizontal, vertical, or both.
The general idea of function translation is simple:
What is not so simple, however, is the finding of the key characteristics (domain, range, x- and y-intercepts, and roots) of a translated function. There are some general statements that can be made about domain and range:
The x- and y-intercepts, as well as the roots, of the translated function, of any kind, are a bit more involved, usually involving the solving of a root finding problem. When considering roots, you must also take into account the type of root, real or complex.
Each of the above sections, vertical, horizontal, or both, provided a detailed summary of the effects of the translation along with several examples. The summaries and examples should be reviewed and understood. It is especially important that the concepts of function translation, inclusive of all kinds, be internalized and thoroughly understood.
Note: it was stated that this chapter explored the idea of taking an existing function and moving it in its entirety to a different location. We did not concern ourselves with how the existing function came to be. Thus, things like stretches and reflections were not discussed. These might have been involved in creating a function but were of no concern to us here. We were only concerned with translating an existing function regardless of how it was created.
Explore even degree polynomials with all complex roots, some mixture, etc.
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.
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.
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.
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.
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\).
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.
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
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.
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.
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)\).
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.
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.
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.
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\).
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.
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.
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.
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.
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.
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.
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.
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!)
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.
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\).
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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)\).
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.
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.
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?”
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:
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)\):
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.
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.
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.
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]\).
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)\):
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.
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.
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
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.
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.
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.
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\).
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 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, or skimming the paper, especially the discussion of Neural Networks as one big composite function, 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!
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.
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.
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,
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)\).
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.
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.
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.
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)\):
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:
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.
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.
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.
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.
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.}\)
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\):
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.
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.
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:
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.
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!
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):
Complex numbers are used pervasively in many areas of mathematics, algebra and linear algebra just to name two. And they are prevalent in many areas of physics, engineering, and signal processing. Thus, it is important to have a crisp understanding of complex numbers.
In Chapter ??, we explored the concepts of
complex numbers from a mathematical and algebraic
perspective. In this appendix we will explore how some of these ideas
are handled in a practical, applied sense as well as the verification of
the concepts developed in the chapter. R will be used to
accomplish this.
In particular, we will be exploring:
RR CodeNote: In this Appendix, in addition to base R, one
of the several R routines self-developed for this book will
be used. rootFindingProcess.R was created to implement the
root finding process, described in the root finding chapter,
Chapter ??. It was designed to use the
root finding process generalization of always
starting with \(f(x) = g(x)\), and then
algebraically manipulate to form \(f(x) - g(x)
= 0\).
RBefore exploring what was specifically presented in the complex
numbers chapter, Chapter ?? let’s briefly review
complex numbers in R.
Defining A Complex Number
There are six basic data types in R. For a datum to be
treated as a complex number it must be of the data type
complex. Basically, a complex data type is
defined by its having an imaginary part. To define a complex number it
is as simple as specifying it to be of the form \(a + bi\). To verify that the number is
indeed of data type complex, the str()
function, which identifies the internal structure of the object
passed into the function, or the class() function, which
basically tells which class the object belongs to from which it
inherits all the properties associated with that class, can be used.
For example, let’s define the complex number, \(-3 + 2i\), and verify that it is indeed a complex number:
# define theNum to be the complex number -3 + 2i; for readability spaces are used but they are not necessary
cNum <- -3 + 2i
# verify that R understands this as a complex data type using the str() function
str(cNum)
## cplx -3+2i
# verify that R understands this as a complex data type using the class() function
class(cNum)
## [1] "complex"
From both the str() and class() functions,
we see that the number \(-3 + 2i\) is
indeed a complex data type.
Once a datum is known to R as of type
complex, meaning that it has a real part and an imaginary
part, you can extract the real and imaginary parts using the built in
R functions Re() and Im(),
respectively. For the complex number, \(-3 +
2i\), the real part is \(-3\)
and the coefficient \(b\) of the
imaginary part is \(2\). Let’s verify
that:
# enter -3 + 2i
cNum <- -3 + 2i
Re(cNum)
## [1] -3
Im(cNum)
## [1] 2
We see that the real and imaginary parts are as expected.
Coercing A Number To Be Complex
It happens that you might have a real number that for a particular
specific operation you want it to be considered as complex without
changing its original type, real. You can do this using the
as.complex() function which coerces the number to
complex by creating an imaginary part and setting it equal to \(0\).
# enter 7
rNum <- 7
# look at the class to which rNum belongs which should be numeric
class(rNum)
## [1] "numeric"
# define cNum to be coerced rNum to be complex and see what it is.
# it should now be 7 + 0i
cNum <- as.complex(rNum)
cNum
## [1] 7+0i
# look at the class to which cNum belongs which should be complex
class(cNum)
## [1] "complex"
# the class of rNum should still be what it was before, which should be numeric
class(rNum)
## [1] "numeric"
Or, if you had a real number which at some point to want to be
defined as complex and remain complex, you can change
its type using as.complex():
# define a real number 5.67
rNum <- 5.67
cat('\nThe real number:',rNum)
##
## The real number: 5.67
# now you want it be treated as a complex number moving forward
rNum <- as.complex(rNum)
cat('\nThe real number should now be a complex number:',rNum)
##
## The real number should now be a complex number: 5.67+0i
The ability to coerce a number to be complex temporarily can be quite useful. Say, we want to see what the \(\sqrt{-1}\) is:
# find sqrt(-1); R should throw a warning
sqrt(-1)
## Warning in sqrt(-1): NaNs produced
## [1] NaN
# coerce -1 to be complex
sqrt(as.complex(-1))
## [1] 0+1i
You see that R could not find \(\sqrt{-1}\) but when \(-1\) was coerced to be complex the expected
result was \(i\).
Peculiarity In Entering A Complex Number: Must Be A Coefficient In Front of \(i\)
There are some peculiarities in entering a complex number you should
be aware of. First, if the intended complex number is \(5 + i\) and enter into R as
\(5 + i\) you will
receive the error Error: object 'i' not found. This is
because R was unable to discern that the intent of the
\(i\) was the imaginary number \(i\). To resolve this situation, it is
necessary to place a \(1\) before the \(i\), that is as \(5 + 1i\):
# enter 5 + i; should throw the error object 'i' not found
5 + i
## Error in eval(expr, envir, enclos): object 'i' not found
# now enter it with 1 as the coefficient of i
5 + 1i
## [1] 5+1i
Peculiarity In Entering A Complex Number: Order Of Operations
The second peculiarity is how R treats order of
operations. Consider the intended complex number is \(5 + \frac{1}{2}i\):
# enter 5 + 1/2i
5 + 1/2i
## [1] 5-0.5i
Wait! What? R reported \(5 -
\frac{1}{2}i\), but that’s not right. What’s going on? Let’s look
at how the imaginary number was entered: \(1/2i\). R interprets this as
\(\frac{1}{2i}\), which means 1
divided by \(2i\). And
what is this? From what we learned about complex division:
\[ \begin{align} \frac{1}{2i} &= \left(\frac{1}{2i}\right)\left(\frac{-2i}{-2i}\right) \\ &= \frac{-2i}{4} \\ &= -\frac{1}{2}i \end{align} \]
Thus, when entering of \(5 +
\frac{1}{2}i\), R will internalize this as \(5 - \frac{1}{2}i\). This is exactly what
R reported! One way to avoid this issue is to be sure that
\(i\) is explicitly
placed in the numerator. That is, instead of entering
the complex number \(1 + \frac{1}{2}i\)
as 5 + 1/2i, enter it as 5 + 1i/2:
# enter 5 + 1i/2 where i is explicitly in the numerator
5 + 1i/2
## [1] 5+0.5i
Another way is to explicitly ensure that what the intended order of operations is guaranteed through the use of parenthesis.
# enter 5 + (1/2)*1i where the order of operations is clearly specified
5 + 1i/2
## [1] 5+0.5i
This ensures that the complex number is entered as it was intended. Believe me, I scratched my head on this, so be forewarned.
Purely Imaginary and Purely Real Numbers
Should you want the purely imaginary number \(-3i\), there are two ways to do this. You could enter \(0 - 3i\) or simply \(-3i\):
# enter the complex number 0 - 3i
0 - 3i
## [1] 0-3i
# or you could simply enter the purely imaginary number -3i
-3i
## [1] 0-3i
Should you want the purely real number \(7\), there are two ways to do this. You could enter or \(7 + 0i\) or simply \(7\) :
# enter 7 + 0i
7 + 0i
## [1] 7+0i
# see how R perceives this number
str(7 + 0i)
## cplx 7+0i
# or you could simply enter 7
7
## [1] 7
# see how R perceives this number
str(7)
## num 7
Note that in the first mode of entering the purely real number as
\(7 + 0i\), a complex
number is returned for it was entered as a complex number. However, is
the second mode when just a \(7\) is
entered, the real number \(7\) is returned. Makes sense for in the
latter case R has no idea what the intent was, it just
knows a \(7\) is a real number and
reported as such. So, be careful. It it is your intent to have a purely
real complex number (the key word here is complex) the be sure to enter
it as \(a + 0i\).
In Chapter ?? we defined \(i = \pm \sqrt{-1}\) and \(i^{2} = -1\). It was also seen that the
powers of \(i\) follow a \(4\) power cyclic pattern. This allowed us
to easily evaluate any power of \(i\).
Let’s verify all this using R.
Verify that \(i^{2} = -1\). Using
R:
# find i^2
1i^2
## [1] -1+0i
# or enter as (i)^2
(1i)^2
## [1] -1+0i
Either method of input was fine. The fact that the answer reported
was -1+0i means that it is a purely real number, the
imaginary part is \(0\). Though
unnecessary, let’s just verify this part:
# find i^2
cNum <- 1i^2
Re(cNum)
## [1] -1
Im(cNum)
## [1] 0
\(i^{2} = -1\) has been verified.
In the complex number chapter, Chapter ??, example
number 3 asked what is \(i^98\). Using
the logic of the 4 power cycle of powers of \(i\), it was determined that \(i^{98} = -1\). Let’s verify that using
R:
# find i^2
1i^2
## [1] -1+0i
# or enter as (i)^2
(1i)^2
## [1] -1+0i
\(i^{98} = -1\) has been verified.
In the complex number chapter, Chapter ??, example
number 5 asked find \(-2(i^{5})^{3}\).
It was determined to be \(2i\). Let’s
verify that using R. We will do it two ways as we did in
the chapter. The first way is to evaluate it as written, the finding of
\(i^{5}\) than raising that to the 3rd
power. The second way would be to use the laws of exponents to get \(-2(i^{5(3)})\)
# find -2*(1i^5)^3
-2*(1i^5)^3
## [1] 0+2i
# or enter as -2*(1i^(5*3))
-2*(1i^(5*3))
## [1] 0+2i
# which should be equivalent as -2(1i^15)
-2*(1i^15)
## [1] 0+2i
In all three cases, the answer was \(0 + 2i\), which since the real part being \(0\), indicates that the answer is \(2i\), which is purely imaginary.
From an R perspective this example showed the different
ways to enter a problem like this
Thus, -2\((i^{5})^{3} = 2i\) has been verified.
Find \(-\frac{2}{3}i^{7}\).
# find -2/3i^7
-2/3i^7
## [1] 0-0.0009144947i
This is certainly not look correct! From what we learned about powers of \(i\) that \(i^{7} = -i\) which means:
\[ \begin{align} -\frac{2}{3}i^{7} &= -\frac{2}{3}(-i) \\ &= \frac{2}{3}i \end{align} \]
The expected solution is \(\frac{2}{3}i\). Based on what we saw above in complex number and order of operations, the way we entered the problem was very much incorrect. What was entered, \(-2/3i^7\) was interpreted as \(2/(3i^7)\) which would product \(0 - 0.0009144947i\). In a situation like this be sure to enter the expression as intended using one of the means discussed above concerning order of operations.
# ensure order of operations by placing i in the numerator (-2*(1i^7))/3
(-2*(1i^7))/3
## [1] 0+0.6666667i
# or by (-2/3)*(1i^7)
(-2/3)*(1i^7)
## [1] 0+0.6666667i
# the expected imaginary part coefficient of 2/3 was obtained
fractions(Im((-2/3)*(1i^7)))
## [1] 2/3
The complex plane allows for the visualization of complex numbers. We can plot complex numbers just as easily as we can real numbers. A point in two-dimensional space is identified by the ordered pair, \((x,y)\), in the Cartesian coordinate system. The \(x\) value is the coordinate, or distance, along the x-axis. The \(y\) value is the coordinate, or distance, along the y-axis. In a complex plot, the x-axis now represents the real axis; the y-axis now represents the imaginary axis.
For the complex number \(x + yi\), the real part is \(x\) and the imaginary part is \(y\). Therefore, to plot the point \(x + yi\) you would move along the x-axis, which is now the real axis, \(x\) units from the origin. Then you would move vertically \(y\) units, which equivalent to having had moved along the y-axis, which is now the imaginary axis, and you would now be at the point \(x + yi\). The ordered pair of that point in the complex plane would be \((x,y)\). The \(x\) represents the real part, the \(y\) represents the imaginary part.
To see how this works and how a complex plot is created in
R, consider the following example.
Given the function, \(f(x) = x^{4} - 6x^{3} + 6x^{2} + 34x - 195\). Find and plot the roots of \(f(x)\).
Let’s first find the roots of \(f(x)\) using
rootFindingProcess.R.
rootFindingProcess(c(1,-6,6,34,-195))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^4 - 6*x^3 + 6*x^2 + 34*x - 195"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^4 - 6*x^3 + 6*x^2 + 34*x - 195"
## [1] "Degree of polynomial: 4"
## [1] "By the FTA a total of 4 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 195 -195 65 -65 39 -39 15 -15 13 -13 5 -5 3 -3 1
## [16] -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] 5 -3
## [1] "The Roots Found By The Quadratic Formula:"
## [1] 2-3i 2+3i
## [1] "Total Roots Found: 4"
## [1] "All Roots Found!"
The roots are \(x = -3\), \(x = 5\), \(x = 2 + 3i\), and \(x = 2 - 3i\). Thus, \(f(x)\) has two real roots and two complex roots. A conventional two-dimensional plot is insufficient to plot these four roots since two are complex, so let’s create a complex plot:
The plot clearly shows the real roots of \(f(x)\) as being on the x-axis for they are purely real in the complex number world. That is, the root \(x= -3\) is the complex number \(-3 + 0i\) and, therefore will have the ordered pair, \((-3,0)\). Same is true with the root \(x = 5\) and its ordered pair, \((5,0)\). The two complex roots, \(x = 2 + 3i\) and \(x = 2 - 3i\), both have non-zero real and imaginary parts. Thus their ordered pairs will be \((2,3)\) and \((2,-3)\), respectively.
The roots were individually colored for identification purposes
as opposed to having each type of root being the same color, which is
more typical. Note as well, that the self-developed routine,
rootFindingProcess.R, was used to find the roots of \(f(x) = x^{4} - 6x^{3} + 6x^{2} + 34x -
195\). This routine, as well as a complete discussion of roots
and root finding, is covered in the Root Finding Chapter,
Chapter ??.
See section, ??.6 R Code,
for the R code which generated this complex plot thus
providing an example of how to create a complex plot in
R.
Now that we have an understanding of what a complex number is, we turn our attention to the arithmetic operations between two or more complex numbers. The arithmetic operations are, of course, addition, subtraction, multiplication, and division. We will consider each in turn.
The addition of two complex numbers is nothing more than the adding together of the real parts and the adding together of the imaginary parts.
\[ \begin{align} (a + bi) + (c + di) &= (a + c) + (bi + di) \\ & = (a + c) + (b + d)i \end{align} \]
Let’s see how this works in R.
In Example ??.9 of Chapter ?? it was found that the sum of the two complex numbers \(2 + 5i\) and \(-3 + 7i\) was \(-1 + 12i\). Verify this result.
# define first complex number
cNum1 <- 2 + 5i
# define second complex number
cNum2 <- -3 + 7i
# add the two complex numbers
cNum1 + cNum2
## [1] -1+12i
The result \((2 + 5i) + (-3 + 7i) = -1 + 12i\) was verified.
Now, let’s look at a more interesting example, interesting
in the sense that fractions are involved thus care needs to be taken
when entering into R as discussed above.
Find \(\left(\frac{1}{2} - \frac{2}{3}i\right) + \left(\frac{1}{4} + \frac{1}{5}i\right)\).
Let’s first find the solution by performing the complex number addition:
\[ \begin{align} \left(\frac{1}{2} - \frac{2}{3}i\right) + \left(\frac{1}{4} + \frac{1}{5}i\right) &= \left(\frac{1}{2} + \frac{1}{4}\right) + \left(-\frac{2}{3} + \frac{1}{5}\right)i \\ \\ &= \frac{3}{4} + \left(\frac{-10 + 3}{15}\right)i \\ \\ &= \frac{3}{4} - \frac{7}{15}i \end{align} \]
Thus, the algebraic solution obtained by performing the complex
number addition was \(\frac{3}{4} -
\frac{7}{15}i\). Now, let’s see what R says:
# define first complex number
cNum1 <- 1/2 - 2i/3
# define second complex number
cNum2 <- 1/4 + 1i/5
# add the two complex numbers
cNum1 + cNum2
## [1] 0.75-0.4666667i
# convert the real part to a fraction
fractions(Re(cNum1 + cNum2))
## [1] 3/4
# convert the imaginary part to a fraction
fractions(Im(cNum1 + cNum2))
## [1] -7/15
Thus, the algebraic solution and the R solution agree
that \(\left(\frac{1}{2} - \frac{2}{3}i\right)
+ \left(\frac{1}{4} + \frac{1}{5}i\right) = \frac{3}{4} -
\frac{7}{15}i\)
The subtraction of two or more complex numbers is taking the difference of the* real and the imaginary parts. I recommend turning the subtraction problem into an addition problem. Either way, in general, the addition of \(n\) complex numbers is:
\[
\begin{align}
(a_{1} + b_{1}i) - (a_{2} + b_{2}i) - \cdots - (a_{n} + b_{n}i) &=
(a_{1} - a_{2} - \cdots - a_{n}) + (b_{1} - b_{2} - \cdots - b_{n})i
\end{align}
\] Let’s see how this works in R. We’ll start with
the subtraction of two numbers, then look at more than two. We will use
complex numbers where fractions are involved, thus care needs to be
taken when entering into R as discussed above.
Find \(\left(\frac{3}{4} - \frac{5}{6}i\right) - \left(\frac{1}{7} + \frac{2}{5}i\right)\).
Let’s first find the solution by performing the complex number subtraction where, again, I will turn into an addition problem:
\[ \begin{align} \left(\frac{3}{4} - \frac{5}{6}i\right) - \left(\frac{1}{7} + \frac{2}{5}i\right) &= \left(\frac{3}{4} - \frac{5}{6}i\right) + (-1) \left(\frac{1}{7} + \frac{2}{5}i\right) \\ \\ &= \left(\frac{3}{4} - \frac{5}{6}i\right) + \left(-\frac{1}{7} - \frac{2}{5}i\right) \\ \\ &= \left(\frac{3}{4} - \frac{1}{7}\right) + \left(-\frac{5}{6} - \frac{2}{5}\right)i \\ \\ &= \left(\frac{21 - 4}{28}\right) + \left(\frac{-25 - 12}{30}\right)i \\ \\ &= \frac{17}{28} - \frac{37}{30}i \end{align} \]
Thus, the algebraic solution obtained by performing the complex
number subtraction was \(\frac{17}{28} -
\frac{37}{30}i\). Now, let’s see what R says:
# define first complex number
cNum1 <- 3/4 - 5i/6
# define second complex number
cNum2 <- 1/7 + 2i/5
# subtract the two complex numbers
cNum1 - cNum2
## [1] 0.607143-1.233333i
# convert the real part to a fraction
fractions(Re(cNum1 - cNum2))
## [1] 17/28
# convert the imaginary part to a fraction
fractions(Im(cNum1 - cNum2))
## [1] -37/30
Thus, the algebraic solution and the R solution agree
that \(\left(\frac{3}{4} - \frac{5}{6}i\right)
- \left(\frac{1}{7} + \frac{2}{5}i\right) = \frac{17}{28} -
\frac{37}{30}i\)
In Example ??.27 of Chapter ?? it was found that the difference of the following complex numbers \(1 - 2i\), \(-\frac{1}{2} + i\), \(-3 - \frac{2}{3}i\) and \(\frac{7}{2} - \frac{5}{3}i\) was \(1 - \frac{2}{3}i\). Verify this result.
# define first complex number
cNum1 <- 1 - 2i
# define second complex number
cNum2 <- -1/2 + 1i
# define third complex number
cNum3 <- -3 - 2i/3
# define fourth complex number
cNum4 <- 7/2 - 5i/3
# find their difference
cNum1 - cNum2 - cNum3 - cNum4
## [1] 1-0.666667i
# convert the real part to a fraction
fractions(Re(cNum1 - cNum2 - cNum3 - cNum4))
## [1] 1
# convert the imaginary part to a fraction
fractions(Im(cNum1 - cNum2 - cNum3 - cNum4))
## [1] -2/3
The result \(\left(1 - 2i\right) - \left(-\frac{1}{2} + i\right) - \left(-3 - \frac{2}{3}i\right) - \left(\frac{7}{2} - \frac{5}{3}i\right) = 1 - \frac{2}{3}i\) was verified.
The multiplication of two complex numbers is nothing more than the multiplication of two binomials. In doing so a term \(i^{2}\) will always result which must be replaced with what it equals, \(i^{2} = -1\). Thus, the product of two complex numbers, \(a + bi\) and \(c + di\), is:
\[ \begin{align} (a + bi)(c + di) &= (ac - bd) + (ad + bc)i \end{align} \]
The multiplication of more than two complex numbers is nothing more than the multiplication of the binomials representing each complex number.
Let’s see how this works in R.
In Example ??.32 of Chapter ?? it was found that the multiplication of the following complex numbers \(-2 + i\), \(1 - 2i\), \(3 - 4i\), and \(-1 - i\) was \(-5 - 35i\). Verify this result.
# define first complex number
cNum1 <- -2 + 1i
# define second complex number
cNum2 <- 1 - 2i
# define third complex number
cNum3 <- 3 - 4i
# define fourth complex number
cNum4 <- -1 - 1i
# find their product
cNum1 * cNum2 * cNum3 * cNum4
## [1] -5-35i
# convert the real part to a fraction
fractions(Re(cNum1 * cNum2 * cNum3 * cNum4))
## [1] -5
# convert the imaginary part to a fraction
fractions(Im(cNum1 * cNum2 * cNum3 * cNum4))
## [1] -35
The result \((-2 + i)(1 - 2i)(3 - 4i)(-1 - i) = -5 - 35i\) was verified.
Now, let’s look at a more interesting example only in the
sense that fractions are involved thus care needs to be taken when
entering into R as discussed above.
Find \(\left(\frac{2}{3} + \frac{2}{5}i\right)\left(\frac{2}{9} - \frac{3}{4}i\right)\).
Let’s first find the solution by performing the complex number multiplication:
\[ \begin{align} \left(\frac{2}{3} + \frac{2}{5}i\right)\left(\frac{2}{9} - \frac{3}{4}i\right) &= \left(\frac{2}{3}\right)\left(\frac{2}{9}\right) + \left(\frac{2}{3}\right)\left(-\frac{3}{4}\right)i + \left(\frac{2}{9}\right)\left(\frac{2}{5}\right)i + \left(\frac{2}{5}\right)\left(-\frac{3}{4}\right)i^{2} \\ \\ &= \frac{4}{27} - \frac{1}{2}i + \frac{4}{45}i + \frac{3}{10} \\ \\ &= \left(\frac{4}{27} + \frac{3}{10}\right) + \left(-\frac{1}{2} + \frac{4}{45}\right)i \\ \\ &= \frac{40 + 81}{270} + \left(\frac{-45 + 8}{90}\right)i \\ \\ &= \frac{121}{270} - \frac{37}{90}i \end{align} \]
Thus, the algebraic solution obtained by performing the complex
number multiplication was \(\frac{121}{270} -
\frac{37}{90}i\). Now, let’s see what R says:
# define first complex number
cNum1 <- 2/3 + 2i/5
# define second complex number
cNum2 <- 2/9 - 3i/4
# multiply the two complex numbers
cNum1 * cNum2
## [1] 0.4481481-0.4111111i
# convert the real part to a fraction
fractions(Re(cNum1 * cNum2))
## [1] 121/270
# convert the Im part to a fraction
fractions(Im(cNum1 * cNum2))
## [1] -37/90
Thus, the algebraic solution and the R solution agree
that \(\left(\frac{2}{3} +
\frac{2}{5}i\right)\left(\frac{2}{9} - \frac{3}{4}i\right) =
\frac{121}{270} - \frac{37}{90}i\)
The division of two complex numbers is achieved by the multiplication of both the numerator and denominator by the complex conjugate of the* denominator, and do the complex arithmetic
\[ \begin{align} \frac{a + bi}{c + di} &= \left(\frac{a + bi}{c + di}\right)\left(\frac{c - di}{c - di}\right) \\ \\ &= \frac{(ac + bd) + (bc - ad)i}{c^{2} + d^{2}} \end{align} \]
Let’s see how this works in R.
Find \(\frac{\frac{2}{3} - \frac{1}{5}i}{\frac{7}{5} + \frac{3}{4}i}\).
Let’s first find the solution by performing the complex number division:
\[ \begin{align} \frac{\frac{2}{3} - \frac{1}{5}i}{\frac{7}{5} + \frac{3}{4}i} &= \left(\frac{\frac{2}{3} - \frac{1}{5}i}{\frac{7}{5} + \frac{3}{4}i}\right)\left(\frac{\frac{7}{5} - \frac{3}{4}i}{\frac{7}{5} - \frac{3}{4}i}\right) \\ \\ &= \frac{\left(\frac{2}{3}\right)\left(\frac{7}{5}\right) + \left(\frac{2}{3}\right)\left(-\frac{3}{4}\right)i + \left(-\frac{1}{5}\right)\left(\frac{7}{5}\right)i + \left(\frac{1}{5}\right)\left(\frac{3}{4}\right)i^{2}}{\left(\frac{7}{5}\right)^{2} + \left(\frac{3}{4}\right)^{2}} \\ \\ &= \frac{\frac{14}{15} - \frac{1}{2}i - \frac{7}{25}i - \frac{3}{30}}{\frac{49}{25} + \frac{9}{16}} \\ \\ &= \frac{\left(\frac{14}{15} - \frac{3}{20}\right) + \left(-\frac{1}{2} - \frac{7}{25}\right)i}{\frac{784 + 225}{400}} \\ \\ &= \frac{\frac{280 - 45}{300} + \left(\frac{-25 - 14}{50}\right)i}{\frac{1009}{400}} \\ \\ &= \frac{\frac{235}{300} -\frac{39}{50}i}{\frac{1009}{400}} \\ \\ &= \frac{\left(\frac{235}{300} -\frac{39}{50}i\right)400}{1009} \\ \\ &= \frac{\left(\frac{235}{300}\right)400 - 312i}{1009} \\ \\ &= \frac{\frac{940}{3} - 312i}{1009} \\ \\ &= \frac{940}{3027} - \frac{312}{1009}i \end{align} \]
Whew! Thus, the algebraic solution obtained by performing the complex
number division was \(\frac{940}{3027} -
\frac{312}{1009}i\). Now, let’s see what R says:
# define first complex number
cNum1 <- 2/3 - 1i/5
# define second complex number
cNum2 <- 7/5 + 3i/4
# divide the two complex numbers
cNum1 / cNum2
## [1] 0.3105385-0.309217i
# convert the real part to a fraction
fractions(Re(cNum1 / cNum2))
## [1] 940/3027
# convert the Im part to a fraction
fractions(Im(cNum1 / cNum2))
## [1] -312/1009
Thus, the algebraic solution and the R solution agree
that \(\frac{\frac{2}{3} -
\frac{1}{5}i}{\frac{7}{5} + \frac{3}{4}i} = \frac{940}{3027} -
\frac{312}{1009}i\). Though extremely fun to find the
solution algebraically, it was a lot easier using
R!
We have now seen all four of the arithmetic operations, addition, subtraction, multiplication, and division, of complex numbers individually. It is not an unreasonable expectation that these operations will need to be combined. Doing so is just a matter of doing the operations as you would any normal algebraic expression. The only difference is that the entities involved are complex numbers.
Let’s see how this works in R.
In Example ??.38 of Chapter ?? it was found that the result of dividing \(\frac{1 + i}{2 - i}\) by \(\frac{3 + 2i}{-2 + i}\) was \(\frac{-5 - i}{13}\). Verify this result.
In other words, we are asked to find:
\[ \frac{\frac{1 + i}{2 - i}}{\frac{3 + 2i}{-2 + i}} \]
# define first complex number
cNum1 <- 1 + 1i
# define second complex number
cNum2 <- 2 - 1i
# define third complex number
cNum3 <- 3 + 2i
# define forth complex number
cNum4 <- -2 + 1i
# perform the "complex" complex division
(cNum1 / cNum2) / (cNum3 / cNum4)
## [1] -0.3846154-0.0769231i
# convert the real part to a fraction
fractions(Re((cNum1 / cNum2) / (cNum3 / cNum4)))
## [1] -5/13
# convert the Im part to a fraction
fractions(Im((cNum1 / cNum2) / (cNum3 / cNum4)))
## [1] -1/13
Thus, the algebraic solution and the R solution agree
that \(\frac{\frac{1 + i}{2 - i}}{\frac{3 +
2i}{-2 + i}} = \frac{-5 - i}{13} = \frac{-5}{13} -
\frac{1}{13}i\).
In Example ??.39 of Chapter ?? it was found that the result of \(\frac{1+i}{2+i} - \frac{3+i}{1+3i}\) was \(i\). Verify this result.
# define first complex number
cNum1 <- 1 + 1i
# define second complex number
cNum2 <- 2 + 1i
# define third complex number
cNum3 <- 3 + 1i
# define forth complex number
cNum4 <- 1 + 3i
# perform the complex arithmetic combination
(cNum1 / cNum2) - (cNum3 / cNum4)
## [1] 0+1i
# convert the real part to a fraction
fractions(Re((cNum1 / cNum2) - (cNum3 / cNum4)))
## [1] 0
# convert the Im part to a fraction
fractions(Im((cNum1 / cNum2) - (cNum3 / cNum4)))
## [1] 1
Thus, the algebraic solution and the R solution agree
that \(\frac{1+i}{2+i} - \frac{3+i}{1+3i} =
i\).
In Example ??.40 of Chapter ?? it was found that the result of \(\left(\frac{1 + i}{2-i}\right)\left(\frac{3 + 2i}{4 - 2i}\right) - \frac{5 + 2i}{1 - i}\) was \(\frac{-46 - 78i}{25}\). Verify this result.
In other words, we are asked to find:
\[ \left(\frac{1 + i}{2-i}\right)\left(\frac{3 + 2i}{4 - 2i}\right) - \left(\frac{5 + 2i}{1 - i}\right) \]
# define first complex number
cNum1 <- 1 + 1i
# define second complex number
cNum2 <- 2 - 1i
# define third complex number
cNum3 <- 3 + 2i
# define forth complex number
cNum4 <- 4 - 2i
# define fifth complex number
cNum5 <- 5 + 2i
# define sixth complex number
cNum6 <- 1 - 1i
# perform the complex arithmetic combination
(cNum1 / cNum2) * (cNum3 / cNum4) - (cNum5 / cNum6)
## [1] -1.84-3.12i
# convert the real part to a fraction
fractions(Re((cNum1 / cNum2) * (cNum3 / cNum4) - (cNum5 / cNum6)))
## [1] -46/25
# convert the Im part to a fraction
fractions(Im((cNum1 / cNum2) * (cNum3 / cNum4) - (cNum5 / cNum6)))
## [1] -78/25
Thus, the algebraic solution and the R solution agree
that \(\left(\frac{1 +
i}{2-i}\right)\left(\frac{3 + 2i}{4 - 2i}\right) - \frac{5 + 2i}{1 - i}
= \frac{-46 - 78i}{25} = \frac{-46}{25} - \frac{78}{25}i\).
The complex conjugate of \(a + bi\) is \(a - bi\). The complex conjugate of \(a - bi\) is \(a + bi\). The complex conjugate is the same as \(a + bi\) except that the sign of the imaginary part is reversed.
Let’s look at a complex plot of a complex number and its conjugate:
From the plot we observe that the real part of each is the same distance from the origin, \(a\), along the x-axis which is the real axis. The distance along the y-axis, the imaginary axis, is the same and is the magnitude of the imaginary part, \(b\). The direction along the imaginary axis, however, is the opposite. The ordered pair for complex number, \(a + bi\), in the complex plane is \((a,b)\), while the odered pair for the complex conjugate, \(a - bi\), is \((a,-b)\). On other words, the complex conjugate is the reflection of the complex number, \(a + bi\), about the x-axis.
There are some interesting properties between a complex number, \(a + bi\), and its complex conjugate, \(a - bi\).
\[ \begin{align} (a + bi) + (a - bi) &= 2a \end{align} \]
\[ \begin{align} (a + bi) - (a - bi) &= 2bi \end{align} \]
\[ \begin{align} (a + bi)(a - bi) &= a^{2} + b^{2} \end{align} \]
Let’s verify these properties using R, starting with the
sum of two complex numbers property.
Using the complex number, \(\frac{1}{4} + \frac{2}{3}i\), verify that the sum of a complex number, \(a + bi\), and its complex conjugate, \(a - bi\) is always real and is equal to:
\[ \begin{align} (a + bi) + (a - bi) &= 2a \end{align} \]
For the given complex number, \(\frac{1}{4} + \frac{2}{3}i\), \(a = \frac{1}{4}\), let’s first algebraically verify the sum of \(\frac{1}{4} + \frac{2}{3}i\) and its complex conjugate, \(\frac{1}{4} - \frac{2}{3}i\) equals \(2a\):
\[ \begin{align} \left(\frac{1}{4} + \frac{2}{3}i\right) + \left(\frac{1}{4} - \frac{2}{3}i\right) &= \left(\frac{1}{4} + \frac{1}{4}\right) + \left(\frac{2}{3}i - \frac{2}{3}i\right) \\ \\ &= \frac{2}{4} + 0i \\ &= \frac{2}{4} = \frac{1}{2} \end{align} \]
Given \(\frac{1}{4} + \frac{2}{3}i\), \(a = \frac{1}{4}\). Thus, \(2a = 2\left(\frac{1}{4}\right) = \frac{1}{2}\). The property is algebraically verified.
Now, let’s verify the property using R:
# define first complex number
cNum1 <- 1/4 + 2i/3
# define second complex number
cNum2 <- 1/4 - 2i/3
# add the two complex numbers
cNum1 + cNum2
## [1] 0.5+0i
# express the real part as a fraction
fractions(Re(cNum1 + cNum2))
## [1] 1/2
Thus, the algebraic solution and the R solution agree
that \(\left(\frac{1}{4} + \frac{2}{3}i\right)
+ \left(\frac{1}{4} - \frac{2}{3}i\right) = \frac{1}{2} =
2\left(\frac{1}{4}\right) = 2a\).
Next, let’s verity the difference of two complex numbers property
using R.
Using the complex number, \(\frac{3}{5} + \frac{2}{7}i\), verify that the difference of a complex number, \(a + bi\), and its complex conjugate, \(a - bi\) is always imaginary and is equal to:
\[ \begin{align} (a + bi) - (a - bi) &= 2bi \end{align} \]
For the given complex number, \(\frac{3}{5} + \frac{2}{7}i\), \(b = \frac{2}{7}\), let’s first algebraically verify the difference of \(\frac{3}{5} + \frac{2}{7}i\) and its complex conjugate, \(\frac{3}{5} - \frac{2}{7}i\) equals \(2bi\):
\[ \begin{align} \left(\frac{3}{5} + \frac{2}{7}i\right) - \left(\frac{3}{5} - \frac{2}{7}i\right) &= \left(\frac{3}{5} + \frac{2}{7}i\right) + (-1)\left(\frac{3}{5} - \frac{2}{7}i\right) \\ \\ &= \left(\frac{3}{5} + \frac{2}{7}i\right) + \left(-\frac{3}{5} + \frac{2}{7}i\right) \\ \\ &= \left(\frac{3}{5} - \frac{3}{5}\right) + \left(\frac{2}{7}i + \frac{2}{7}i\right) \\ \\ &= 0 + \frac{4}{7}i = \frac{4}{7}i \end{align} \]
Given \(\frac{3}{5} + \frac{2}{7}i\), \(b = \frac{2}{7}\). Thus, \(2bi = 2\left(\frac{2}{7}\right)i = \frac{4}{7}i\). The property is algebraically verified.
Now, let’s verify the property using R:
# define first complex number
cNum1 <- 3/5 + 2i/7
# define second complex number
cNum2 <- 3/5 - 2i/7
# take the difference of the two complex numbers
cNum1 - cNum2
## [1] 0+0.5714286i
# express the imaginary part as a fraction
fractions(Im(cNum1 - cNum2))
## [1] 4/7
Thus, the algebraic solution and the R solution agree
that \(\left(\frac{3}{5} + \frac{2}{7}i\right)
- \left(\frac{3}{5} - \frac{2}{7}i\right) = \frac{4}{7}i =
2\left(\frac{1}{7}\right)i = 2bi\).
Finally, let’s verity the product of two complex numbers property
using R.
Using the complex number, \(\frac{4}{9} - \frac{5}{11}i\), verify that the product of a complex number, \(a + bi\), and its complex conjugate, \(a - bi\) is always real and is equal to:
\[ \begin{align} (a + bi)(a - bi) &= a^{2} + b^{2} \end{align} \]
For the given complex number, \(\frac{4}{9} - \frac{5}{11}i\), \(a = \frac{4}{9}\) and \(b = -\frac{5}{11}\), let’s first algebraically verify the product of \(\frac{4}{9} - \frac{5}{11}i\) and its complex conjugate, \(\frac{4}{9} + \frac{5}{11}i\) equals \(a^{2} + b^{2}\):
\[ \begin{align} \left(\frac{4}{9} - \frac{5}{11}i\right)\left(\frac{4}{9} + \frac{5}{11}i\right) &= \left(\frac{4}{9}\right)\left(\frac{4}{9}\right) + \left(\frac{4}{9}\right)\left(\frac{5}{11}\right)i - \left(\frac{4}{9}\right)\left(\frac{5}{11}\right)i - \left(\frac{5}{11}\right)\left(\frac{5}{11}\right)i^{2} \\ \\ &= \frac{16}{81} - \frac{25}{121}i^{2} \\ \\ &= \frac{16}{81} + \frac{25}{121} \\ \\ &= \frac{16(121) + 25(81)}{(81)(121)} \\ \\ &= \frac{1936 + 2025}{9801} \\ \\ &= \frac{3961}{9801} \end{align} \]
Given that \(a = \frac{4}{9}\) and \(b = -\frac{5}{11}\), then \(a^{2} + b^{2} = \left(\frac{4}{9}\right)^{2} + \left(-\frac{5}{11}\right)^{2} = \frac{3961}{9801}\). The property is algebraically verified.
Now, let’s verify the property using R:
# define first complex number
cNum1 <- 4/9 - 5i/11
# define second complex number
cNum2 <- 4/9 + 5i/11
# take the product of the two complex numbers
cNum1 * cNum2
## [1] 0.4041424+0i
# express the imaginary part as a fraction
fractions(Re(cNum1 * cNum2))
## [1] 3961/9801
Thus, the algebraic solution and the R solution agree
that \(\left(\frac{4}{9} -
\frac{5}{11}i\right)\left(\frac{4}{9} + \frac{5}{11}i\right) =
\frac{3961}{9801} = \left(\frac{4}{9}\right)^{2} +
\left(-\frac{5}{11}\right)^{2} = a^{2} + b^{2}\).
In this appendix we explored how some of these ideas of complex
numbers are handled in a practical, applied sense using R
as well as how they can be used to verify the concepts developed in
Chapter ??, Complex Numbers.
R CodeThe self-developed R routine,
rootFindingProcess.R, was used in this appendix. See
Appendix Root Finding for a complete description and
for the R code.
What follows is the R code which generated the complex
plot in Example ??.5, presented here to provide an
example of how to create a complex plot in R.
#
# create the plot of the roots of the function f(x) = x^4 - 6x^3 + 6x^2 + 34x - 195
# requires libraries ggplot2 and latex2exp
#
# define the roots and their source
theRoots <- c(-3,5,2+3i,2-3i)
theSource <- c('Real Root: -3','Real Root: 5','Complex Root: 2 + 3i','Complex Root: 2 - 3i')
# create a data frame of the roots and their type
roots_df <- data.frame(
Real = Re(theRoots),
Imaginary = Im(theRoots),
Type = ifelse(Im(theRoots) == 0, "Real", "Complex"),
funcRoots = theSource
)
#
# create the plot object for the roots and their associated types
p <- ggplot(roots_df, aes(x = Real, y = Imaginary, color = funcRoots))
p <- p + geom_point(size = 4)
# insert the x- and y-axes
p <- p + geom_hline(yintercept = 0, linetype = "dashed", color = "black")
p <- p + geom_vline(xintercept = 0, linetype = "dashed", color = "black")
# define the plot title, subtitle, and caption
p <- p + labs(title = TeX(r"($f(x) = x^{4} - 6x^{3} + 6x^{2} + 34x - 195$)"),
subtitle = TeX(r"(Plot of Real and Complex Roots)"),
caption = TeX(r"(Roots: $x = -3$, $x = 5$, $x = 2 + 3i$, and $x = 2 - 3i$)"))
# label the axes
p <- p + xlab('Real Axis')
p <- p + ylab('Imaginary Axis')
# annotate the points with their respective ordered pairs
p <- p + annotate("text", x = -3, y = -0.5,
label = TeX(r"($(-3,0)$)"),color='blue',size = 4)
p <- p + annotate("text", x = 5, y = -0.5,
label = TeX(r"($(5,0)$)"),color='red',size = 4)
p <- p + annotate("text", x = 2, y = 3.5,
label = TeX(r"($(2,3)$)"),color='purple',size = 4)
p <- p + annotate("text", x = 2, y = -2.5,
label = TeX(r"($(2,-3)$)"),color='darkgreen',size = 4)
# associate colors to the points
p <- p + scale_color_manual(values = c("Real Root: -3" = "blue",
"Real Root: 5" = "red",
'Complex Root: 2 + 3i' = "purple",
'Complex Root: 2 - 3i' = 'darkgreen'))
# define plot theme information
p <- p + theme_minimal()
p <- p + theme(plot.title = element_text(hjust = 0.5),
plot.subtitle = element_text(hjust = 0.5),
plot.caption = element_text(hjust = 0.5),
legend.position="right")
# set scale of the axes
p <- p + scale_x_continuous(breaks = seq(-4, 6, by = 1))
p <- p + scale_y_continuous(breaks = seq(-4, 5, by = 1))
p <- p + coord_fixed(ratio = 1, xlim = c(-4,6), ylim = c(-4,5))
# display the plot (object)
p
In Chapter ??, we explored the concepts of root finding. Root finding is extremely important and has applicability in a variety of applications and mathematical areas. In essence, there are three use cases, or contexts, where root finding plays a vital role. The first is when you have some function, \(f(x)\), and you are interested in understanding when the output of the function is zero; i.e., when \(f(x) = 0\). The second is when you have some function, \(f(x)\), and you are interested in knowing when the output of the function is some specific value; i.e., when \(f(x) = k\), where \(k\) is some value. And, the third is when you have two functions, \(f(x)\) and \(g(x)\), are interested in when the output of \(f(x)\) equals the output of \(g(x)\); i.e., \(f(x) = g(x)\).
In practice, we can generalize the root finding process to \(f(x) = g(x)\), which gets algebraically manipulated to \(f(x) - g(x) = 0\). If \(g(x) = 0\), then this is the first form, \(f(x) = 0\). If \(g(x) = k\), then this is the second form, \(f(x) = k\). If \(g(x)\) is any other polynomial then this is of the form, \(f(x) - g(x) = 0\).
All these ideas were explored from a mathematical (algebraic) perspective in Chapter ??. 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. To accomplish this a two pronged approach will be taken.
The first approach is to use a self-developed routine,
rootFindingProcess.R, to show the root finding theorems at
work and how real the material presented in Chapter
?? is, especially the root finding process. At
the same time, it will highlight some of the limitations that one might
encounter. The second approach is to explore root finding using the
R package PolynomF.
Why do both? There are enormous benefits to the learning process by doing self implementation of algorithms, theorems, etc. You can understand an algorithm, theorem, etc. at a conceptual level, which is good!, but you get intimately familiar with them only by doing the implementation, or at least stepping through some examples by hand. Also, it is a good practice, at least one that I impose on myself, to not trust a canned library, app, or whatever, before verifying it works correctly. That verification can come via worked through examples or, and most preferably, do the actual implementation yourself, if at all practically possible.
And, finally, since there is a direct relationship between roots and
factors per the Factor Theorem, in this appendix we
will look at how through the use of the root finding process, a
polynomial of any degree can be factored. The self-developed routine,
rootFindingProcess.R and the R package
PolynomF will be used.
rootFindingProcess.RWhether seeking the solution to \(f(x) = 0\) or \(f(x) = k\) or \(f(x) = g(x)\), these are all root finding problems. Focusing on polynomials with integer coefficients, we saw in Chapter ?? that there was a high-level process that assisted in this endeavor:
The process itself is not difficult, or complicated, but it can be laborious to search through a potentially long list of possible rational roots and doing the division \(\frac{f(x)}{x-c}\) (even when using synthetic division) for each possible root, etc. This is where software which implements the process can be quite helpful.
A self-developed routine, rootFindingProcess.R, was
created to implement this root finding process
step-by-step. It was designed using the above mentioned
root finding process generalization. That is, always
start with \(f(x) = g(x)\), and then
algebraically manipulate to form \(f(x) - g(x)
= 0\). Routine rootFindingProcess.R is the main
driver of the root finding process and makes use of the other
self-developed routines developed specifically for each step in the
process: getPosRatlRoots.R, findRatlRoots.R,
syntheticDiv.R, and solveQuadratic.R. It also
makes use of supplemental self-developed routines to either support the
process or enhance user output information; these include
combineCoeffs.R, coeffsToPoly.R, and
formFactor.R. (See Section ??.??,
R Code below for the actual code).
Before looking at some specific examples of the use of
rootFindingProcess.R to explore the root finding concepts
discussed in Chapter ??, let’s see how it is invoked.
Remembering that the routine was designed to handle the root
finding process generalization, \(f(x) = g(x)\), where each is any degree
\(n\) polynomial with integer
coefficients, rootFindingProcess.R accepts two input
parameters, fCoeffs and gCoeffs (there
are two others but they are not relevant to the discussion here). The
first parameter, fCoeffs, is a list of
the coefficients of \(f(x)\). The
second parameter, gCoeffs, is a list
of the coefficients of \(g(x)\). For
example:
rootFindingProcess(c(2,4,1,0,3), c())
rootFindingProcess.R will use to apply the root
finding processc(0), so if just interested in \(f(x) = 0\), there is no need to specify the
coefficients of \(g(x)\). The routine
could simply be invoked as
rootFindingProcess(c(2,4,1,0,3))rootFindingProcess(c(-5,0,3,0,-7), c(-2))
rootFindingProcess.R will use to apply the root
finding processrootFindingProcess(c(1,3,2,1), c(-1,3 5))
rootFindingProcess.R will use to apply the root
finding processThe output of rootFindingProcess.R is self-explanatory
showing how it proceeded through the root finding process.
Now, let’s look at some specific examples of the use of
rootFindingProcess.R to explore the root finding concepts
and process discussed in Chapter ??. Specifically:
rootFindingProcess.R in the root finding process. This
example of the kind \(f(x) = 0\).rootFindingProcess.R is designed around the versatile
approach to root finding, \(f(x) =
g(x)\), which leads to the root finding
polynomial, \(f(x) - g(x) =
0\). The above examples highlight the root finding process in its
general form, that is when we are just looking for \(f(x) = 0\), meaning that the root finding
polynomial was just \(f(x)\).rootFindingProcess.R
formed the root finding polynomial, \(f(x) - k
= 0\) and proceeded to find the roots of this root finding
polynomial, which are the value(s) of \(x\) are which would cause the output of
\(f(x)\) to be \(k\).rootFindingProcess.R formed the root finding polynomial,
\(f(x) - g(x) = 0\) and proceeded to
find the roots of this root finding polynomial, which are the value(s)
of \(x\) are which would cause the
outputs of \(f(x)\) and \(g(x)\) to be equal. The roots found were
both rational and complex.rootFindingProcess.R.rootFindingProcess.R.Given \(f(x) = 6x^{3} + 13x^{2} + 2x - 5\), we are interested in understanding when the output of \(f(x)\) is zero. This is a root finding case of \(f(x) = 0\). Given \(f(x)\) is a degree \(3\) polynomial this means that by the Fundamental Theorem of Algebra there will be three roots, which may or may not all be real nor unique.
Let’s first take a look at the graph of \(f(x)\).
From the graph it appears that there are roots at what looks to be
\(x = -\frac{5}{3}\), \(x = -1\), and \(x
= \frac{1}{2}\). Let’s invoke rootFindingProcess.R
to see what are really the roots.
rootFindingProcess(c(6,13,2,-5))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = 6*x^3 + 13*x^2 + 2*x - 5"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = 6*x^3 + 13*x^2 + 2*x - 5"
## [1] "Degree of polynomial: 3"
## [1] "By the FTA a total of 3 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 5/6 -5/6 5/3 -5/3 5/2 -5/2 5 -5 1/6 -1/6 1/3 -1/3 1/2 -1/2 1
## [16] -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] -5/3 1/2 -1
## [1] "Total Roots Found: 3"
## [1] "All Roots Found!"
rootFindingProcess.R found all \(3\) of the guaranteed roots solely via the
use of the Rational Root Theorem and they were all
unique and rational: \(x = -\frac{5}{3}\), \(x = -1\), and \(x
= \frac{1}{2}\). Therefore the output of \(f(x) = 6x^{3} + 13x^{2} + 2x - 5\) is \(0\) at \(x =
-\frac{5}{3}\), \(x = -1\), and
\(x = \frac{1}{2}\).
Just to be sure that the roots found by
rootFindingProcess.R, \(x =
-\frac{5}{3}\), \(x = -1\), and
\(x = \frac{1}{2}\), are indeed the
roots, let’s evaluate the polynomial, \(f(x) =
6x^{3} + 13x^{2} + 2x - 5\), at each of these roots. The
expectation is that the output of the function evaluated at
each root will be zero (which is what it means to
be a root!). First, let’s evaluate the function at \(x = -\frac{5}{3}\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){6*x^3 + 13*x^2 + 2*x - 5}
# evaluate f(x) at x = -5/3; i.e., f(-5/3)
fractions(fFunc(-5/3))
## [1] 0
Indeed, \(f(x) = 6x^{3} + 13x^{2} + 2x - 5\) evaluated at \(x = -\frac{5}{3}\) equals \(0\)! Now, let’s evaluate the function at \(x = -1\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){6*x^3 + 13*x^2 + 2*x - 5}
# evaluate f(x) at x = 1; i.e., f(-1)
fractions(fFunc(-1))
## [1] 0
Indeed, \(f(x) = 6x^{3} + 13x^{2} + 2x - 5\) evaluated at \(x = -1\) equals \(0\)! And now, let’s evaluate the function at \(x = \frac{1}{2}\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){6*x^3 + 13*x^2 + 2*x - 5}
# evaluate f(x) at x = 1/2; i.e., f(1/2)
fractions(fFunc(1/2))
## [1] 0
Indeed, \(f(x) = 6x^{3} + 13x^{2} + 2x - 5\) evaluated at \(x = \frac{1}{2}\) equals \(0\)!
All three roots of \(f(x) = 6x^{3} +
13x^{2} + 2x - 5\) as reported by
rootFindingProcess.R have been verified.
Given \(f(x) = x^{7} + 3x^{6} - 2x^{5} - 10x^{4} + x^{3} + 11x^{2} - 4\), we are interested in understanding when the output of \(f(x)\) is zero. This is a root finding case of \(f(x) = 0\). Given \(f(x)\) is a degree \(7\) polynomial this means that by the Fundamental Theorem of Algebra there will be seven roots, which may or may not all be real nor unique, though since it is an odd degree polynomial, it is guaranteed that there will be at least one real root, maybe not rational, but real.
Let’s first take a look at the graph of \(f(x)\).
From the graph it appears that there are three
roots. One root at \(x = -2\), one at
\(x = -1\), and one at \(x = 1\). There are \(4\) unaccounted roots. Let’s invoke
rootFindingProcess.R to see what are really the roots.
rootFindingProcess(c(1,3,-2,-10,1,11,0,-4))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^7 + 3*x^6 - 2*x^5 - 10*x^4 + x^3 + 11*x^2 - 4"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^7 + 3*x^6 - 2*x^5 - 10*x^4 + x^3 + 11*x^2 - 4"
## [1] "Degree of polynomial: 7"
## [1] "By the FTA a total of 7 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 4 -4 2 -2 1 -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] -2 -2 1 1 1 -1 -1
## [1] "Total Roots Found: 7"
## [1] "All Roots Found!"
rootFindingProcess.R found all \(7\) of the guaranteed roots solely via the
use of the Rational Root Theorem. They were all
rational, but were not all unique. The root \(x = -2\) had a
multiplicity of \(2\);
the root \(x = 1\) had a
multiplicity of \(3\);
and, the root \(x = -1\) had a
multiplicity of \(2\).
Summing these multiplicities, we get \(7\), which is what is guaranteed by the FTA
to be the number of roots, so we can be assured that all the roots were
found. This highlights the idea that a graph alone is not sufficient to
identify all roots, especially those with a multiplicity greater than
one.
Just to be sure that the roots found by
rootFindingProcess.R, \(x =
-2\), \(x = -1\), and \(x = 1\), are indeed the roots, let’s
evaluate the polynomial, \(f(x) = x^{7} +
3x^{6} - 2x^{5} - 10x^{4} + x^{3} + 11x^{2} - 4\), at each of
these roots. The expectation is that the output of the function
evaluated at each root will be zero (which is what
it means to be a root!). First, let’s evaluate the function at
\(x = -2\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^7 + 3*x^6 - 2*x^5 - 10*x^4 + x^3 + 11*x^2 - 4}
# evaluate f(x) at x = -2; i.e., f(-2)
fractions(fFunc(-2))
## [1] 0
Indeed, \(f(x) = x^{7} + 3x^{6} - 2x^{5} - 10x^{4} + x^{3} + 11x^{2} - 4\) evaluated at \(x = -2\) equals \(0\)! Now, let’s evaluate the function at \(x = -1\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^7 + 3*x^6 - 2*x^5 - 10*x^4 + x^3 + 11*x^2 - 4}
# evaluate f(x) at x = -1; i.e., f(-1)
fractions(fFunc(-1))
## [1] 0
Indeed, \(f(x) = x^{7} + 3x^{6} - 2x^{5} - 10x^{4} + x^{3} + 11x^{2} - 4\) evaluated at \(x = -1\) equals \(0\)! And now, let’s evaluate the function at \(x = 1\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^7 + 3*x^6 - 2*x^5 - 10*x^4 + x^3 + 11*x^2 - 4}
# evaluate f(x) at x = 1; i.e., f(1)
fractions(fFunc(1))
## [1] 0
Indeed, \(f(x) = x^{7} + 3x^{6} - 2x^{5} - 10x^{4} + x^{3} + 11x^{2} - 4\) evaluated at \(x = 1\) equals \(0\)!
The three reported roots, ignoring multiplicity were verified,
produced an output of zero when \(f(x)\) was evaluated at each. Given the
multiplicities sum to \(7\)
and the fact that \(7\) roots were found as guaranteed by the
FTA, we can safely say that all \(7\)
roots of \(f(x) = x^{7} + 3x^{6} - 2x^{5} -
10x^{4} + x^{3} + 11x^{2} - 4\) as reported by
rootFindingProcess.R have been verified. (Evaluating
each root multiple times would be an exercise in futility, for no matter
how many times we evaluated \(f(x)\) at
one of these roots it would always produce an output of \(0\).)
Given \(f(x) = 4x^{4} - 9x^{3} + 19x^{2} + x - 15\), we are interested in understanding when the output of \(f(x)\) is zero. This is a root finding case of \(f(x) = 0\). Given \(f(x)\) is a degree \(4\) polynomial this means that by the Fundamental Theorem of Algebra there will be four roots, which may or may not all be real nor unique.
Let’s first take a look at the graph of \(f(x)\).
From the graph it appears that there are \(2\) roots. One root at \(x = -\frac{3}{4}\) and one at \(x = 1\). There are \(2\) unaccounted roots. Let’s invoke
rootFindingProcess.R to see what are really the roots.
rootFindingProcess(c(4,-9,19,1,-15))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = 4*x^4 - 9*x^3 + 19*x^2 + x - 15"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = 4*x^4 - 9*x^3 + 19*x^2 + x - 15"
## [1] "Degree of polynomial: 4"
## [1] "By the FTA a total of 4 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 15/4 -15/4 15/2 -15/2 15 -15 5/4 -5/4 5/2 -5/2 5 -5
## [13] 3/4 -3/4 3/2 -3/2 3 -3 1/4 -1/4 1/2 -1/2 1 -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] -3/4 1
## [1] "The Roots Found By The Quadratic Formula:"
## [1] 1-2i 1+2i
## [1] "Total Roots Found: 4"
## [1] "All Roots Found!"
rootFindingProcess.R found \(2\) of the guaranteed roots via the use of
the Rational Root Theorem. Each time a root was found
using the Remainder Theorem, the resulting polynomial
was reduced by one. Thus, after these two roots were found, the
remaining degree of the polynomial was \(2\), a quadratic. This means that the
quadratic formula could be used. That’s exactly what
rootFindingProcess.R did. The roots of the quadratic turned
out to be complex, \(x = 1 + 2i\), and
\(x = 1 - 2i\). Notice that these roots
are complex conjugates which is what the Complex Conjugate
Theorem guaranteed. All \(4\)
roots that were guaranteed to exist by the FTA have now been found. This
highlights, again, the idea that a graph alone is not sufficient to
identify all roots, complex roots will not be visible. Here is the
complex plot which shows all \(4\)
roots, real and complex:
Just to be sure that the roots found by
rootFindingProcess.R, \(x=-\frac{3}{4}\), \(x = 1\), \(x = 1
+ 2i\) and \(x = 1-2i\), are
indeed the roots, let’s evaluate the polynomial, \(f(x) = 4x^{4} - 9x^{3} + 19x^{2} + x -
15\), at each of these roots. The expectation is that the output
of the function evaluated at each root will be zero
(which is what it means to be a root!). First, let’s evaluate
the function at \(x =
-\frac{3}{4}\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){4*x^4 - 9*x^3 + 19*x^2 + x - 15}
# evaluate f(x) at x = -3/4; i.e., f(-3/4)
fractions(fFunc(-3/4))
## [1] 0
Indeed, \(f(x) = 4x^{4} - 9x^{3} + 19x^{2} + x - 15\) evaluated at \(x = -\frac{3}{4}\) equals \(0\)! Now, let’s evaluate the function at \(x = 1\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){4*x^4 - 9*x^3 + 19*x^2 + x - 15}
# evaluate f(x) at x = 1; i.e., f(1)
fractions(fFunc(1))
## [1] 0
Indeed, \(f(x) = 4x^{4} - 9x^{3} + 19x^{2} + x - 15\) evaluated at \(x = 1\) equals \(0\)! Now, let’s evaluate the function at \(x = 1+2i\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){4*x^4 - 9*x^3 + 19*x^2 + x - 15}
# evaluate f(x) at x = 1+2i; i.e., f(1+2i)
fFunc(1+2i)
## [1] 0+0i
Indeed, \(f(x) = 4x^{4} - 9x^{3} + 19x^{2} + x - 15\) evaluated at \(x = 1+2i\) equals \(0\)! This highlights the important idea that we’re interested in at what value of the input is the function’s output zero, not where it necessarily crosses the x-axis! Now, let’s evaluate the function at \(x = 1-2i\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){4*x^4 - 9*x^3 + 19*x^2 + x - 15}
# evaluate f(x) at x = 1-2i; i.e., f(1-2i)
fFunc(1-2i)
## [1] 0+0i
Indeed, \(f(x) = 4x^{4} - 9x^{3} + 19x^{2} + x - 15\) evaluated at \(x = 1-2i\) equals \(0\)!
All four roots of \(f(x) = 4x^{4} - 9x^{3}
+ 19x^{2} + x - 15\) as reported by
rootFindingProcess.R have been verified. Two of which were
rational, two which were complex.
Given \(f(x) = x^{4} + 5x^{2} + 4\), we are interested in understanding when the output of \(f(x)\) is zero. This is a root finding case of \(f(x) = 0\). Given \(f(x)\) is a degree \(4\) polynomial this means that by the Fundamental Theorem of Algebra there will be four roots, which may or may not all be real nor unique.
Let’s first take a look at the graph of \(f(x)\).
From the graph it appears that there are no real
roots. Let’s invoke rootFindingProcess.R to see what are
really the roots.
rootFindingProcess(c(1,0,5,0,4))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^4 + 5*x^2 + 4"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^4 + 5*x^2 + 4"
## [1] "Degree of polynomial: 4"
## [1] "By the FTA a total of 4 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 4 -4 2 -2 1 -1
## [1] "No Rational Roots Found"
## [1] "Total Roots Found: 0"
## [1] "Roots Left To Find: 4"
The results from rootFindingProcess.R indicate that
no rational roots exist, meaning that all the possible
rational roots identified (via the Rational Root
Theorem) did not produce a \(0\) when the division \(\frac{f(x)}{x-c}\) was performed. This
means the four guaranteed roots must be non rational, complex, or both.
Since the degree four polynomial was not able to be reduced to a degree
two (where the quadratic formula could be invoked) and no other
information was provided, rootFindingProcess.R (or
the root finding process) was unable to identify any of the roots. As
mentioned, the graph shows that there are no real roots which implies
that the \(4\) guaranteed roots must be
complex.
This example highlights some of the limitations that one might encounter using the, as defined, root finding process. With no rational roots found, the process was unable to reduce the polynomial to a degree two. The means to identify the roots were not available implying that some alternative method must be used.
This example will be revisited again in the next example, and again later in Example ??.??.
In this example, we will take another look at \(f(x) = x^{4} + 5x^{2} + 4\) presented above in Example ??.4. It was found that this degree \(4\) polynomial, of which it is guaranteed by the FTA to have \(4\) roots, had no rational roots, thus causing the, as defined, root finding process to be unable to identify any roots. This is a limitation of the root finding process as defined. One reason for this is that there was no other information available.
Let’s see what would happen if there was additional information given, namely that \(i\) is known to be a root. There are alternative scenarios that could be used with this newly given information. One approach, as was discussed in Chapter ??, would be to apply the Complex Conjugate Theorem to conclude that \(-i\) is also a root. From the Factor Theorem we know that \((x - i)\) and \((x + i)\) are factors of \(f(x) = x^{4} + 5x^{2} + 4\). Multiplying these two factors together then dividing \(f(x)\) by this degree \(2\) product would would result in a degree \(2\) polynomial upon which the quadratic formula could be applied to find the remaining \(2\) guaranteed roots.
The approach here, however, is to remain true to the root finding
process. Knowing that \(i\) is a root,
this means that applying the Remainder Theorem by
dividing \(f(x) = x^{4} + 5x^{2} + 4\)
by \(x - i\) should have a remainder of
zero. Using synthetic division to do this division, we
will acquire the coefficients of the remaining degree \(3\) polynomial. Using the self-developed
routine, syntheticDiv.R (which is part of
rootFindingProcess.R), we would find:
deg3Coeffs <- syntheticDiv(0+1i,c(1,0,5,0,4))
deg3Coeffs
## [1] 1+0i 0+1i 4+0i 0+4i 0+0i
The remaining degree \(3\) polynomial is \(x^{3} + ix^{2} + 4x + 4i\). Now, making use of the fact that \(-i\) is also a root (again, from the Complex Conjugate Theorem) we can divide this polynomial by \(x + i\) via synthetic division to get the remaining degree \(2\) polynomial:
deg2Coeffs <- syntheticDiv(0-1i,deg3Coeffs[1:4])
deg2Coeffs
## [1] 1+0i 0+0i 4+0i 0+0i
The remaining degree \(2\) polynomial is \(x^{2} + 4\). We can now apply the root finding process to this remaining polynomial:
# make sure the coefficients are no longer of a complex data type, extract just the real component of
# a complex number
rootFindingProcess(Re(deg2Coeffs[1:3]))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^2 + 4"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^2 + 4"
## [1] "Degree of polynomial: 2"
## [1] "By the FTA a total of 2 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 4 -4 2 -2 1 -1
## [1] "No Rational Roots Found"
## [1] "The Roots Found By The Quadratic Formula:"
## [1] 0+2i 0-2i
## [1] "Total Roots Found: 2"
## [1] "All Roots Found!"
Voila. We now have the remaining two roots, \(x = 2i\) and \(x = -2i\).
Thus, the roots of \(f(x) = x^{4} + 5x^{2} + 4\) are \(x = i\), \(x = -i\), \(x = 2i\), and \(x = -2i\). These roots were not visible in the graph of \(f(x) = x^{4} + 5x^{2} + 4\) above, but they certainly would be in the complex plot:
We used the root finding process to find the
remaining two roots to highlight that the process works even for a
degree \(2\) polynomial with no real
roots. That said, after we had obtained the remaining degree \(2\) polynomial we could have just called
the self-developed routine solveQuadratic.R (which is
part of rootFindingProcess.R):
solveQuadratic(Re(deg2Coeffs[1:3]))
## [1] 0+2i 0-2i
This example highlighted how to apply the root finding process and all the concepts associated with it when faced with limitations that did not allow the finding of the roots. That said, it required that some additional information be given or known in advance.
This example will be revisited again in the next example, and again later in Example ??.??.
Given \(f(x) = x^{4} - 5x^{2} + 6\), we are interested in understanding when the output of \(f(x)\) is \(2\). This is a root finding case of \(f(x) = k\), where \(k = 2\). If we let \(g(x) = 2\), then \(f(x) - g(x) = f(x) - 2\). This becomes the root finding polynomial \(x^{4} - 5x^{2} + 4\). Applying the root finding process to \(x^{4} - 5x^{2} + 4 = 0\), the roots will be where the output of \(f(x) = x^{4} - 5x^{2} + 6\) is \(2\). By the Fundamental Theorem of Algebra there will be four roots, which may or may not all be real nor unique.
Let’s first take a look at the graph of \(f(x) = x^{4} - 5x^{2} + 6\).
From the graph it appears that where the output of \(f(x)\) is \(2\) happens at \(4\) values of \(x\), \(x = -2\), \(x = 2\), \(x = -1\), and \(x = 1\). These should be the roots of the root finding polynomial \(x^{4} - 5x^{2} + 4\).
Let’s look at the graph of the root finding polynomial \(x^{4} - 5x^{2} + 4\):
From the graph it appears that roots of the root finding polynomial
are \(x = -2\), \(x = 2\), \(x =
-1\), and \(x = 1\). These are
in agreement with what appeared to be the values of \(x\) that would cause the output of \(f(x) = x^{4} - 5x^{2} + 6\) to be \(2\). Let’s invoke
rootFindingProcess.R to see what are really the roots. To
do so we need to specify the coefficients of \(f(x)\) and the
coefficients of \(g(x)\).
rootFindingProcess.R will algebraically determine \(f(x) - g(x)\), the root finding polynomial,
for which the roots will be found.
# Specify the coefficients of f(x) and g(x)
rootFindingProcess(c(1,0,-5,0,6),c(2))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^4 - 5*x^2 + 6"
## [1] "Polynomial g(x)"
## [1] "g(x) = 2"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^4 - 5*x^2 + 4"
## [1] "Degree of polynomial: 4"
## [1] "By the FTA a total of 4 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 4 -4 2 -2 1 -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] 2 -2 1 -1
## [1] "Total Roots Found: 4"
## [1] "All Roots Found!"
The results from rootFindingProcess.R indicate that
\(x = -2\), \(x = 2\), \(x =
-1\), and \(x = 1\) are indeed
the roots of the root find polynomial. This would imply, therefore, that
these should be the input values to \(f(x) =
x^{4} - 5x^{2} + 6\) which would produce an output of \(2\). Let’s verify that starting with \(x = -2\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^4 - 5*x^2 + 6}
# evaluate f(x) at x = -2; i.e., f(-2)
fFunc(-2)
## [1] 2
The output of the function, \(f(x) = x^{4} - 5x^{2} + 6\), evaluated at \(x = -2\) is indeed \(2\). Next, let’s verify \(x = 2\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^4 - 5*x^2 + 6}
# evaluate f(x) at x = 2; i.e., f(2)
fFunc(2)
## [1] 2
The output of the function, \(f(x) = x^{4} - 5x^{2} + 6\), evaluated at \(x = 2\) is indeed \(2\). Next, let’s verify \(x = -1\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^4 - 5*x^2 + 6}
# evaluate f(x) at x = -1; i.e., f(-1)
fFunc(-1)
## [1] 2
The output of the function, \(f(x) = x^{4} - 5x^{2} + 6\), evaluated at \(x = -1\) is indeed \(2\). Next, let’s verify \(x = 1\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^4 - 5*x^2 + 6}
# evaluate f(x) at x = 1; i.e., f(1)
fFunc(1)
## [1] 2
The output of the function, \(f(x) = x^{4} - 5x^{2} + 6\), evaluated at \(x = 1\) is indeed \(2\).
All four roots of the root finding polynomial \(x^{4} - 5x^{2} + 4\) have been verified that at these roots that the function, \(f(x) = x^{4} - 5x^{2} + 6\), will produce an output of \(2\).
Given \(f(x) = x^{4} - x^{2} - 1\), we are interested in understanding when the output of \(f(x)\) equals that of \(g(x) = -x^{3} - x + 1\). This is a root finding case of \(f(x) = g(x)\). This becomes the root finding polynomial \(f(x) - g(x) = x^{4} + x^{3} - x^{2} + x - 2\). Applying the root finding process to this root finding polynomial, the roots will be where the output of \(f(x)\) equals that of \(g(x)\), or where the graphs of the two functions intersect. By the Fundamental Theorem of Algebra there will be four roots, which may or may not all be real nor unique.
Let’s first take a look at the graph of the two functions, \(f(x) =x^{4} - x^{2} - 1\) and \(g(x) = -x^{3} - x + 1\).
From the graph it appears that where the output of \(f(x)\) equals that of \(g(x)\) (points of intersection) are at the values of \(x = -2\) and \(x = 1\). These should be the roots of the root finding polynomial \(f(x) - g(x) = x^{4} + x^{3} - x^{2} + x - 2\).
Let’s look at the graph of the root finding polynomial \(f(x) - g(x) = x^{4} + x^{3} - x^{2} + x - 2\):
From the graph it appears that the roots of the root finding
polynomial are \(x = -2\), and \(x = 1\). These are in agreement with what
appeared to be the values of \(x\) that
would cause the output of \(f(x)\) to
equal that of \(g(x)\). Let’s invoke
rootFindingProcess.R to see what are really the roots. To
do so we need to specify the coefficients of \(f(x)\) and the
coefficients of \(g(x)\).
rootFindingProcess.R will algebraically determine \(f(x) - g(x)\), the root finding polynomial,
for which the roots will be found.
# Specify the coefficients of f(x) and g(x)
rootFindingProcess(c(1,0,-1,0,-1),c(-1,0,-1,1))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^4 - x^2 - 1"
## [1] "Polynomial g(x)"
## [1] "g(x) = -x^3 - x + 1"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^4 + x^3 - x^2 + x - 2"
## [1] "Degree of polynomial: 4"
## [1] "By the FTA a total of 4 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 2 -2 1 -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] -2 1
## [1] "The Roots Found By The Quadratic Formula:"
## [1] 0+1i 0-1i
## [1] "Total Roots Found: 4"
## [1] "All Roots Found!"
The results from rootFindingProcess.R indicate that
\(x = -2\) and \(x = 1\) are indeed the (rational) roots of
the root find polynomial along with two others, \(x = i\) and \(x =
-i\), as guaranteed by the FTA. These other two roots are complex
which, therefore, are not visible in the real plane. That said,
they are still the values of \(x\) at which the outputs of the two
functions are equal. It is within the context of the problem,
or application, as to whether these two roots are significant. Here is
the complex plot showing all four roots, two real and two complex:
Let’s verify that the outputs of the two functions, \(f(x)\) and \(g(x)\) are equal at each of these roots of the root finding polynomial. Let’s verify that starting with \(x = -2\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^4 - x^2 - 1}
# evaluate f(x) at x = -2; i.e., f(-2)
fFunc(-2)
## [1] 11
# define the function g(x) being sure to enter the function using ASCII notation
gFunc <- function(x){-x^3 - x + 1}
# evaluate g(x) at x = -2; i.e., g(-2)
gFunc(-2)
## [1] 11
The two outputs, \(f(-2)\) and \(g(-2)\) equaled \(11\). Next, let’s verify that starting with \(x = 1\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^4 - x^2 - 1}
# evaluate f(x) at x = 1; i.e., f(1)
fFunc(1)
## [1] -1
# define the function g(x) being sure to enter the function using ASCII notation
gFunc <- function(x){-x^3 - x + 1}
# evaluate g(x) at x = 1; i.e., g(1)
gFunc(1)
## [1] -1
The two outputs, \(f(1)\) and \(g(1)\) equaled \(-1\). Next, let’s verify that starting with \(x = i\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^4 - x^2 - 1}
# evaluate f(x) at x = i; i.e., f(i)
fFunc(0+1i)
## [1] 1+0i
# define the function g(x) being sure to enter the function using ASCII notation
gFunc <- function(x){-x^3 - x + 1}
# evaluate g(x) at x = i; i.e., g(i)
gFunc(0+1i)
## [1] 1+0i
The two outputs, \(f(i)\) and \(g(i)\) equaled \(1\). Next, let’s verify that starting with \(x = -i\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^4 - x^2 - 1}
# evaluate f(x) at x = -i; i.e., f(-i)
fFunc(0-1i)
## [1] 1+0i
# define the function g(x) being sure to enter the function using ASCII notation
gFunc <- function(x){-x^3 - x + 1}
# evaluate g(x) at x = -i; i.e., g(-i)
gFunc(0-1i)
## [1] 1+0i
The two outputs, \(f(-i)\) and \(g(-i)\) equaled \(1\).
This example showed how the finding where the outputs of two functions, \(f(x)\) and \(g(x)\), are equal, i.e., \(f(x) = g(x)\), is a root finding case of \(f(x) - g(x) = 0\). The roots of this newly formed function, the root finding polynomial, are the values of \(x\) where the outputs of the two functions are equal. In the real plane, this can be understood to be the points of intersection of the two functions.
Given \(f(x) = x^{3} - 3x + 1\), we are interested in understanding when the output of \(f(x)\) equals that of \(g(x) = -x^{3} + 3x + 6\). This is a root finding case of \(f(x) = g(x)\). This becomes the root finding polynomial \(f(x) - g(x) = 2x^{3} - 6x - 5\). Applying the root finding process to this root finding polynomial, the roots will be where the output of \(f(x)\) equals that of \(g(x)\), or where the graphs of the two functions intersect. By the Fundamental Theorem of Algebra there will be four roots, which may or may not all be real nor unique.
Let’s first take a look at the graph of the two functions, \(f(x) = x^{3} - 3x + 1\) and \(g(x) = -x^{3} + 3x + 6\).
From the graph it appears that where the output of \(f(x)\) equals that of \(g(x)\) (points of intersection) is at a value of \(x\) slightly greater than \(2\). This value of \(x\), whatever it is, should be among the roots of the root finding polynomial \(f(x) - g(x) = 2x^{3} - 6x - 5\).
Let’s look at the graph of the root finding polynomial \(f(x) - g(x) = 2x^{3} - 6x - 5\):
From the graph it appears that roots of the root finding polynomial
is at a value of \(x\) slightly greater
than \(2\). This is in agreement with
what appeared to be the value of \(x\)
that would cause the output of \(f(x)\)
to equal that of \(g(x)\). Let’s invoke
rootFindingProcess.R to see what are really the roots. To
do so we need to specify the coefficients of \(f(x)\) and the
coefficients of \(g(x)\).
rootFindingProcess.R will algebraically determine \(f(x) - g(x)\), the root finding polynomial,
for which the roots will be found.
# Specify the coefficients of f(x) and g(x)
rootFindingProcess(c(1,0,-3,1),c(-1,0,3,6))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^3 - 3*x + 1"
## [1] "Polynomial g(x)"
## [1] "g(x) = -x^3 + 3*x + 6"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = 2*x^3 - 6*x - 5"
## [1] "Degree of polynomial: 3"
## [1] "By the FTA a total of 3 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 5/2 -5/2 5 -5 1/2 -1/2 1 -1
## [1] "No Rational Roots Found"
## [1] "Total Roots Found: 0"
## [1] "Roots Left To Find: 3"
The results from rootFindingProcess.R could
not find any rational roots, and combined with the fact
that no additional information was given, was unable to reduce the
degree \(3\) root finding polynomial,
\(f(x) - g(x) = 2x^{3} - 6x - 5\), to a
quadratic. Yet, by the FTA we are guaranteed that there
are \(3\) roots and understanding how
the implications of the Complex Conjugate Theorem we
are also guaranteed that there is at least one real
root. The graph of the root finding polynomial did indeed show that
there is a real, non rational, root slightly above \(x = 2\). Given this, we can use the
Bisection Method to obtain an estimate of this root.
Let’s invoke the bisectionMethod.R routine for \(f(x) = 2x^{3} - 6x - 5\) in interval \([2,2.25]\) using a tolerance \(\epsilon = 10^{-7}\), displaying the last
\(6\) iterations of the method:
theFunc <- "2*x^3 - 6*x - 5"
aValue <- 2
bValue <- 2.25
tolerance <- 1e-7
numIterations <- 100
toleranceMethod <- 2
df <- bisectionMethod1(theFunc,aValue,bValue,tolerance,toleranceMethod,numIterations)
| i | a | b | c | fOfa | fOfb | fofc | |
|---|---|---|---|---|---|---|---|
| 18 | 18 | 2.053621 | 2.053623 | 2.053622 | -5.5e-06 | 3.13e-05 | 1.29e-05 |
| 19 | 19 | 2.053621 | 2.053622 | 2.053622 | -5.5e-06 | 1.29e-05 | 3.70e-06 |
| 20 | 20 | 2.053621 | 2.053622 | 2.053622 | -5.5e-06 | 3.70e-06 | -9.00e-07 |
| 21 | 21 | 2.053622 | 2.053622 | 2.053622 | -9.0e-07 | 3.70e-06 | 1.40e-06 |
| 22 | 22 | 2.053622 | 2.053622 | 2.053622 | -9.0e-07 | 1.40e-06 | 3.00e-07 |
| 23 | 23 | 2.053622 | 2.053622 | 2.053622 | -9.0e-07 | 3.00e-07 | -3.00e-07 |
The Bisection Method estimated the root to be \(x = 2.053622\). It is at this input value that the outputs of \(f(x)\) and \(g(x)\) are equal. Verifying this:
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^3 - 3*x + 1}
# evaluate f(x) at x = 2.053622; i.e., f(2.053622)
fFunc(2.053622)
## [1] 3.500004
# define the function g(x) being sure to enter the function using ASCII notation
gFunc <- function(x){-x^3 + 3*x + 6}
# evaluate g(x) at x = 2.053622; i.e., g(2.053622)
gFunc(2.053622)
## [1] 3.499996
Cognizant of floating point arithmetic, the two outputs agree that at \(x = 2.053622\) the outputs of the the two functions, \(f(x)\) and \(g(x)\), are equal (\(3.5\) rounded).
The other two roots of the root finding polynomial
must be complex. We can estimate what these are by
using the Remainder Theorem and synthetic
division using the root \(x =
2.053622\) to find the coefficients of the degree \(2\) polynomial that remains and then solve
the quadratic. Invoking syntheticDiv.R and
solveQuadratic.R we get:
deg2Coeffs <- syntheticDiv(2.053622,c(2,0,-6,-5))
deg2Coeffs
## [1] 2.000000e+00 4.107244e+00 2.434727e+00 8.187306e-06
solveQuadratic(Re(deg2Coeffs[1:3]))
## [1] -1.026811+0.40376i -1.026811-0.40376i
Thus, in addition to \(x = 2.053622\), the two function outputs are equal to each other at approximately \(x = -1.02681 + 0.40376i\) and \(x = -1.02681 - 0.40376i\). It is within the context of the problem, or application, as to whether these two complex roots are significant.
This example showed how the finding where the outputs of two functions, \(f(x)\) and \(g(x)\), are equal, i.e., \(f(x) = g(x)\), is a root finding case of \(f(x) - g(x) = 0\). The roots of this newly formed function, the root finding polynomial, are the values of \(x\) where the outputs of the two functions are equal. In the real plane, this can be understood to be the points of intersection of the two functions.
Given \(f(x) = \frac{1}{4}x^{4} - \frac{1}{2}x^{2} + 2x + 1\), find when the function has either a minimum or maximum output value(s).
This is an optimization problem that was introduced in Chapter ?? in the Why You Should Care section.
From that section we learned that at the heart of optimization is the idea that one has a function that is designed for whatever purpose, and one wants to know where the function produces a maximum or minimum output. This is a major application of differential calculus. For the purposes here, assume there is a function, \(f(x)\), that you want to understand where its maximum or minimum output values are. To accomplish this you would find the derivative of the function which is known as \(f'(x)\). (You will learn how to find the derivative of a function in calculus.). Without going into detail, it is sufficient for us here that the derivative represents the slope of the tangent line at any point on the curve of \(f(x)\).
The idea, then, is to set \(f'(x) = 0\), a root finding problem, to find the roots. The slope of the tangent line on the curve of \(f(x)\) will be zero at this value of the root. This implies that the tangent line at this point will be a horizontal line, for he slope of a horizontal line is zero. This all means that the point of a function at which the slope of the tangent line is zero will be either a minimum or maximum of the function.
Let’s explore this idea.
First, let’s look at the graph of \(f(x) = \frac{1}{4}x^{4} - \frac{1}{2}x^{2} + 2x + 1\):
From the graph it is obvious that there is a minimum (we’ll ignore the idea of local versus global here; you will explore these ideas in calculus) somewhere around \(x = -1.5\). To find this value, we need the derivative, \(f'(x)\). For this function, \(f'(x) = x^{3} - x + 2\). Now, we need to find the roots of this function;. i.e., \(f'(x) = 0\). This is root finding problem of the type \(f(x) = 0\), where \(f(x)\) in this case is the derivative function, \(f'(x)\).
Let’s look at the graph of \(f'(x)\):
From the graph it is obvious that \(f'(x) = 0\) at a value of \(x\) somewhere around \(-1.5\). This is consistent with where we expect a minimum output value of \(f(x)\) to be. Given that \(f'(x)\) is a degree \(3\) polynomial we know that there will be \(3\) roots, one guaranteed to be real. The graph confirms that there is one real root. The other two must be complex. This is an example of a contextual problem where the complex roots are not of interest.
Let’s invoke rootFindingProcess.R to see what are really
the roots. To do so we need to specify the coefficients of \(f(x)\) and the
coefficients of \(g(x)\).
rootFindingProcess.R will algebraically determine \(f(x) - g(x)\), the root finding polynomial,
for which the roots will be found.
# Specify the coefficients of f(x) and g(x)
rootFindingProcess(c(1,0,-1,2),c(0))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^3 - x + 2"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^3 - x + 2"
## [1] "Degree of polynomial: 3"
## [1] "By the FTA a total of 3 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 2 -2 1 -1
## [1] "No Rational Roots Found"
## [1] "Total Roots Found: 0"
## [1] "Roots Left To Find: 3"
As expected, rootFindingProcess.R reported that no
rational roots were found. This prevented it from finding any roots for
a degree two polynomial was unobtainable. But, we do
know from the graph that there is a real, a non rational, root somewhere
close to \(x = -1.5\). Given this, we
can use the Bisection Method to obtain an estimate of
this root. Let’s invoke the bisectionMethod.R routine for
\(f'(x) = x^{3} - x + 2\) in
interval \([-2,-1.5]\) using a
tolerance \(\epsilon = 10^{-7}\),
displaying the last \(6\) iterations of
the method:
theFunc <- "x^3 - x + 2"
aValue <- -2
bValue <- -1.5
tolerance <- 1e-7
numIterations <- 100
toleranceMethod <- 2
df <- bisectionMethod1(theFunc,aValue,bValue,tolerance,toleranceMethod,numIterations)
| i | a | b | c | fOfa | fOfb | fofc | |
|---|---|---|---|---|---|---|---|
| 19 | 19 | -1.521381 | -1.52138 | -1.52138 | -9.9e-06 | 1.4e-06 | -4.3e-06 |
| 20 | 20 | -1.521380 | -1.52138 | -1.52138 | -4.3e-06 | 1.4e-06 | -1.4e-06 |
| 21 | 21 | -1.521380 | -1.52138 | -1.52138 | -1.4e-06 | 1.4e-06 | 0.0e+00 |
| 22 | 22 | -1.521380 | -1.52138 | -1.52138 | 0.0e+00 | 1.4e-06 | 7.0e-07 |
| 23 | 23 | -1.521380 | -1.52138 | -1.52138 | 0.0e+00 | 7.0e-07 | 3.0e-07 |
| 24 | 24 | -1.521380 | -1.52138 | -1.52138 | 0.0e+00 | 3.0e-07 | 2.0e-07 |
The Bisection Method estimated the root to be \(x = -1.52138\). Yes, this is a root of \(f'(x)\) but what does that mean? The context of this problem is that the value of this root, \(x = -1.52138\), is where the original function of interest, \(f(x) = \frac{1}{4}x^{4} - \frac{1}{2}x^{2} + 2x + 1\), would have a minimum or maximum output value. The further implication is that the slope of the tangent line at this point on the curve of \(f(x)\) would be \(0\); i.e., the tangent line would be a horizontal line at the point, \(x = -1.52138\), on the curve of \(f(x) = \frac{1}{4}x^{4} - \frac{1}{2}x^{2} + 2x + 1\).
Let’s look once again at the graph of \(f(x) = \frac{1}{4}x^{4} - \frac{1}{2}x^{2} + 2x + 1\):
It is clear that the tangent line is indeed horizontal at \(x = -1.52138\). Thus, the function, \(f(x) = \frac{1}{4}x^{4} - \frac{1}{2}x^{2} + 2x + 1\) has a minimum value at this point. (Minimum as determined by the looking at the graph, not analytically.)
This example showed how the finding where a function, \(f(x)\), has (local) minimum or maximum output values is a root finding problem of the function’s derivative, \(f'(x)\). This is an optimization problem, which is a real-world application in many industries and contexts. As such, the interest is in the real roots (rational or not) of the derivative; the complex roots are usually not of interest. As is true in the real-world, the functions for which roots are desired are never as simple as those presented in academic settings, including here. Thus, having a method like the Bisection Method is critical to any root finding process!
Whether seeking the solution to \(f(x) =
0\) or \(f(x) = k\) or \(f(x) = g(x)\), these are all root
finding problems. Focusing on polynomials with
integer coefficients, we saw in Chapter ?? that there
was a high-level root finding process that assisted in this endeavor.
This section presented several examples of the implementation of the
root find process via the use of self-developed routine,
rootFindingProcess.R. A lot was learned in
doing so, which was the objective.
As mentioned, there are enormous benefits to the learning process by doing self implementation of algorithms, theorems, etc. You can understand an algorithm, theorem, etc. at a conceptual level, which is good!, but you get intimately familiar with them only by doing the implementation, or at least stepping through some examples by hand. I believe that those objectives were met.
And, now, let’s explore the implementation of the root finding
process using the R package, PolynomF. The
package is more robust in that it has a variety of algorithms not
present in rootFindingProcess.R implemented which should
address the limitations found, and discussed above, of
rootFindingProcess.R.
PolynomFThe above section highlighted the finding of roots of a degree \(n\) polynomial through the execution of the
root finding process using the self-developed routine,
rootFindingProcess.R, and its self-developed supporting
routines.
This section will now explore the use of the PolynomF
package in R, which is designed explicitly for polynomials.
From the package description PolynomF
“Implements univariate polynomial operations in R,
including polynomial arithmetic, finding zeros, plotting, and some
operations on lists of polynomials.”
It is really a powerful package. It has many
functions available within the package which are definitely worth
checking out! We will utilize mainly solve.polynom
which:
“Solve polynomial equations, a(x) = b(x), or alternatively find the zeros of the polynomial a(x) - b(x).”
In other words, the root finding process as we defined it, and how
rootFindingProcess.R was designed.
As with any package, however, the inner workings are often hidden so it is not immediately clear the algorithms used to find the roots. This is one reason why I think it is a good idea to do self development then compare against a package such as this.
Let’s reexamine the examples from the above section exploring
rootFindingProcess.R and solve.polynom
simultaneously and compare the results. It is expected that where
rootFindingProcess.R was able to find the roots, the
results should match. It is also expected that
solve.polynom does not have the same
limitations as seen above in rootFindingProcess.R in that
it has the algorithms necessary for root finding that we did not have as
part of our root finding process.
Given \(f(x) = 6x^{3} + 13x^{2} + 2x - 5\), we are interested in understanding when the output of \(f(x)\) is zero. This is a root finding case of \(f(x) = 0\). Given \(f(x)\) is a degree \(3\) polynomial this means that by the Fundamental Theorem of Algebra there will be three roots, which may or may not all be real nor unique.
First invoke rootFindingProcess.R:
rootFindingProcess(c(6,13,2,-5))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = 6*x^3 + 13*x^2 + 2*x - 5"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = 6*x^3 + 13*x^2 + 2*x - 5"
## [1] "Degree of polynomial: 3"
## [1] "By the FTA a total of 3 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 5/6 -5/6 5/3 -5/3 5/2 -5/2 5 -5 1/6 -1/6 1/3 -1/3 1/2 -1/2 1
## [16] -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] -5/3 1/2 -1
## [1] "Total Roots Found: 3"
## [1] "All Roots Found!"
Now solve using solve.polynom
# create a polynomial object
x <- polynom()
# define the polynomial
p <- 6*x^3 + 13*x^2 + 2*x - 5
# find the roots
fractions(solve(p))
## [1] -5/3 -1 1/2
The found roots match.
Given \(f(x) = x^{7} + 3x^{6} - 2x^{5} - 10x^{4} + x^{3} + 11x^{2} - 4\), we are interested in understanding when the output of \(f(x)\) is zero. This is a root finding case of \(f(x) = 0\). Given \(f(x)\) is a degree \(7\) polynomial this means that by the Fundamental Theorem of Algebra there will be seven roots, which may or may not all be real nor unique, though since it is an odd degree polynomial, it is guaranteed that there will be at least one real root, maybe not rational, but real.
First invoke rootFindingProcess.R:
rootFindingProcess(c(1,3,-2,-10,1,11,0,-4))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^7 + 3*x^6 - 2*x^5 - 10*x^4 + x^3 + 11*x^2 - 4"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^7 + 3*x^6 - 2*x^5 - 10*x^4 + x^3 + 11*x^2 - 4"
## [1] "Degree of polynomial: 7"
## [1] "By the FTA a total of 7 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 4 -4 2 -2 1 -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] -2 -2 1 1 1 -1 -1
## [1] "Total Roots Found: 7"
## [1] "All Roots Found!"
Now solve using solve.polynom
# create a polynomial object
x <- polynom()
# define the polynomial
p <- x^7 + 3*x^6 - 2*x^5 - 10*x^4 + x^3 + 11*x^2 - 4
# find the roots
solve(p)
## [1] -2.000000e+00+0e+00i -2.000000e+00+0e+00i -1.000000e+00+0e+00i
## [4] -1.000000e+00+0e+00i 9.999944e-01+0e+00i 1.000003e+00-5e-06i
## [7] 1.000003e+00+5e-06i
The output here is interesting. The output of
solve.polynom is a “Vector of roots, usually
complex”, so based on the algorithm that is being used some of the
roots were found to not be either exactly integer or real. Upon
inspection of the output notice that the powers of the imaginary parts
are extremely close to zero. Rerunning but this time just displaying the
real parts of the returned roots yields:
# create a polynomial object
x <- polynom()
# define the polynomial
p <- x^7 + 3*x^6 - 2*x^5 - 10*x^4 + x^3 + 11*x^2 - 4
# find the roots
Re(solve(p))
## [1] -2.0000000 -2.0000000 -1.0000000 -1.0000000 0.9999944 1.0000028 1.0000028
The roots representing \(x = 1\) are very and sufficiently close to \(1\) to assert the found roots match.
Given \(f(x) = 4x^{4} - 9x^{3} + 19x^{2} + x - 15\), we are interested in understanding when the output of \(f(x)\) is zero. This is a root finding case of \(f(x) = 0\). Given \(f(x)\) is a degree \(4\) polynomial this means that by the Fundamental Theorem of Algebra there will be four roots, which may or may not all be real nor unique.
Let’s invoke rootFindingProcess.R to see what are really
the roots.
rootFindingProcess(c(4,-9,19,1,-15))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = 4*x^4 - 9*x^3 + 19*x^2 + x - 15"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = 4*x^4 - 9*x^3 + 19*x^2 + x - 15"
## [1] "Degree of polynomial: 4"
## [1] "By the FTA a total of 4 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 15/4 -15/4 15/2 -15/2 15 -15 5/4 -5/4 5/2 -5/2 5 -5
## [13] 3/4 -3/4 3/2 -3/2 3 -3 1/4 -1/4 1/2 -1/2 1 -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] -3/4 1
## [1] "The Roots Found By The Quadratic Formula:"
## [1] 1-2i 1+2i
## [1] "Total Roots Found: 4"
## [1] "All Roots Found!"
Now solve using solve.polynom
# create a polynomial object
x <- polynom()
# define the polynomial
p <- 4*x^4 - 9*x^3 + 19*x^2 + x - 15
# find the roots
solve(p)
## [1] -0.75+0i 1.00-2i 1.00+2i 1.00+0i
The found roots match.
Given \(f(x) = x^{4} + 5x^{2} + 4\), we are interested in understanding when the output of \(f(x)\) is zero. This is a root finding case of \(f(x) = 0\). Given \(f(x)\) is a degree \(4\) polynomial this means that by the Fundamental Theorem of Algebra there will be four roots, which may or may not all be real nor unique.
Let’s invoke rootFindingProcess.R to see what are really
the roots.
rootFindingProcess(c(1,0,5,0,4))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^4 + 5*x^2 + 4"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^4 + 5*x^2 + 4"
## [1] "Degree of polynomial: 4"
## [1] "By the FTA a total of 4 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 4 -4 2 -2 1 -1
## [1] "No Rational Roots Found"
## [1] "Total Roots Found: 0"
## [1] "Roots Left To Find: 4"
Now solve using solve.polynom
# create a polynomial object
x <- polynom()
# define the polynomial
p <- x^4 + 5*x^2 + 4
# find the roots
solve(p)
## [1] 0-1i 0+1i 0-2i 0+2i
No roots were found by rootFindingProcess.R while
solve.polynom found the roots to be \(\pm i\) and \(\pm
2i\). This is due to the limitation that
rootFindingProcess.R has of not being able to find the
roots of degree \(4\) polynomial with
all complex roots. In other words, it does not have the algorithm needed
to accomplish this, solve.polynom does.
This example took another look at \(f(x) = x^{4} + 5x^{2} + 4\) presented in Example ??.4 and Example ??.4-A above. It was found that this degree \(4\) polynomial, of which it is guaranteed by the FTA to have \(4\) roots, had no rational roots, thus causing the, as defined, root finding process to be unable to identify any roots. This is a limitation of the root finding process as defined. One reason for this is that there was no other information available.
When there was additional information given, namely
that \(i\) is known to be a root, the
root finding process was able to find the roots \(x = i\), \(x =
-i\), \(x = 2i\), and \(x = -2i\), which is what was reported by
solve.polynom and repeated here.
# create a polynomial object
x <- polynom()
# define the polynomial
p <- x^4 + 5*x^2 + 4
# find the roots
solve(p)
## [1] 0-1i 0+1i 0-2i 0+2i
Given \(f(x) = x^{4} - 5x^{2} + 6\), we are interested in understanding when the output of \(f(x)\) is \(2\). This is a root finding case of \(f(x) = k\), where \(k = 2\). If we let \(g(x) = 2\), then \(f(x) - g(x) = f(x) - 2\). This becomes the root finding polynomial \(x^{4} - 5x^{2} + 4\). Applying the root finding process to \(x^{4} - 5x^{2} + 4 = 0\), the roots will be where the output of \(f(x) = x^{4} - 5x^{2} + 6\) is \(2\). By the Fundamental Theorem of Algebra there will be four roots, which may or may not all be real nor unique.
Let’s invoke rootFindingProcess.R to see what are really
the roots are \(f(x) = 2\):
# Specify the coefficients of f(x) and g(x)
rootFindingProcess(c(1,0,-5,0,6),c(2))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^4 - 5*x^2 + 6"
## [1] "Polynomial g(x)"
## [1] "g(x) = 2"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^4 - 5*x^2 + 4"
## [1] "Degree of polynomial: 4"
## [1] "By the FTA a total of 4 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 4 -4 2 -2 1 -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] 2 -2 1 -1
## [1] "Total Roots Found: 4"
## [1] "All Roots Found!"
Now solve using solve.polynom. To do so, we need to add
the second polynomial, \(g(x) =
2\)
# create a polynomial object
x <- polynom()
# define the polynomial
p <- x^{4} - 5*x^{2} + 6
# define the second polynomial
p2 <- 2
# find the roots
solve(p,p2)
## [1] -2 -1 1 2
The roots match. Notice, however, that the means by which
solve.polynom was invoked was the same as
that of rootFindingProcess.R: first \(f(x) = x^{4} - 5x^{2} + 6\) was specified,
then \(g(x) = 2\) was specified from
which the root finding polynomial \(f(x) - g(x) = x^{4} - 5x^{2} + 4\) was
determined and the roots of this polynomial were found.
Given \(f(x) = x^{4} - x^{2} - 1\), we are interested in understanding when the output of \(f(x)\) equals that of \(g(x) = -x^{3} - x + 1\). This is a root finding case of \(f(x) = g(x)\). This becomes the root finding polynomial \(f(x) - g(x) = x^{4} + x^{3} - x^{2} + x - 2\). Applying the root finding process to this root finding polynomial, the roots will be where the output of \(f(x)\) equals that of \(g(x)\), or where the graphs of the two functions intersect. By the Fundamental Theorem of Algebra there will be four roots, which may or may not all be real nor unique.
Let’s invoke rootFindingProcess.R to see what are really
the roots. To do so we need to specify the coefficients of \(f(x)\) and the
coefficients of \(g(x)\).
rootFindingProcess.R will algebraically determine \(f(x) - g(x)\), the root finding polynomial,
for which the roots will be found.
# Specify the coefficients of f(x) and g(x)
rootFindingProcess(c(1,0,-1,0,-1),c(-1,0,-1,1))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^4 - x^2 - 1"
## [1] "Polynomial g(x)"
## [1] "g(x) = -x^3 - x + 1"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^4 + x^3 - x^2 + x - 2"
## [1] "Degree of polynomial: 4"
## [1] "By the FTA a total of 4 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 2 -2 1 -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] -2 1
## [1] "The Roots Found By The Quadratic Formula:"
## [1] 0+1i 0-1i
## [1] "Total Roots Found: 4"
## [1] "All Roots Found!"
Now solve using solve.polynom. To do so, we need to add
the second polynomial, \(g(x) =
-x^{3} - x + 1\)
# create a polynomial object
x <- polynom()
# define the polynomial
p <- x^4 - x^2 - 1
# define the second polynomial
p2 <- -x^3 - x + 1
# find the roots
solve(p,p2)
## [1] -2+0i 0-1i 0+1i 1+0i
The roots match. Notice, however, that the means by which
solve.polynom was invoked was the same as
that of rootFindingProcess.R: first \(f(x) = x^{4} - x^{2} - 1\) was specified,
then \(g(x) = -x^{3} - x + 1\) was
specified from which the root finding polynomial \(f(x) - g(x) = x^{4} + x^{3} - x^{2} + x -
2\) was determined and the roots of this polynomial were
found.
Given \(f(x) = x^{3} - 3x + 1\), we are interested in understanding when the output of \(f(x)\) equals that of \(g(x) = -x^{3} + 3x + 6\). This is a root finding case of \(f(x) = g(x)\). This becomes the root finding polynomial \(f(x) - g(x) = 2x^{3} - 6x - 5\). Applying the root finding process to this root finding polynomial, the roots will be where the output of \(f(x)\) equals that of \(g(x)\), or where the graphs of the two functions intersect. By the Fundamental Theorem of Algebra there will be four roots, which may or may not all be real nor unique
Let’s invoke rootFindingProcess.R to see what are really
the roots. To do so we need to specify the coefficients of \(f(x)\) and the
coefficients of \(g(x)\).
rootFindingProcess.R will algebraically determine \(f(x) - g(x)\), the root finding polynomial,
for which the roots will be found.
# Specify the coefficients of f(x) and g(x)
rootFindingProcess(c(1,0,-3,1),c(-1,0,3,6))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^3 - 3*x + 1"
## [1] "Polynomial g(x)"
## [1] "g(x) = -x^3 + 3*x + 6"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = 2*x^3 - 6*x - 5"
## [1] "Degree of polynomial: 3"
## [1] "By the FTA a total of 3 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 5/2 -5/2 5 -5 1/2 -1/2 1 -1
## [1] "No Rational Roots Found"
## [1] "Total Roots Found: 0"
## [1] "Roots Left To Find: 3"
Now solve using solve.polynom. To do so, we need to
define both \(f(x) = x^{3} -
3x + 1\) and \(g(x) = -x^{3} + 3x +
6\)
# create a polynomial object
x <- polynom()
# define the polynomial
p <- x^3 - 3*x + 1
# define the second polynomial
p2 <- -x^3 + 3*x + 6
# find the roots
solve(p,p2)
## [1] -1.026811-0.403759i -1.026811+0.403759i 2.053622+0.000000i
Notice, first, that the means by which solve.polynom was
invoked was the same as that of
rootFindingProcess.R: first \(f(x) = x^{3} - 3x + 1\) was specified, then
\(g(x) = -x^{3} + 3x + 6\) was
specified from which the root finding polynomial \(f(x) - g(x) = 2x^{3} - 6x - 5\) was
determined and the roots of this polynomial were found.
Second, notice that rootFindingProcess.R was unable to
find any roots for there were no rational roots which,
in combination of having no further information was unable to reduce the
root finding polynomial to a degree \(2\) and then apply the quadratic formula.
The graph, however, showed that there was indeed a real, non
rational root at a value of \(x\) slightly greater than \(2\). The Bisection Method
was then applied and estimated that root to be \(x = 2.053622\). Of the three guaranteed
roots, this real root was sufficient for the context of the problem,
where the two functions intersected in the real plane.
On the other hand, solve.polynom was able to identify
all three roots and the real root it found, \(2.053622\) matched that from the Bisection
Method. It was able to overcome the limitations to
rootFindingProcess.R for it has the algorithms necessary to
do so. Whether it used the Bisection Method or some other numerical
algorithm is unknown, but it really doesn’t matter. The real root found
via following the as defined root finding process surrounding the use of
rootFindingProcess.R matched that of
solve.polynom.
Given \(f(x) = \frac{1}{4}x^{4} - \frac{1}{2}x^{2} + 2x + 1\), find when the function has either a minimum or maximum output value(s). This is an optimization problem that was introduced in Chapter ?? in the Why You Should Care section.
We saw in the Example ??-9 above that to answer this question, we needed the derivative, \(f'(x) = x^{3} - x + 2\), for the roots of this derivative function will yield where the function, \(f(x)\), has a min or max. In other words, we have the root finding problem \(f'(x) = 0\).
Let’s invoke rootFindingProcess.R to see what are really
the roots. To do so we need to specify the coefficients of \(f(x)\) and the
coefficients of \(g(x)\).
rootFindingProcess.R will algebraically determine \(f(x) - g(x)\), the root finding polynomial,
for which the roots will be found.
# Specify the coefficients of f(x) and g(x)
rootFindingProcess(c(1,0,-1,2),c(0))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^3 - x + 2"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^3 - x + 2"
## [1] "Degree of polynomial: 3"
## [1] "By the FTA a total of 3 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 2 -2 1 -1
## [1] "No Rational Roots Found"
## [1] "Total Roots Found: 0"
## [1] "Roots Left To Find: 3"
Now solve using solve.polynom realizing that \(g(x) = 0\):
# create a polynomial object
x <- polynom()
# define the polynomial
p <- x^3 - x + 2
# find the roots
solve(p)
## [1] -1.5213797+0.0000000i 0.7606899-0.8578736i 0.7606899+0.8578736i
rootFindingProcess.R was unable to find any roots for
there were no rational roots which, in combination of
having no further information was unable to reduce the root finding
polynomial to a degree \(2\) and then
apply the quadratic formula. The graph, however, showed that there was
indeed a real, non rational root at a value of \(x\) slightly greater than \(2\). The Bisection Method
was then applied and estimated that root to be \(x = -1.52138\). Of the three guaranteed
roots, this real root was sufficient for the context of the problem,
which was were the function, \(f(x)\)
would have a min or max output value.
On the other hand, solve.polynom was able to identify
all three roots and the real root it found, \(-1.5213797\) matched that from the
Bisection Method. It was able to overcome the limitations to
rootFindingProcess.R for it has the algorithms necessary to
do so. Whether it used the Bisection Method or some other numerical
algorithm is unknown, but it really doesn’t matter. The real root found
via following the as defined root finding process surrounding the use of
rootFindingProcess.R matched that of
solve.polynom.
This section explored using the R package
PolynomF to find the roots of a given polynomial. It is a
powerful package and has a lot of other polynomial
related capabilities and is worth exploring. We saw that
PolynomF produced the same results as
rootFindingProcess.R which validated the
concepts of root finding that were at the heart of the
root finding process designed and implemented independently into
rootFindingProcess.R. A lot was learned in
doing so, which was the objective. We can now, with confidence, use
either rootFindingProcess.R or PolynomF. The
former for more learning, the latter for general implementation designs
and to handle scenarios in which rootFindingProcess.R falls
short.
In Chapter ??.7 a very important idea was discussed. Through the root finding process in combination with the Factor Theorem, allows for the easy factoring of polynomials. Recall the Factor Theorem:
Factor Theorem: Given a polynomial, \(f(x)\), with real coefficients and some \(c \in \mathbb{C}\), \(f(c) = 0\) \(\iff\) \((x - c)\) is a factor.
One implication of the theorem is that if you know a root, \(c\), meaning \(f(c) = 0\), of a polynomial, then you know that \((x - c)\) is a factor. The idea, then, is that the roots found by the root finding process immediately yield the associated factors of the polynomial, regardless of what the type of roots found. This is a powerful statement.
To explore this idea, there is an option in
rootFindingProcess.R which, when enabled, will provide the
factors for any roots, rational or otherwise, found using the root
finding process. The R library, PolynomF, can
also be used as we’ll see.
Let’s look at some examples. The first four are all quadratics showing not only how easy it is to factor a quadratic, but that any quadratic can be factored. Gone are the days of archaic factoring rules.
Example ??.10
Factor \(f(x) = x^{2} + x - 6\).
This is a degree \(2\) polynomial so
there are guaranteed to be \(2\) roots,
therefore having \(2\) factors. Let’s
invoke rootFindingProcess.R to find the roots
and the factors.
# Specify the coefficients of f(x) and g(x)
# Enable the option to provide the factors
rootFindingProcess(c(1,1,-6),,TRUE)
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^2 + x - 6"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^2 + x - 6"
## [1] "Degree of polynomial: 2"
## [1] "By the FTA a total of 2 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 6 -6 3 -3 2 -2 1 -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] -3 2
## [1] "Total Roots Found: 2"
## [1] "All Roots Found!"
## [1] "Using the Factor Theorem, The Associated Factors Of The Found Roots:"
## [1] "(x + 3)(x - 2)"
As reported by rootFindingProcess.R the roots are \(x = -3\) and \(x
= 2\). Therefore, by the Factor Theorem, the
factors are \((x + 3)\) and \((x - 2)\). These match the factors
reported by rootFindingProcess.R! Hence,
\(f(x) = x^{2} + x - 6 = (x+3)(x-2)\).
Example ??.11
Factor \(f(x) = 35x^{2} - 13x - 12\).
This is a degree \(2\) polynomial so
there are guaranteed to be \(2\) roots,
therefore having \(2\) factors. Let’s
invoke rootFindingProcess.R to find the roots
and the factors.
# Specify the coefficients of f(x) and g(x)
# Enable the option to provide the factors
rootFindingProcess(c(35,-13,-12),,TRUE)
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = 35*x^2 - 13*x - 12"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = 35*x^2 - 13*x - 12"
## [1] "Degree of polynomial: 2"
## [1] "By the FTA a total of 2 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 12/35 -12/35 12/7 -12/7 12/5 -12/5 12 -12 6/35 -6/35
## [11] 6/7 -6/7 6/5 -6/5 6 -6 4/35 -4/35 4/7 -4/7
## [21] 4/5 -4/5 4 -4 3/35 -3/35 3/7 -3/7 3/5 -3/5
## [31] 3 -3 2/35 -2/35 2/7 -2/7 2/5 -2/5 2 -2
## [41] 1/35 -1/35 1/7 -1/7 1/5 -1/5 1 -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] 4/5 -3/7
## [1] "Total Roots Found: 2"
## [1] "All Roots Found!"
## [1] "Using the Factor Theorem, The Associated Factors Of The Found Roots:"
## [1] "(x - 4/5)(x + 3/7)"
As reported by rootFindingProcess.R the roots are \(x = -\frac{3}{7}\) and \(x = \frac{4}{5}\). Therefore, by the
Factor Theorem, the factors are \((x + 3)\) and \((x - 2)\). These match the factors
reported by rootFindingProcess.R! Hence,
\(f(x) = x^{2} + x - 6 = \left(x + \frac{3}{7}\right)\left(x - \frac{4}{5}\right)\).
Example ??.12
Factor \(f(x) = 4x^{2} - 12x + 34\).
This is a degree \(2\) polynomial so
there are guaranteed to be \(2\) roots,
therefore having \(2\) factors. Let’s
invoke rootFindingProcess.R to find the roots
and the factors.
# Specify the coefficients of f(x) and g(x)
# Enable the option to provide the factors
rootFindingProcess(c(4,-12,34),,TRUE)
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = 4*x^2 - 12*x + 34"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = 4*x^2 - 12*x + 34"
## [1] "Degree of polynomial: 2"
## [1] "By the FTA a total of 2 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 17/2 -17/2 17 -17 34 -34 17/4 -17/4 1/2 -1/2 1 -1
## [13] 2 -2 1/4 -1/4
## [1] "No Rational Roots Found"
## [1] "The Roots Found By The Quadratic Formula:"
## [1] 1.5-2.5i 1.5+2.5i
## [1] "Total Roots Found: 2"
## [1] "All Roots Found!"
## [1] "Using the Factor Theorem, The Associated Factors Of The Found Roots:"
## [1] "(x -(1.5-2.5i))(x -(1.5+2.5i))"
As reported by rootFindingProcess.R the roots are \(x = \frac{3 - 5i}{2}\) and \(x = \frac{3 + 5i}{2}\). Therefore, by the
Factor Theorem, the factors are \(\left(x - \left(\frac{3 -
5i}{2}\right)\right)\) and \(\left(x -
\left(\frac{3 + 5i}{2}\right)\right)\). These match the
factors reported by rootFindingProcess.R!
Hence,
\(f(x) = 4x^{2} - 12x + 34 = \left(x - \left(\frac{3 - 5i}{2}\right)\right)\left(x - \left(\frac{3 + 5i}{2}\right)\right)\).
Example ??.13
Factor \(f(x) = x^{2} - 2x - 4\).
This is a degree \(2\) polynomial so
there are guaranteed to be \(2\) roots,
therefore having \(2\) factors. Let’s
invoke rootFindingProcess.R to find the roots
and the factors.
# Specify the coefficients of f(x) and g(x)
# Enable the option to provide the factors
rootFindingProcess(c(1,-2,-4),,TRUE)
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^2 - 2*x - 4"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^2 - 2*x - 4"
## [1] "Degree of polynomial: 2"
## [1] "By the FTA a total of 2 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 4 -4 2 -2 1 -1
## [1] "No Rational Roots Found"
## [1] "The Roots Found By The Quadratic Formula:"
## [1] 3.236068 -1.236068
## [1] "Total Roots Found: 2"
## [1] "All Roots Found!"
## [1] "Using the Factor Theorem, The Associated Factors Of The Found Roots:"
## [1] "(x -(3.23606797749979))(x -(-1.23606797749979))"
As reported by rootFindingProcess.R the roots are \(x = \left(1 + \sqrt{5}\right)\) and \(x = \left(1 + \sqrt{5}\right)\), though
reported in decimal. Therefore, by the Factor Theorem,
the factors are \(\left(x - \left(1 +
\sqrt{5}\right)\right)\) and \(\left(x
- \left(1 - \sqrt{5}\right)\right)\). These match the
factors reported by rootFindingProcess.R!
Hence,
\(f(x) = x^{2} - 2x - 4 = \left(x - \left(1 + \sqrt{5}\right)\right)\left(x - \left(1 - \sqrt{5}\right)\right)\).
Example ??.14
Factor \(f(x) = 6x^{5} - 35x^{4} + 96x^{3} - 24x^{2} - 398x + 195\)
This is a degree \(5\) polynomial so
there are guaranteed to be \(5\) roots,
therefore having \(7\) factors. Let’s
invoke rootFindingProcess.R to find the roots
and the factors.
# Specify the coefficients of f(x) and g(x)
rootFindingProcess(c(6,-35,96,-24,-398,195),,TRUE)
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = 6*x^5 - 35*x^4 + 96*x^3 - 24*x^2 - 398*x + 195"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = 6*x^5 - 35*x^4 + 96*x^3 - 24*x^2 - 398*x + 195"
## [1] "Degree of polynomial: 5"
## [1] "By the FTA a total of 5 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 65/2 -65/2 65 -65 195/2 -195/2 195 -195 65/6 -65/6
## [11] 65/3 -65/3 13/2 -13/2 13 -13 39/2 -39/2 39 -39
## [21] 5/2 -5/2 5 -5 15/2 -15/2 15 -15 13/6 -13/6
## [31] 13/3 -13/3 5/6 -5/6 5/3 -5/3 1/2 -1/2 1 -1
## [41] 3/2 -3/2 3 -3 1/6 -1/6 1/3 -1/3
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] -5/3 1/2 3
## [1] "The Roots Found By The Quadratic Formula:"
## [1] 2-3i 2+3i
## [1] "Total Roots Found: 5"
## [1] "All Roots Found!"
## [1] "Using the Factor Theorem, The Associated Factors Of The Found Roots:"
## [1] "(x + 5/3)(x - 1/2)(x - 3)(x -(2-3i))(x -(2+3i))"
As reported by rootFindingProcess.R the roots are \(x = -\frac{5}{3}\), \(x = \frac{1}{2}\), \(x = 3\), \(x = 2
- 3i\), and \(x = 2 + 3i\).
Therefore, by the Factor Theorem, the factors are \(\left(x + \frac{5}{3}\right)\), \(\left(x - \frac{1}{2}\right)\), \((x - 3)\), \(\left(x - (2 - 3i)\right)\), and \(\left(x - (2 + 3i)\right)\). These
match the factors reported by
rootFindingProcess.R! Hence,
\(f(x) = 6x^{5} - 35x^{4} + 96x^{3} - 24x^{2} - 398x + 195 = \left(x + \frac{5}{3}\right)\left(x - \frac{1}{2}\right)(x - 3)\left(x - (2 - 3i)\right)\left(x - (2 + 3i)\right)\)
Example ??.15
Factor \(f(x) = x^{4} + 5x^{2} + 4\).
This is a degree \(5\) polynomial so
there are guaranteed to be \(4\) roots,
therefore having \(4\) factors. Let’s
invoke rootFindingProcess.R to find the roots
and the factors.
rootFindingProcess(c(1,0,5,0,4))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^4 + 5*x^2 + 4"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^4 + 5*x^2 + 4"
## [1] "Degree of polynomial: 4"
## [1] "By the FTA a total of 4 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 4 -4 2 -2 1 -1
## [1] "No Rational Roots Found"
## [1] "Total Roots Found: 0"
## [1] "Roots Left To Find: 4"
rootFindingProcess.R was unable to find any of the four
roots due to its limitations (see Example ??.4 and
Example ??.4-A). In this case, let’s invoke
solve.polynom
# create a polynomial object
x <- polynom()
# define the polynomial
p <- x^4 + 5*x^2 + 4
# find the roots
solve(p)
## [1] 0-1i 0+1i 0-2i 0+2i
As reported by solve.polynom the roots are \(x = i\), \(x =
-i\), \(x = 2i\), \(x = -2i\). Therefore, by the Factor
Theorem, the factors are \(\left(x
-i\right)\), \(\left(x
+i\right)\), \((x - 2i)\), and
\(\left(x +2i\right)\). Hence,
\(f(x) = x^{4} + 5x^{2} + 4 = \left(x -i\right)\left(x +i\right)(x - 2i)\left(x +2)\right)\)
Example ??.16
Simplify
\[ f(x) = \frac{x^{4} -6x^{3} +3x^{2} + 26x -24}{x^{3} + x^{2} - 17x+15} \]
To simplify, we want to see if there are any common factors between
the polynomial in the numerator and the polynomial in the denominator.
Let’s call the numerator \(N(x) = x^{4}
-6x^{3} +3x^{2} + 26x -24\) and the denominator \(D(x) = x^{3} + x^{2} - 17x+15\). Let’s
invoke rootFindingProcess.R find the factors of \(N(x)\)
rootFindingProcess(c(1,-6,3,26,-24),,TRUE)
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^4 - 6*x^3 + 3*x^2 + 26*x - 24"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^4 - 6*x^3 + 3*x^2 + 26*x - 24"
## [1] "Degree of polynomial: 4"
## [1] "By the FTA a total of 4 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 24 -24 12 -12 8 -8 6 -6 4 -4 3 -3 2 -2 1 -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] 4 3 -2 1
## [1] "Total Roots Found: 4"
## [1] "All Roots Found!"
## [1] "Using the Factor Theorem, The Associated Factors Of The Found Roots:"
## [1] "(x - 4)(x - 3)(x + 2)(x - 1)"
From this we get the factors \((x-4)\), \((x-3)\), \((x + 2)\), and \((x - 1)\). Therefore,
\[ \begin{align} N(x) &= x^{4} -6x^{3} +3x^{2} + 26x -24 \\ &= (x - 4)(x - 3)(x + 2)(x - 1) \end{align} \]
Now, let’s invoke rootFindingProcess.R find the factors
of \(D(x)\)
rootFindingProcess(c(1,1,-17,15),,TRUE)
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^3 + x^2 - 17*x + 15"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^3 + x^2 - 17*x + 15"
## [1] "Degree of polynomial: 3"
## [1] "By the FTA a total of 3 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 15 -15 5 -5 3 -3 1 -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] -5 3 1
## [1] "Total Roots Found: 3"
## [1] "All Roots Found!"
## [1] "Using the Factor Theorem, The Associated Factors Of The Found Roots:"
## [1] "(x + 5)(x - 3)(x - 1)"
From this we get the factors \((x+5)\), \((x-3)\), and \((x - 1)\). Therefore,
\[ \begin{align} D(x) &= x^{3} + x^{2} - 17x+15 \\ &= (x + 5)(x - 3)(x - 1) \end{align} \]
Now that we have the factors of the polynomials in the numerator and denominator, we can see if any simplification can be made of \(f(x)\):
\[ \begin{align} f(x) &= \frac{x^{4} -6x^{3} +3x^{2} + 26x -24}{x^{3} + x^{2} - 17x+15} \\ \\ &= \frac{(x - 4)(x - 3)(x + 2)(x - 1)}{(x + 5)(x - 3)(x - 1)} \\ \\ &= \frac{(x - 4)(x + 2)}{(x + 5)} \\ \\ &= \frac{x^{2} - 2x - 8}{x+5} \end{align} \]
This section explored the important implication of the Factor Theorem, that if a root, \(c\), of a polynomial is known, the corresponding factor, \((x - c)\), is also known. This allows for a general factoring process of a polynomial of any degree, even those with non rational or complex roots. The ability to do so is useful in the simplification of a rational function which can be quite helpful in many scenarios including the ability to find limits, a key concept in calculus, as was seen in the Why You Should Care section 13 of the root finding chapter.
R CodeRoot Finding Process
The R code for the self-developed routine
rootFindingProcess.R that implements the root finding
process:
The logic of rootFindingProcess.R is built on the
general form of root finding, \(f(x) =
g(x)\), thus making it versatile. If \(g(x) = 0\), then this is the first form,
\(f(x) = 0\). If \(g(x) = k\), then this is the second form,
\(f(x) = k\). If \(g(x)\) is any other polynomial then this is
of the form, \(f(x) - g(x) = 0\).
This main driver makes use of the other self-developed routines:
getPosRatlRoots.R, findRatlRoots.R,
syntheticDiv.R, solveQuadratic.R,
combineCoeffs.R, coeffsToPloy.R, and
formFactors.R. These are available by request.
rootFindingProcess <- function(fCoeffs,
gCoeffs = c(0),
displayFactors = FALSE,
verbose = FALSE) {
# This routine operates on f(x) = g(x) which becomes f(x) - g(x) = 0. This
# results in the degree N polynomial for which to apply the root finding
# process. The DEFAULT is g(x) = 0 which, therefore, becomes just f(x) = 0
#
# This routine implements the root finding process for a degree N polynomial
# with INTEGER coefficients to find the RATIONAL Roots and at MOST two
# irrational or complex roots should the number of rational roots found
# reduce the degree N polynomial to a degree two polynomial on which the
# quadratic formula could be applied
#
# The process is:
# * Identify the degree of the polynomial
# * Identify the possible rational roots by apply the Rational Root Theorem
# * Find the rational roots (if any) by applying the Remainder Theorem
# along with synthetic division
# * Use the quadratic formula should the number of rational roots found
# reduce the degree N polynomial to a degree two polynomial
#
print(' ROOT FINDING PROCESS FOR f(x) - g(x) = 0')
print(' ----------------------------------------')
if (verbose) {
print('Coefficients of f(x)')
print(fCoeffs)
}
print('Polynomial f(x)')
print(coeffsToPoly(fCoeffs,'f(x)'))
if (verbose) {
print('Coefficients of g(x)')
print(gCoeffs)
}
print('Polynomial g(x)')
print(coeffsToPoly(gCoeffs,'g(x)'))
# form the root finding polynomial f(x) - g(x)
coeffs <- combineCoeffs(fCoeffs,gCoeffs)
if (verbose) {
print('Coefficients of root finding polynomial')
print(coeffs)
}
print('Root finding polynomial')
print(coeffsToPoly(coeffs,'f(x) - g(x)'))
# Identify the degree of the polynomial
theDegree <- length(coeffs) - 1
print(paste('Degree of polynomial:',theDegree))
print(paste('By the FTA a total of',theDegree,'roots exist'))
# Identify the possible rational roots
leadingCoeff <- coeffs[1]
constCoeff <- coeffs[length(coeffs)]
# first get the possible rational roots
posRatlRoots <- getPosRatlRoots(leadingCoeff,constCoeff)
print('The Rational Root Theorem Identifies The Following Possible Rational Roots')
print(fractions(posRatlRoots))
# find the rational roots if any
theList <- findRatlRoots(coeffs,posRatlRoots)
if (length(theList$theRatlRoots) == 0) {
print('No Rational Roots Found')
} else {
print('The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots')
print(fractions(theList$theRatlRoots))
}
if (length(theList$remainingCoeffs) == 3){
nonRatlRoots <- solveQuadratic(theList$remainingCoeffs)
print('The Roots Found By The Quadratic Formula:')
print(nonRatlRoots)
} else {
nonRatlRoots <- c()
}
rootsFound <- length(theList$theRatlRoots) + length(nonRatlRoots)
print(paste('Total Roots Found:',rootsFound))
if (rootsFound == theDegree) {
print("All Roots Found!")
} else {
print(paste("Roots Left To Find:",theDegree - rootsFound))
}
if (displayFactors) {
# form the factors associated with the found roots
theFactors <- formFactors(theList$theRatlRoots,nonRatlRoots)
if (length(theFactors) == 0){
print('No Associated Factors; No Roots Found')
} else {
print('Using the Factor Theorem, The Associated Factors Of The Found Roots:')
print(theFactors)
}
}
}
Bisection Method Algorithm
The R code for the self-developed routine
bisectionMethod.R that implements the Bisection Method
algorithm:
# This routine will execute the bisection method algorithm
#
# The assumption is that the algorithm assumptions have already been checked
# and satisfied. Those assumptions are:
# * f(x) is continuous in [a,b]
# * f(a) and f(b) are of opposite signs
#
# This version will implement three versions for tolerance checking
# 1). abs[0 - f(c)] -> the default method
# 2). abs(b - a)
# 3). abs[f(b) - f(a)]
bisectionMethod <- function(theFunc,
aValue,
bValue,
theTolerance = 1e-3,
toleranceMethod = 1,
maxNumIterations = 100){
# initializations
theAs <- c()
theBs <- c()
theCs <- c()
theErrors <- c()
theFofAs <- c()
theFofBs <- c()
theFofCs <- c()
theIndices <- c()
#
loopCntr <- 1
keepSearching <- TRUE
while (keepSearching){
c <- (aValue + bValue) / 2.0
fOfa <- sapply(aValue, function(x) eval(parse(text = theFunc)))
fOfb <- sapply(bValue, function(x) eval(parse(text = theFunc)))
fOfc <- sapply(c, function(x) eval(parse(text = theFunc)))
if (toleranceMethod == 1) {
theError = abs(0.0 - fOfc)
}
else if (toleranceMethod == 2) {
theError = abs(bValue - aValue)
}
else if (toleranceMethod == 3) {
theError = abs(fOfb - fOfa)
}
#
theAs <- c(theAs,aValue)
theBs <- c(theBs,bValue)
theCs <- c(theCs,c)
theFofAs <- c(theFofAs,fOfa)
theFofBs <- c(theFofBs,fOfb)
theFofCs <- c(theFofCs,fOfc)
theErrors <- c(theErrors,theError)
theIndices <- c(theIndices,loopCntr)
#
if ((fOfc == 0) || (theError < theTolerance) || (loopCntr > maxNumIterations)){
if (loopCntr > maxNumIterations) {
print("Exceeded number of interations")
}
keepSearching = FALSE
}
else {
if (!passOppSignCheck(theFunc,aValue,c)) {
# f(c) and f(a) are of the same sign, replace a with c
aValue <- c
}
else if (!passOppSignCheck(theFunc,bValue,c)){
# f(c) and f(b) are of the same sign, replace b with c
bValue <- c
}
}
loopCntr <- loopCntr + 1
}
# all done create dataframe
df <- data.frame( "i" = theIndices,
"a" = theAs,
"b" = theBs,
"c" = theCs,
"fOfa" = theFofAs,
"fOfb" = theFofBs,
"fofc" = theFofCs,
"Error" = theErrors)
return(df)
}
Pass Opposite Sign Check
The R code for the self-developed routine
passOppSignCheck.R that verifies the required condition of
the Bisection Method that for the interval \([a,b]\), \(f(a)
< 0 < f(b)\) or \(f(a) > 0
> f(b)\):
# This routine will check to see if the function passes the condition that
# f(a) and f(b) are of opposite signs for a given interval [a,b].
#
# Will return TRUE if it is, else will return FALSE if it is not
#
passOppSignCheck <- function(theFunc,
a,
b) {
x <- a
fOfa <- eval(parse(text = theFunc))
x <- b
fOfb <- eval(parse(text = theFunc))
if ((fOfa < 0 & fOfb > 0) || (fOfa > 0 & fOfb < 0)) {
passedOppSignCheck <- TRUE
}
else {
passedOppSignCheck <- FALSE
}
return(passedOppSignCheck)
}
In Chapter ??, we explored the concepts of function translation. In basic terms, function translation is the taking of an existing function and moving it in its entirety to a different location in two dimensional space via a horizontal shift, a vertical shift, or both.
The general idea of function translation is simple:
What is not so simple, however, is the finding of the key characteristics (domain, range, x- and y-intercepts, and roots) of a translated function. There are some general statements that can be made about domain and range:
The x- and y-intercepts, as well as the roots, of the translated function, of any kind, are a bit more involved, usually involving the solving of a root finding problem. When considering roots, you must also take into account the type of root, real or complex.
All these ideas were explored from a mathematical (algebraic) perspective in Chapter ??. 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. To accomplish this, we will look at each type of at each type of translation individually.
Note: in this Appendix, we will be using several self-developed
routines in R and/or features of R and
R packages.
rootFindingProcess.R,
will be used to solve a root finding problem. It was
created to implement the root finding process, described in the root
finding chapter, Chapter ??. It was designed
to use the root finding process
generalization. That is, always start with \(f(x) = g(x)\), and then algebraically
manipulate to form \(f(x) - g(x) =
0\).PolynomF package in R, which is
designed explicitly for polynomials. From the package description
PolynomF: “Implements univariate polynomial operations in
R, including polynomial arithmetic, finding zeros,
plotting, and some operations on lists of polynomials.” It is really
a powerful package. It has many functions
available within the package which are definitely worth checking out! We
will utilize mainly solve.polynom which: “Solve polynomial
equations, a(x) = b(x), or alternatively find the zeros of the
polynomial a(x) - b(x)”. There are other features which may be used and,
if so, will be pointed out.createTranslatedPoly.R,
will be used to find the translated polynomial \(f(x - c) + d\) in lieu of doing so by
hand. It is still recommended, however, that you be able to
algebraically create the translated polynomial yourself.
This routine, like any other tool, should be used only when that
skill has been mastered. See the R Code section below for
more details.bisectionMethod.R,
which implements the Bisection Method algorithm will be used to find non
rational real roots.A vertical shift, or translation, is the moving of a function, in its entirety, up or down. Each point on the curve moves up or down by the same distance. In other words, for some function, \(f(x)\), the moving up or down is achieved via \(f(x) + d\), where \(d\) is a real number.
In Section ??.1 of Chapter ?? a
summary of the effects on a function, \(f(x)\), by a vertical translation were
given. The examples in the chapter were extensive and comprehensive. The
purpose here is to verify some of the key concepts using R
and how R can be used to explore function translation. We
will explore some of the key ideas of a vertical translation here.
The first to be explored is that every point \((x,y)\) on \(f(x)\) moves to the point \((x, y+d)\) on \(f(x) + d\). If \(d < 0\), the function moves vertically \(d\) units down. If \(d > 0\), the function moves \(d\) units up.
Consider the function \(f(x) = x^{3} + 2x^{2} - x + 3\) which is shifted \(2\) units up. Explore the effect of the translation on \(f(1)\) and find the function that results from the vertical shift of \(f(x)\) up by \(2\) units.
First, let’s see what \(f(1)\) is:
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^3 + 2*x^2 - x + 3}
# evaluate f(x) at x = 1; i.e., f(1)
fractions(fFunc(1))
## [1] 5
Thus, \(f(1) = 5\), which is the point \((1,5)\) on \(f(x)\). Since we are doing a vertical shift of \(2\) units up, the translation is \(f(x) + 2\). Hence, we would expect the point \((1,5)\) on \(f(x)\) to move to \((1,5+2) = (1,7)\) on \(f(x) + 2\).
# define the function f(x) + 2 being sure to enter the function using ASCII notation
fFunc <- function(x){(x^3 + 2*x^2 - x + 3) + 2}
# evaluate f(x) + 2 at x = 1; i.e., f(1) + 2
fractions(fFunc(1))
## [1] 7
As expected, the point \((1,5)\) on \(f(x)\) moved to \((1,7)\) on \(f(x) + 2\).
Notice how the question Explore the effect of the translation on
\(f(1)\) was answered without
actually finding what the related function, \(g(x) = f(x) + 2\), was. The translated
function was entered into the R snippet directly. To
actually find \(g(x)\) requires the
algebraic manipulation of the original function, \(f(x)\). For a vertical shift this is
(relatively) easy to do by hand:
\[
\begin{align}
g(x) &= f(x) + 2 \\
&= (x^{3} + 2x^{2} - x + 3) + 2 \\
&= x^{3} + 2x^{2} - x + 5
\end{align}
\] It is often not the case that the finding of the translated
function is easy to do, especially when there is a horizontal
translation involved. The routine, createTranslatedPoly.R,
was self-developed to actually find the translated function:
# find f(x - c) + d, where c = 0, d = 2
pT <- createTranslatedPoly(c(1,2,-1,3),0,2,TRUE)
## [1]
## [1] Create Translated Polynomial
## [1] ----------------------------
## [1]
## [1] Coefficients of f(x)
## [1] 1 2 -1 3
## [1] Polynomial f(x)
## [1] f(x) = x^3 + 2*x^2 - x + 3
## [1] Horizontal Shift: 0
## [1] Vertical Shift: 2
## [1] Translated Function f(x - 0 ) + 2
## x^3 + 2*x^2 - x + 5
The routine reports that the translated function is \(x^{3} + 2x^{2} - x + 5\) which agrees with what we found. We can also evaluate this translated function at the desired input value which, in this case, is \(x = 1\):
# Evaluate f(x - c) + d at x = 1
pT(1)
## [1] 7
This output value of \(7\) agrees with what was found above, thus confirming, again, that the point \((1,5)\) on \(f(x)\) moved to \((1,7)\) on \(f(x) + 2\).
This example verified that for a vertical translation, the point \((x,y)\) on \(f(x)\) moves to the point \((x, y+d)\) on \(f(x) + d\).
The next effect of a vertical translation to be explored are the roots. It was seen that the roots of \(f(x)\) are not the roots of the translated function, \(f(x) + d\). To find the roots of the translated function is a root finding problem of the form \(f(x) = -d\) (the root finding use case: \(f(x) = k\)).
Consider the function \(f(x) = x^{3} - 3x^{2} + 4x - 2\). Explore the effect of a vertical translation of \(f(x)\) shifted \(10\) units up on the roots of \(f(x)\).
Let’s first find the roots of \(f(x)\) using
rootFindingProcess.R.
rootFindingProcess(c(1,-3,4,-2))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^3 - 3*x^2 + 4*x - 2"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^3 - 3*x^2 + 4*x - 2"
## [1] "Degree of polynomial: 3"
## [1] "By the FTA a total of 3 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 2 -2 1 -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] 1
## [1] "The Roots Found By The Quadratic Formula:"
## [1] 1-1i 1+1i
## [1] "Total Roots Found: 3"
## [1] "All Roots Found!"
The roots of \(f(x) = x^{3} - 3x^{2} + 4x - 2\) are \(x = 1\), \(x = 1 + i\), and \(x = 1 - i\). The roots of the vertically translated function can be found by solving \(f(x) = -d\). In this case, \(d = 10\), therefore, the root finding problem is \(f(x) = -10\).
rootFindingProcess(c(1,-3,4,-2),c(-10))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^3 - 3*x^2 + 4*x - 2"
## [1] "Polynomial g(x)"
## [1] "g(x) = -10"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^3 - 3*x^2 + 4*x + 8"
## [1] "Degree of polynomial: 3"
## [1] "By the FTA a total of 3 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 8 -8 4 -4 2 -2 1 -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] -1
## [1] "The Roots Found By The Quadratic Formula:"
## [1] 2-2i 2+2i
## [1] "Total Roots Found: 3"
## [1] "All Roots Found!"
The roots of \(f(x) + 10\) were found to be \(x = -1\), \(x = 2 - 2i\), and \(x = 2 + 2i\).
Here is the graph of \(f(x) = x^{3} - 3x^{2} + 4x - 2\) and \(f(x) + 10\) which clearly show the two roots:
The graph, however, only shows the real roots. Let’s visualize both the real and complex roots via the following complex plot:
The above used the understanding of a vertical translation to find the roots of the translated function. Let’s confirm all this by actually finding the translated function, \(g(x) = f(x) + 10\), and then finding its roots.
# find f(x - c) + d, where c = 0, d = 10
pT <- createTranslatedPoly(c(1,-3,4,-2),0,10,TRUE)
## [1]
## [1] Create Translated Polynomial
## [1] ----------------------------
## [1]
## [1] Coefficients of f(x)
## [1] 1 -3 4 -2
## [1] Polynomial f(x)
## [1] f(x) = x^3 - 3*x^2 + 4*x - 2
## [1] Horizontal Shift: 0
## [1] Vertical Shift: 10
## [1] Translated Function f(x - 0 ) + 10
## x^3 - 3*x^2 + 4*x + 8
The translated function is \(g(x) = x^{3} - 3x^{2} + 4x + 8\). Finding these roots:
rootFindingProcess(c(1,-3,4,8))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^3 - 3*x^2 + 4*x + 8"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^3 - 3*x^2 + 4*x + 8"
## [1] "Degree of polynomial: 3"
## [1] "By the FTA a total of 3 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 8 -8 4 -4 2 -2 1 -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] -1
## [1] "The Roots Found By The Quadratic Formula:"
## [1] 2-2i 2+2i
## [1] "Total Roots Found: 3"
## [1] "All Roots Found!"
The roots of \(g(x) = f(x) + 10\) were found to be \(x = -1\), \(x = 2 - 2i\), and \(x = 2 + 2i\). These agree with the roots found by solving the root finding problem \(f(x) = -10\). Let’s confirm that these are indeed the roots by evaluating \(g(x) = f(x) + 10\) with the expectation that a \(0\) output would be produced (what it means to be a root!). First, try \(x = -1\):
# Evaluate f(x - c) + d at x = -1
pT(-1)
## [1] 0
The root \(x = -1\) is confirmed. Next, try \(x = 2 + 2i\):
# Evaluate f(x - c) + d at x = 2 + 2i
pT(2 + 2i)
## [1] 0+0i
The root \(x = 2 + 2i\) is confirmed. Next, try \(x = 2 - 2i\):
# Evaluate f(x - c) + d at x = 2 + 2i
pT(2 - 2i)
## [1] 0+0i
The root \(x = 2 - 2i\) is confirmed.
This example verified that for a vertical translation, the roots of the translated function are found via the root finding problem \(f(x) = -d\). It also showed that in a vertical transformation there is no relationship between the roots, including complex roots, of \(f(x)\) and the vertically translated function, \(f(x)+d\).
Consider the function \(f(x) = x^{4} + x^{3} - 2x^{2} + 2x + 4\). Explore the roots of \(f(x)\) and the roots of \(f(x)\) shifted \(2\) units up. That is, \(f(x) + 2\).
Given that \(f(x)\) is a degree \(4\) polynomial we know that there will be \(4\) roots. Let’s find them:
rootFindingProcess(c(1,1,-2,2,4))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^4 + x^3 - 2*x^2 + 2*x + 4"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^4 + x^3 - 2*x^2 + 2*x + 4"
## [1] "Degree of polynomial: 4"
## [1] "By the FTA a total of 4 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 4 -4 2 -2 1 -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] -2 -1
## [1] "The Roots Found By The Quadratic Formula:"
## [1] 1-1i 1+1i
## [1] "Total Roots Found: 4"
## [1] "All Roots Found!"
The roots are \(x = -2\), \(x = -1\), \(x = 1 + i\), and \(x = 1 - i\).
The roots of the vertically translated function can be found by solving \(f(x) = -d\). In this case, \(d = 2\), therefore, the root finding problem is \(f(x) = -2\).
rootFindingProcess(c(1,1,-2,2,4),c(-2))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^4 + x^3 - 2*x^2 + 2*x + 4"
## [1] "Polynomial g(x)"
## [1] "g(x) = -2"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^4 + x^3 - 2*x^2 + 2*x + 6"
## [1] "Degree of polynomial: 4"
## [1] "By the FTA a total of 4 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 6 -6 3 -3 2 -2 1 -1
## [1] "No Rational Roots Found"
## [1] "Total Roots Found: 0"
## [1] "Roots Left To Find: 4"
rootFindingProcess.R was unable to find the roots. This
is because there were no rational roots so it was unable to reduce the
degree \(4\) polynomial to a degree
\(2\) (this limitation was
discussed in the root finding chapter). So, let’s try the
PolynomF package:
# create a polynomial object
x <- polynom()
# define the polynomial
p <- x^4 + x^3 - 2*x^2 + 2*x + 6
# find the roots
solve(p)
## [1] -1.58715-0.127299i -1.58715+0.127299i 1.08715-1.088455i 1.08715+1.088455i
Interesting. Whereas two of the four roots were real (and two complex), all the roots of \(f(x) + d\) are complex.
Let’s look at the graph of \(f(x)\) and \(f(x) + d\)
The graph showed the two real roots of \(f(x)\), \(x = -2\) and \(x = -1\), and clearly shows that there are no real roots of the translated function, \(f(x) + d\). Since any complex roots would be unable to be shown on this particular graph, let’s look at the complex plot of the roots:
As expected, all four roots of \(f(x) + d\) are complex.
This example verified that for a vertical translation, the roots of the translated function are found via the root finding problem \(f(x) = - d\). It also showed that in a vertical transformation real roots of \(f(x)\) may become complex in the translated function, \(f(x) + d\). It is also possible that complex roots may become real.
A horizontal shift, or translation, is the moving of a function, in its entirety, left or right. Each point on the curve moves left or right by the same distance. In other words, for some function, \(f(x)\), the moving left or right is achieved via \(f(x - c)\), where \(c\) is a real number.
In Section ??.2 of Chapter ?? a
summary of the effects on a function, \(f(x)\), by a horizontal translation were
given. The examples in the chapter were extensive and comprehensive. The
purpose here is to verify some of the key concepts using R
and how R can be used to explore function translation. We
will explore some of the key ideas of a horizontal translation here.
The first to be explored is the translated function, \(g(x) = f(x - c)\).
Given \(f(x) = x^{3} - 2x^{2} - x + 2\), find the related function, \(g(x)\), to \(f(x)\) shifted \(4\) units to the right.
This is the horizontal shift of \(f(x)\) to the right \(4\) units, hence, \(g(x) = f(x - 4)\). This boils down to function evaluation:
\[ \begin{align} g(x) &= f(x - 4) \\ &= (x-4)^{3} - 2(x-4)^{2} - (x-4) + 2 \\ &= (x^{3} - 12x^{2} + 48x - 64) - 2(x^{2} - 8x + 16) - x + 4 + 2 \\ &= (x^{3} - 12x^{2} + 48x - 64) - 2x^{2} + 16x - 32 - x + 6 \\ &= x^{3} - 14x^{2} + 63x - 90 \end{align} \]
Hence, the translated function of \(f(x) =
x^{3} - 2x^{2} - x + 2\) is \(f(x - 4)
= x^{3} - 14x^{2} + 63x - 90\). Let’s verify this with
createTranslatedPoly.R:
# find f(x - c) + d, where c = 4, d = 0
pT <- createTranslatedPoly(c(1,-2,-1,2),4,0,TRUE)
## [1]
## [1] Create Translated Polynomial
## [1] ----------------------------
## [1]
## [1] Coefficients of f(x)
## [1] 1 -2 -1 2
## [1] Polynomial f(x)
## [1] f(x) = x^3 - 2*x^2 - x + 2
## [1] Horizontal Shift: 4
## [1] Vertical Shift: 0
## [1] Translated Function f(x - 4 ) + 0
## x^3 - 14*x^2 + 63*x - 90
the translated function of \(f(x) = x^{3} - 2x^{2} - x + 2\) is \(f(x - 4) = x^{3} - 14x^{2} + 63x - 90\) has been verified.
The next key idea to explore is that every point \((x,y)\) on \(f(x)\) moves to the point \((x+c, y)\) on \(f(x - c)\). If \(c < 0\), the function moves \(c\) units to the left. If \(c > 0\), the function moves \(c\) units to the right.
Given \(f(x) = 2x^{7} - 3x^{6} + x^{5} - 2x^{4} - 4x^{3} + x^{2} - x - 5\), explore where the point on \(f(x)\) evaluated at \(x = -1\) will be on the function translated 2 units to the left.
Let’s first find what the point is on \(f(x)\) evaluated at \(x = -1\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){2*x^{7} - 3*x^{6} + x^{5} - 2*x^{4} - 4*x^{3} + x^{2} - x - 5}
# evaluate f(x) at x = -1; i.e., f(-1)
fractions(fFunc(-1))
## [1] -7
The function, \(f(x) = 2x^{7} - 3x^{6} + x^{5} - 2x^{4} - 4x^{3} + x^{2} - x - 5\) evaluated at \(x = -1\) is \(-7\). The point, therefore, on \(f(x)\) is \((-1,-7)\). Under a horizontal shift of \(2\) units to the left we expect this point to become
\[ \begin{align} (-1,-7) &\to (-1-2,-7) = (-3,-7) \end{align} \]
To verify this, let’s first find the translated function, \(f(x + 2)\):
# find f(x - c) + d, where c = 4, d = 0
pT <- createTranslatedPoly(c(2,-3,1,-2,-4,1,-1,-5),-2,0,TRUE)
## [1]
## [1] Create Translated Polynomial
## [1] ----------------------------
## [1]
## [1] Coefficients of f(x)
## [1] 2 -3 1 -2 -4 1 -1 -5
## [1] Polynomial f(x)
## [1] f(x) = 2*x^7 - 3*x^6 + x^5 - 2*x^4 - 4*x^3 + x^2 - x - 5
## [1] Horizontal Shift: -2
## [1] Vertical Shift: 0
## [1] Translated Function f(x - -2 ) + 0
## 2*x^7 + 25*x^6 + 133*x^5 + 388*x^4 + 660*x^3 + 633*x^2 + 291*x + 29
The translated function is \(f(x + 2) = 2x^{7} + 25x^{6} + 133x^{5} + 388x^{4} + 660x^{3} + 633x^{2} + 291x + 29\). Let’s evaluate it at \(x = -3\):
# Evaluate f(x - c) + d at x = -3
pT(-3)
## [1] -7
As expected, the point \((-1,-7)\) on \(f(x)\) is translated to the point \((-3,-7)\) on \(f(x + 2)\).
This example shows that under a horizontal shift, it is only the x-coordinate of a point on the function, \(f(x)\), changes. The y-coordinate remains the same. The implication of this is all the output values remain the same; in other words, the range of \(f(x)\) and \(f(x - c)\) remain the same.
The next idea to explore is the effect of a horizontal translation on some key function characteristics, especially roots.
In Chapter ??, Function Translation, Example ??.12, the function \(f(x) = x^{4} - 2x^3 + x^2 + 2x - 2\) was explored as it underwent a horizontal translation of \(3\) units to the right. Verify the conclusions made with respect to the roots, y-intercept, x-intercept, domain, and range.
Let’s first consider the function itself, \(f(x) = x^{4} - 2x^3 + x^2 + 2x - 2\). The y-intercept was found to be \((0,-2)\). Let’s verify that by evaluating \(f(x)\) at \(x = 0\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^4 - 2*x^3 + x^2 + 2*x - 2}
# evaluate f(x) at x = 0; i.e., f(0)
fractions(fFunc(0))
## [1] -2
The y-intercept is indeed \((0,-2)\).
To find the x-intercepts let’s first find the roots of \(f(x)\). The roots of \(f(x) = 0\) were found to be \(x = -1\), \(x =
1\), \(x = 1 + i\), and \(x = 1 - i\). Let’s verify that by using
rootFindingProcess.R:
rootFindingProcess(c(1,-2,1,2,-2))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^4 - 2*x^3 + x^2 + 2*x - 2"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^4 - 2*x^3 + x^2 + 2*x - 2"
## [1] "Degree of polynomial: 4"
## [1] "By the FTA a total of 4 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 2 -2 1 -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] 1 -1
## [1] "The Roots Found By The Quadratic Formula:"
## [1] 1-1i 1+1i
## [1] "Total Roots Found: 4"
## [1] "All Roots Found!"
The roots are indeed \(x = -1\), \(x = 1\), \(x = 1 + i\), and \(x = 1 - i\). But, we should always verify that each identified root causes the output of \(f(x)\) to be \(0\). This is key to understanding what being a root means. Let’s first verify the root \(x = -1\).
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^4 - 2*x^3 + x^2 + 2*x - 2}
# evaluate f(x) at x = -1; i.e., f(-1)
fFunc(-1)
## [1] 0
The root, \(x = -1\), is indeed a root for \(f(-1) = 0\). Next, let’s verify the root \(x = 1\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^4 - 2*x^3 + x^2 + 2*x - 2}
# evaluate f(x) at x = 1; i.e., f(1)
fFunc(1)
## [1] 0
The root, \(x = 1\), is indeed a root for \(f(1) = 0\). Next, let’s verify the root \(x = 1 + i\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^4 - 2*x^3 + x^2 + 2*x - 2}
# evaluate f(x) at x = 1 + i; i.e., f(1 + i)
fFunc(1+1i)
## [1] 0+0i
The root, \(x = 1 + i\), is indeed a root for \(f(1 + i) = 0\). Next, let’s verify the root \(x = 1 - i\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^4 - 2*x^3 + x^2 + 2*x - 2}
# evaluate f(x) at x = 1 - i; i.e., f(1 - i)
fFunc(1-1i)
## [1] 0+0i
The root, \(x = 1 - i\), is indeed a root for \(f(1 - i) = 0\). The roots have been verified.
The x-intercepts will, of course, be \((-1,0)\) and \((1,0)\) which are visible in the real plane. The roots \(1 + i\) and \(1 - i\) are complex, hence will be visible in the complex plane. Here are the roots of \(f(x) = x^{4} - 2x^3 + x^2 + 2x - 2\) using a complex plot:
The characteristics roots, x-intercept, and y-intercept of \(f(x) = x^{4} - 2x^3 + x^2 + 2x - 2\) have been verified.
Now, let’s turn our attention to the horizontal translation of \(f(x)\) \(3\) units to the right, \(f(x - 3)\).
The actual translated function was determined by hand and
found to be \(f(x - 3) = x^{4} - 14x^{3} +
73x^{2} - 166x + 136\). Let’s verify this using
createTranslatedPoly.R:
# find f(x - c) + d, where c = 4, d = 0
pT <- createTranslatedPoly(c(1,-2,1,2,-2),3,0,TRUE)
## [1]
## [1] Create Translated Polynomial
## [1] ----------------------------
## [1]
## [1] Coefficients of f(x)
## [1] 1 -2 1 2 -2
## [1] Polynomial f(x)
## [1] f(x) = x^4 - 2*x^3 + x^2 + 2*x - 2
## [1] Horizontal Shift: 3
## [1] Vertical Shift: 0
## [1] Translated Function f(x - 3 ) + 0
## x^4 - 14*x^3 + 73*x^2 - 166*x + 136
The translated function is indeed \(f(x - 3) = x^{4} - 14x^{3} + 73x^{2} - 166x + 136\).
The y-intercept was found to be \((0,136)\). Let’s verify that by evaluating \(f(x - 3)\) at \(x = 0\):
# evaluate the translated function at x = 0
pT(0)
## [1] 136
The y-intercept is indeed \((0,136)\).
To find the x-intercepts let’s first find the roots of \(f(x - 3)\). The roots of \(f(x - 3) = 0\) were found to be \(x = 2\), \(x =
4\), \(x = 4 + i\), and \(x = 4 - i\). Let’s verify that by using
rootFindingProcess.R:
rootFindingProcess(c(1,-14,73,-166,136))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^4 - 14*x^3 + 73*x^2 - 166*x + 136"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^4 - 14*x^3 + 73*x^2 - 166*x + 136"
## [1] "Degree of polynomial: 4"
## [1] "By the FTA a total of 4 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 136 -136 68 -68 34 -34 17 -17 8 -8 4 -4 2 -2 1
## [16] -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] 4 2
## [1] "The Roots Found By The Quadratic Formula:"
## [1] 4-1i 4+1i
## [1] "Total Roots Found: 4"
## [1] "All Roots Found!"
The roots are indeed \(x = 2\), \(x = 4\), \(x = 4 + i\), and \(x = 4 - i\). But, we should always verify that each identified root causes the output of \(f(x- 3)\) to be \(0\). This is key to understanding what being a root means. Let’s first verify the root \(x = 2\).
# evaluate the translated function at x = 2
pT(2)
## [1] 0
The root, \(x = 2\), is indeed a root for \(f(x - 3) = 0\) when evaluated at \(x = 4\). Next, let’s verify the root \(x = 4\):
# evaluate the translated function at x = 4
pT(4)
## [1] 0
The root, \(x = 4\), is indeed a root for \(f(x - 3) = 0\) when evaluated at \(x = 4\). Next, let’s verify the root \(x = 4 + i\):
# evaluate the translated function at x = 4 + i
pT(4 + 1i)
## [1] 0+0i
The root, \(x = 4 + i\), is indeed a root for \(f(x - 3) = 0\) when evaluated at \(x = 4 + i\). Next, let’s verify the root \(x = 4 - i\):
# evaluate the translated function at x = 4 - i
pT(4 - 1i)
## [1] 0+0i
The root, \(x = 4 - i\), is indeed a root for \(f(x - 3) = 0\) when evaluated at \(x = 4 - i\). The roots have been verified.
The x-intercepts will, of course, be \((2,0)\) and \((4,0)\) which are visible in the real plane. The roots \(4 + i\) and \(4 - i\) are complex, hence will be visible in the complex plane. Here are the roots of \(f(x - 3) = x^{4} - 14x^{3} + 73x^{2} - 166x + 136\) using a complex plot:
Let’s consider the domains. Both the function \(f(x) = x^{4} - 2x^3 + x^2 + 2x - 2\) and the translated function \(f(x - 3) = x^{4} - 14x^{3} + 73x^{2} - 166x + 136\) are polynomials. The domain of all polynomials are all real numbers, \((-\infty,\infty)\).
Since the functions \(f(x)\) and \(f(x - 3)\) are both degree \(4\), the range has to be determined. We know that both ends of the function will either go to \(\infty\) or \(-\infty\), what we don’t know is where the minimum (or maximum) value will be. Since this is a horizontal translation, it is only necessary to find the range of either \(f(x)\) or \(f(x - 3)\), they will be the same. Let’s consider \(f(x) = x^{4} - 2x^3 + x^2 + 2x - 2\). Though this is above the level here, we have discussed this elsewhere where we will use the derivative of \(f(x)\): \(f'(x) = 4x^{3} - 6x^{2} + 2x + 2\). There will be a minimum or maximum value of \(f(x)\) at the root(s) of \(f'(x) = 0\). To help us, let’s take a look at the graph of \(f'(x)\):
From the graph, we see that there is a root somewhere in the interval \([-0.5,-0.25]\). Using the bisection method to find this root, we find:
theFunc <- "4*x^3 - 6*x^2 + 2*x + 2"
aValue <- -0.5
bValue <- -0.25
tolerance <- 1e-7
numIterations <- 100
toleranceMethod <- 2
df <- bisectionMethod1(theFunc,aValue,bValue,tolerance,toleranceMethod,numIterations)
| i | a | b | c | fOfa | fOfb | fofc | |
|---|---|---|---|---|---|---|---|
| 18 | 18 | -0.3981628 | -0.3981609 | -0.3981619 | -1.64e-05 | 1e-07 | -8.1e-06 |
| 19 | 19 | -0.3981619 | -0.3981609 | -0.3981614 | -8.10e-06 | 1e-07 | -4.0e-06 |
| 20 | 20 | -0.3981614 | -0.3981609 | -0.3981612 | -4.00e-06 | 1e-07 | -1.9e-06 |
| 21 | 21 | -0.3981612 | -0.3981609 | -0.3981611 | -1.90e-06 | 1e-07 | -9.0e-07 |
| 22 | 22 | -0.3981611 | -0.3981609 | -0.3981610 | -9.00e-07 | 1e-07 | -4.0e-07 |
| 23 | 23 | -0.3981610 | -0.3981609 | -0.3981610 | -4.00e-07 | 1e-07 | -1.0e-07 |
The root is estimated to be \(-0.3981610\). Since the concavity of \(f(x)\) (and \(f(x - 3)\) for that matter) is up, so this means that there is a minimum at \(f(-0.3981610)\). Let’s find what that is:
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^4 - 2*x^3 + x^2 + 2*x - 2}
# evaluate f(x) at x = -0.3981610; i.e., f(-0.3981610)
fFunc(-0.3981610)
## [1] -2.486415
The minimum, therefore, occurs at \((-0.3981610,-2.486415)\). Thus, the range of \(f(x)\) and \(f(x - 3)\) is \([-2.486415,\infty)\).
The summary table of the characteristics of \(f(x) = x^{4} - 2x^3 + x^2 + 2x - 2\) and the translated function \(f(x - 3) = x^{4} - 14x^{3} + 73x^{2} - 166x + 136\) presented in Chapter ??, Function Translation, Example ??.12 has been verified.
| \(f(x)\) | \(f(x - 3)\) | |
|---|---|---|
| Domain | \(\left(-\infty,\infty\right)\) | \(\left(-\infty,\infty\right)\) |
| Range | \([\approx -2.5,\infty)\) | \([\approx -2.5,\infty)\) |
| y-intercept | \((0,-2)\) | \((0,136)\) |
| x-intercept | \((-1,0)\) and \((1,0)\) | \((2,0)\) and \((4,0)\) |
| Roots | \(-1\), \(1\), \(1 \pm i\) | \(2\), \(4\), \(4 \pm i\) |
.
Returning to the roots, the expectation of a horizontal translation is that the real roots are shifted by \(c\). That was indeed the case here. The root \(x = -1\) of \(f(x)\) became the root \(x = -1 + 3 = 2\) of \(f(x - 3)\). The root \(x = 1\) of \(f(x)\) became the root \(x = 1 + 3 = 4\) of \(f(x - 3)\). The following graph illustrates this idea.
Likewise under a horizontal translation a complex root, \(a + bi\), becomes \((a + c) + bi\) on \(f(x - c)\). That was indeed the case here. The root \(x = 1 + i\) of \(f(x)\) became the root \(x = (1 + 3) + i = 4 + i\) of \(f(x - 3)\). The root \(x = 1 - i\) of \(f(x)\) became the root \(x = (1 + 3) - i = 4 - i\) of \(f(x - 3)\). The following complex of the real and complex roots of \(f(x)\) and \(f(x - 3)\) illustrate this idea
Now, let us turn our attention to a combined translation. That is a function, \(f(x)\), undergoing both a horizontal and vertical translation, \(f(x - c) + d\).
A horizontal shift and a vertical shift, is the moving of a function, in its entirety, left or right and up or down. Each point on the curve moves left or right by the same distance and moves or down by the same distance. In other words, for some function, \(f(x)\), the moving left or right and up or down is achieved via \(f(x - c) + d\), where \(c\) and \(d\) are a real numbers.
In Section ??.2 of Chapter ?? a
summary of the effects on a function, \(f(x)\), by a horizontal and vertical
translation were given. The examples in the chapter were extensive and
comprehensive. The purpose here is to verify some of the key concepts
using R and how R can be used to explore
function translation. We will explore some of the key ideas of a
horizontal translation here.
The first to be explored is the translated function, \(g(x) = f(x - c) + d\).
Given \(f(x) = 2x^{3} - x^{2} - 3x + 1\), find the related function, \(g(x)\), to \(f(x)\) shifted \(1\) unit to the left and \(3\) units up.
This is the horizontal shift of \(f(x)\) to the left \(1\) unit and \(3\) units up, hence, \(g(x) = f(x + 1) + 3\). This boils down to function evaluation:
\[ \begin{align} g(x) &= f(x + 1) + 3 \\ &= \left[2(x+1)^{3} - (x+1)^{2} - 3(x + 1) + 1\right] + 3 \\ &= \left[2(x^{3} + 3x^{2} + 3x + 1) -(x^{2} + 2x + 1) -3x-3\right]+3\\ &= \left[2x^{3} + 6x^{2} + 6x + 2 - x^{2} - 2x -1-3x-3+1\right] + 3 \\ &= \left[2x^3 + 5x^{2} +x-1\right]+3 \\ &= 2x^{3} + 5x^{2} + x + 2 \end{align} \]
Hence, the translated function of \(f(x) =
x^{3} - 2x^{2} - x + 2\) is \(f(x + 1)
+ 3 = 2x^{3} + 5x^{2} + x + 2\). Let’s verify this with
createTranslatedPoly.R:
# find f(x - c) + d, where c = -1, d = 3
pT <- createTranslatedPoly(c(2,-1,-3,1),-1,3,TRUE)
## [1]
## [1] Create Translated Polynomial
## [1] ----------------------------
## [1]
## [1] Coefficients of f(x)
## [1] 2 -1 -3 1
## [1] Polynomial f(x)
## [1] f(x) = 2*x^3 - x^2 - 3*x + 1
## [1] Horizontal Shift: -1
## [1] Vertical Shift: 3
## [1] Translated Function f(x - -1 ) + 3
## 2*x^3 + 5*x^2 + x + 2
the translated function of \(f(x) = x^{3} - 2x^{2} - x + 2\) is \(f(x + 1) + 3 = 2x^{3} + 5x^{2} + x + 2\) has been verified.
The next key idea to explore is that every point \((x,y)\) on \(f(x)\) moves to the point \((x+c, y+d)\) on \(f(x - c) + d\). If \(c < 0\), the function moves \(c\) units to the left. If \(c > 0\), the function moves \(c\) units to the right. IF \(d < 0\), the function moves \(d\) units down. If \(d > 0\), the function moves \(d\) units up.
Given \(f(x) = 2x^{7} - 3x^{6} + x^{5} - 2x^{4} - 4x^{3} + x^{2} - x - 5\), explore where the point on \(f(x)\) evaluated at \(x = -3\) will be on the function translated 2 units to the left and \(7\) units down.
Let’s first find what the point is on \(f(x)\) evaluated at \(x = -3\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){2*x^{7} - 3*x^{6} + x^{5} - 2*x^{4} - 4*x^{3} + x^{2} - x - 5}
# evaluate f(x) at x = -3; i.e., f(-3)
fractions(fFunc(-3))
## [1] -6851
The function, \(f(x) = 2x^{7} - 3x^{6} + x^{5} - 2x^{4} - 4x^{3} + x^{2} - x - 5\) evaluated at \(x = -3\) is \(-6851\). The point, therefore, on \(f(x)\) is \((-3,-6851)\). Under a horizontal shift of \(2\) units to the left and \(7\) units down we expect this point to become
\[ \begin{align} (-3,-6851) &\to (-3-2,-6851 - 7) = (-5,-6858) \end{align} \]
To verify this, let’s first find the translated function, \(f(x + 2) - 7\):
# find f(x - c) + d, where c = -2, d = -7
pT <- createTranslatedPoly(c(2,-3,1,-2,-4,1,-1,-5),-2,-7,TRUE)
## [1]
## [1] Create Translated Polynomial
## [1] ----------------------------
## [1]
## [1] Coefficients of f(x)
## [1] 2 -3 1 -2 -4 1 -1 -5
## [1] Polynomial f(x)
## [1] f(x) = 2*x^7 - 3*x^6 + x^5 - 2*x^4 - 4*x^3 + x^2 - x - 5
## [1] Horizontal Shift: -2
## [1] Vertical Shift: -7
## [1] Translated Function f(x - -2 ) + -7
## 2*x^7 + 25*x^6 + 133*x^5 + 388*x^4 + 660*x^3 + 633*x^2 + 291*x + 22
The translated function is \(f(x + 2) = 2x^{7} + 25x^{6} + 133x^{5} + 388x^{4} + 660x^{3} + 633x^{2} + 291x + 22\). Let’s evaluate it at \(x = -5\):
# Evaluate f(x - c) + d at x = -5
pT(-5)
## [1] -6858
As expected, the point \((-3,-6851)\) on \(f(x)\) is translated to the point \((-5,-6858)\) on \(f(x + 2) - 7\).
This example shows that under a horizontal and vertical shift, both the x-coordinate and the y-coordinate of a point on the function, \(f(x)\), changes. When doing a a horizontal and vertical shift it is also true that the order in which a point is shifted does not matter.
The next idea to explore is the effect of a combined horizontal and vertical translation on some key function characteristics, especially roots.
In Chapter ??, Function Translation, Example ??.17, the function \(f(x) = x^{3} - x^{2} + x - 1\) was explored as it underwent a translation of \(1\) unit to the right and \(4\) units up. Verify the conclusions made with respect to the roots, y-intercept, x-intercept, domain, and range.
A translation of \(f(x)\) both horizontally and vertically is of the form \(f(x - c) + d\), where \(c\) represents the horizontal shift and \(d\) represents the vertical shift. In this example \(c = 1\) since \(f(x)\) is being shifted \(1\) unit to the right; \(d = 4\) since \(f(x)\) is being shifted \(4\) units up Thus, the translation is \(f(x - 1) + 4\).
Let’s first consider the function itself, \(f(x) = x^{3} - x^{2} + x - 1\). The y-intercept was found to be \((0,-1)\). Let’s verify that by evaluating \(f(x)\) at \(x = 0\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^3 - x^2 + x - 1}
# evaluate f(x) at x = 0; i.e., f(0)
fractions(fFunc(0))
## [1] -1
The y-intercept is indeed \((0,-1)\).
To find the x-intercepts let’s first find the roots of \(f(x)\). The roots of \(f(x) = 0\) were found to be \(x = 1\), \(x =
i\), and \(x = -i\). Let’s
verify that by using rootFindingProcess.R:
rootFindingProcess(c(1,-1,1,-1))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^3 - x^2 + x - 1"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^3 - x^2 + x - 1"
## [1] "Degree of polynomial: 3"
## [1] "By the FTA a total of 3 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 1 -1
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] 1
## [1] "The Roots Found By The Quadratic Formula:"
## [1] 0+1i 0-1i
## [1] "Total Roots Found: 3"
## [1] "All Roots Found!"
The roots are indeed \(x = 1\), \(x = i\), and \(x = -i\). But, we should always verify that each identified root causes the output of \(f(x)\) to be \(0\). This is key to understanding what being a root means. Let’s first verify the root \(x = 1\).
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^3 - x^2 + x - 1}
# evaluate f(x) at x = 1; i.e., f(1)
fFunc(1)
## [1] 0
The root, \(x = 1\), is indeed a root for \(f(1) = 0\). Next, let’s verify the root \(x = i\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^3 - x^2 + x - 1}
# evaluate f(x) at x = i; i.e., f(i)
fFunc(0+1i)
## [1] 0+0i
The root, \(x = i\), is indeed a root for \(f(i) = 0\). Next, let’s verify the root \(x = -i\):
# define the function f(x) being sure to enter the function using ASCII notation
fFunc <- function(x){x^3 - x^2 + x - 1}
# evaluate f(x) at x = -i; i.e., f(-i)
fFunc(0-1i)
## [1] 0+0i
The root, \(x = -i\), is indeed a root for \(f(-i) = 0\). The roots have been verified.
The x-intercept will, of course, be \((1,0)\) which is visible in the real plane. The roots \(i\) and \(-i\) are complex, hence will be visible in the complex plane. Here are the roots of \(f(x) = x^{3} - x^{2} + x - 1\) using a complex plot:
The characteristics roots, x-intercept, and y-intercept of \(f(x) = x^{3} - x^{2} + x - 1\) have been verified.
Now, let’s turn our attention to the horizontal and vertical translation of \(f(x)\) \(1\) unit to the right and \(4\) units up, \(f(x - 1) + 4\).
The actual translated function was determined by hand and
found to be \(f(x - 1) + 4 = x^{3} - 4x^{2} +
6x\). Let’s verify this using
createTranslatedPoly.R:
# find f(x - c) + d, where c = 1, d = 4
pT <- createTranslatedPoly(c(1,-1,1,-1),1,4,TRUE)
## [1]
## [1] Create Translated Polynomial
## [1] ----------------------------
## [1]
## [1] Coefficients of f(x)
## [1] 1 -1 1 -1
## [1] Polynomial f(x)
## [1] f(x) = x^3 - x^2 + x - 1
## [1] Horizontal Shift: 1
## [1] Vertical Shift: 4
## [1] Translated Function f(x - 1 ) + 4
## x^3 - 4*x^2 + 6*x
The translated function is indeed \(f(x - 1) + 4 = x^{3} - 4x^{2} + 6x\).
The y-intercept was found to be \((0,0)\). Let’s verify that by evaluating \(f(x - 1) + 4\) at \(x = 0\):
# evaluate the translated function at x = 0
pT(0)
## [1] 0
The y-intercept is indeed \((0,0)\).
To find the x-intercepts let’s first find the roots of \(f(x - 1) + 4\). The roots of \(f(x - 1) + 4 = 0\) were found to be \(x = 0\), \(x = 2
+ \sqrt{2}i\), and \(x = 2 -
\sqrt{2}i\). Let’s verify that by using
rootFindingProcess.R:
rootFindingProcess(c(1,-4,6,0))
## [1] " ROOT FINDING PROCESS FOR f(x) - g(x) = 0"
## [1] " ----------------------------------------"
## [1] "Polynomial f(x)"
## [1] "f(x) = x^3 - 4*x^2 + 6*x"
## [1] "Polynomial g(x)"
## [1] "g(x) = 0"
## [1] "Root finding polynomial"
## [1] "f(x) - g(x) = x^3 - 4*x^2 + 6*x"
## [1] "Degree of polynomial: 3"
## [1] "By the FTA a total of 3 roots exist"
## [1] "The Rational Root Theorem Identifies The Following Possible Rational Roots"
## [1] 6 -6 3 -3 2 -2 1 -1 0
## [1] "The Remainder Theorem Result of f(x)/(x-c) Identified These Rational Roots"
## [1] 0
## [1] "The Roots Found By The Quadratic Formula:"
## [1] 2-1.414214i 2+1.414214i
## [1] "Total Roots Found: 3"
## [1] "All Roots Found!"
The roots are indeed \(x = 0\), \(x = 2 + \sqrt{2}i\), and \(x = 2 - \sqrt{2}i\). But, we should always verify that each identified root causes the output of \(f(x- 1) + 4\) to be \(0\). This is key to understanding what being a root means. Let’s first verify the root \(x = 0\).
# evaluate the translated function at x = 0
pT(0)
## [1] 0
The root, \(x = 0\), is indeed a root for \(f(x - 1) + 4 = 0\) when evaluated at \(x = 0\). Next, let’s verify the root \(x = 2 + \sqrt{2}i\):
# evaluate the translated function at x = 0
pT(2+1.414213562i)
## [1] 2.110545e-09+1.49238e-09i
Note: The results of the evaluation are not \(0 + 0i\). This is due to floating point
arithmetic and precision, it is highly unlikely that an exact answer of
\(0 + 0i\) will be gotten. However, the
real part 2.110545e-09 and the complex part 1.49238e-09 are both
sufficiently close to 0 that, from a practical perspective, the answer
can be considered to be \(0 + 0i\). We
can check this by comparing these numbers to \(0 + 0i\) within a tolerance of
approximately \(1.49(10^{-8})\), which
is what is considered to be a “standard” machine level threshold, using
the all.equal() command in R. If the number
entered is considered “equal” to 0, a TRUE will be
returned. So, let’s do that, first checking \(2.110545e-09\) and then \(1.49238e-09\):
# check whether the number 2.110545e-09 is equal to 0 within the specified threshold
all.equal(2.110545e-09, 0, tolerance = sqrt(.Machine$double.eps))
## [1] TRUE
# check whether the number 1.49238e-09 is equal to 0 within the specified threshold
all.equal(1.49238e-09, 0, tolerance = sqrt(.Machine$double.eps))
## [1] TRUE
Both checks passed, thus the root, \(x = 2 + \sqrt{2}i\), is indeed a root for \(f(x - 1) + 4 = 0\) when evaluated at \(x = 2 + \sqrt{2}i\). Next, let’s verify the root \(x = 2 - \sqrt{2}i\):
# evaluate the translated function at x = 0
pT(2-1.414214i)
## [1] -2.475592e-06+1.750508e-06i
With the same caveats as above, the root, \(x = 2 - \sqrt{2}i\), is indeed a root for \(f(x - 1) + 4 = 0\) when evaluated at \(x = 2 - \sqrt{2}i\). The roots have been verified.
The x-intercept will, of course, be \((0,0)\) which is visible in the real plane. The roots \(2 + \sqrt{2}i\) and \(2 - \sqrt{2}i\) are complex, hence will be visible in the complex plane. Here are the roots of \(f(x - 1) + 4 = x^{3} - 4x^{2} + 6x\) using a complex plot:
Let’s consider the domains. Both the function \(f(x) = x^{3} - x^{2} + x - 1\) and the translated function \(f(x - 1) + 4 = x^{3} - 4x^{2} + 6x\) are polynomials. The domain of all polynomials are all real numbers, \((-\infty,\infty)\). Since both these functions are degree \(3\) polynomials, their ranges are all real numbers, \((-\infty,\infty)\)
The summary table of the characteristics of \(f(x) = x^{3} - x^{2} + x - 1\) and the translated function \(f(x - 1) + 4 = x^{3} - 4x^{2} + 6x\) presented in Chapter ??, Function Translation, Example ??.17 has been verified.
| \(f(x)\) | \(f(x - 1) + 4\) | |
|---|---|---|
| Domain | \(\left(-\infty,\infty\right)\) | \(\left(-\infty,\infty\right)\) |
| Range | \((-\infty,\infty)\) | \((-\infty,\infty)\) |
| y-intercept | \((0,-1)\) | \((0,0)\) |
| x-intercept | \((1,0)\) | \((0,0)\) |
| Roots | \(1\), \(i\), \(-i\) | \(0\), \(2-\sqrt{2}i\), \(2+\sqrt{2}i\) |
.
Here is the plot of \(f(x)\) and \(f(x - 1) + 4\) for a visualization of the function and the translated function from which many of the above defined characteristics may be observed).
Here’s is the complex plot of the roots of \(f(x)\) and the roots of \(f(x - 1) + 4\):
In this appendix we explored how some of these ideas of function
translation are handled in a practical, applied sense using
R as well as how they can be used to verify the concepts
developed in Chapter ??, Function Translation.
R CodeSeveral self-developed R routines were used in this
appendix. What follows is the R code for
createTranslatedPoly.R. The others are:
rootFindingProcess.R which can be found in
Appendix Root FindingbisectionMethod.R which can be found in
Appendix Root FindingIn addition, thePolynomF package in R was
used which was described in Appendix Root Finding.
Function Translation
The R code for the self-developed routine
createTranslatedPoly.R that creates the translated
function, \(f(x - c) + d\) for a given
polynomial, \(f(x)\).
library(PolynomF)
source('./source/coeffsToPoly.R')
createTranslatedPoly <- function(theCoeffs,
theC,
theD,
verbose = FALSE) {
# this routine will create the translated function, f(x - c) + d for a
# given polynomial function, f(x)
#
x <- polynom()
p <- x - theC
pT <- 0
theDegree <- length(theCoeffs) - 1
i <- theDegree
while (i > 0) {
# first form the ith power of (X - c), (x - c)^i
#
pI <- 1
j <- i
while (j > 0) {
pI <- pI * p
j <- j - 1
}
# now multiply by the a_i coefficient
pI <- theCoeffs[length(theCoeffs)-i]*pI
# now add it to pT (the translated polynomial thus far)
pT <- pT + pI
i <- i - 1
}
# now add the a_0
pT <- pT + theCoeffs[length(theCoeffs)]
# now add theD
pT <- pT + theD
#
if (verbose) {
print('',quote = FALSE)
print(' Create Translated Polynomial',,quote = FALSE)
print(' ----------------------------',quote = FALSE)
print('',quote = FALSE)
print('Coefficients of f(x)',quote = FALSE)
print(theCoeffs)
print('Polynomial f(x)',quote = FALSE)
print(coeffsToPoly(theCoeffs,'f(x)'),quote = FALSE)
print(paste('Horizontal Shift:',theC),quote = FALSE)
print(paste('Vertical Shift:',theD),quote = FALSE)
print(paste('Translated Function f(x -',theC,') +',theD),quote = FALSE)
print(pT, decreasing = TRUE)
}
return(pT)
}
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.
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()
| 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.
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)} \]
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()
| 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()
| 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.
R CodeThe 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)
}
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.
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)\).
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()
| 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.
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()
| 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.
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.
R CodeThe 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)
}
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.
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()
| 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()
| 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)\).
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()
| 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()
| 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 ??.
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()
| 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.
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!!
R CodeThe 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)
}