Let’s extend our composition of linear functions to piecewise linear functions. Let \(T\) and \(g\) be two piecewise linear functions as defined below.
Graph of \(y = T(v)\).
Let’s create the composition \(T \circ g = T(g)\).
This means the range of \(g\) needs to be inside the domain of \(T\). Since there are two pieces to each of \(T\) and \(g\), let’s follow the pieces separately. The chart below shows the parts of the range of \(g\) coming from the individual linear pieces as well as the parts of the domain of \(T\).
We can see that there are numbers in the full range of \(g\) that are not in the full domain of \(T\).
For instance, \(0\) is in the range of \(g\) and not in the domain of \(T\).
We have two numbers in the domain of \(g\) that \(g\) maps to \(0\). One from each piece.
- \(g\left ( -\frac {3}{2} \right ) = -2 \left ( -\frac {3}{2} \right ) - 3 = 3 - 3 = 0\)
- \(g\left ( \frac {32}{7} \right ) = -\frac {7}{4} \cdot \left ( \frac {32}{7} \right ) - 8 = 8 - 8 = 0\)
We cannot include these in the domain of the composition, because they would result in \(T(0)\), which is not defined.
Therefore, we cannot include \(-\frac {3}{2}\) nor \(\frac {32}{7}\) in the composition domain we are constructing.
What other numbers from the domain of \(g\) do we need to leave out?
We need to map the domain of \(T\) back onto the range of \(g\), find the intersection, and then work our way back into the domain of \(g\), in order to restrict the domain of \(g\) to just the numbers that work in the composition.
Range of \(g\) \(\subseteq \) Domain of \(T\)
Intersection
We are given the domain of \(T\): \((-4,-1] \cup [1, 7)\).
We need the range of \(g\).
Each piece of \(g\) is linear, so we just need to see the value of \(g\) at each enpoint of each piece.
Piece #1: \(\left [ -\frac {3}{2}, 2 \right ]\)
- \(g\left ( -\frac {3}{2} \right ) = -2 \left ( -\frac {3}{2} \right ) - 3 = 0 \)
- \(g(2) = -2 (2)-3 = -7\)
The range of piece #1 is \([-7, 0]\).
Piece #2: \((2, 8)\)
- \(g(2) = \frac {7}{4} \cdot 2 - 8 = -\frac {9}{2} \)
- \(g(8) = \frac {7}{4} \cdot 8 - 8 = 6 \)
The range of piece #2 is \(\left ( -\frac {9}{2}, 6 \right )\).
Note: The range of \(g\) is \([-7, 0] \cup \left ( -\frac {9}{2}, 6 \right ) = [-7, 6)\). However, we need to see what each piece is doing, so we’ll leave the range separated as a union.
First, let’s map the domain of \(T\) back to the range of \(g\). We need to see what each piece is doing. So, we’ll plot all of the pieces separately.
The range of \(g\) is: \([-7, 0] \cup \left ( -\frac {9}{2}, 6 \right )\)
The domain of \(T\): \((-4,-1] \cup [1, 7)\).
The intersection is \((-4, -1] \cup [1, 6)\).
These are the common intervals in both the domain of \(T\) and range of \(g\).
Now we need to connect these up to the domain of \(g\). Which parts of the domain of \(g\) does \(g\) map to these intervals?
Let’s follow the endpoints backwards through \(g\) to the domain of \(g\).
Focusing on the interval endpoints (included or excluded) of this intersection, we need the preimages of \(-4\), \(-1\), \(1\), and \(6\) in the domain of \(g\).
Preimages
\(g\) has two pieces and their individual ranges overlap. This means we will get two domain intervals for the same range interval.
Preimage of \((-4,-1]\)
\(\blacktriangleright \) The interval \((-4, -1]\) is in both pieces of the range of \(g\). It has a preimage from each piece. Let’s examine each piece separately.
Piece #1 \(-2x - 3\).
- What is the preimage of \(-4\)?
- What is the preimage of \(-1\)?
Graphically, we begin at \(-4\) on the vertical axis. It is the lowest endpoint. We follow it to the right to the graph of \(g\). Once we hit the graph, we move up until we hit the horizontal axis. Graphically, it appears to be around \(0.5\).
Graphically, we begin at \(-1\) on the vertical axis. It is the top endpoint of the lower interval. We follow it to the left to the graph of \(g\). Once we hit the graph, we move up until we hit the horizontal axis. Graphically, it appears to be around \(-1\).
Let’s see if our graphical approximations are close to the actual values.
\begin{align*} -2x-3 & = -4 \\ -2x & = -1 \\ x & = \frac {1}{2} \end{align*}
\begin{align*} -2x-3 & = -1 \\ -2x & = 2 \\ x & = -1 \end{align*}
We get the domain interval \(\left [ -1, \frac {1}{2} \right )\).
The function \(g\) maps the domain interval \(\left [ -1, \frac {1}{2} \right )\) to the range interval \((-4, -1]\), which is inside the domain of \(T\).
Piece #2:
The other piece of \(g\) is \(\frac {7}{4}x - 8\).
What is the preimage of \((-4, -1]\)?
- What is the preimage of \(-4\)?
- What is the preimage of \(-1\)?
Graphically, we begin at \(-4\) on the vertical axis. It is the lowest endpoint. We follow it to the right to the other piece of the graph of \(g\). Once we hit the graph, we move up until we hit the horizontal axis. Graphically, it appears to be around \(2.25\).
Graphically, we begin at \(-1\) on the vertical axis. It is the top endpoint of the lower interval. We follow it to the right to the graph of \(g\). Once we hit the graph, we move up until we hit the horizontal axis. Graphically, it appears to be around \(4\).
Let’s see if our graphical approximations are close to the actual values.
\begin{align*} \frac {7}{4}x - 8 & = -4 \\ \frac {7}{4}x & = 4 \\ x & = \frac {16}{7} \approx 2.3 \end{align*}
\begin{align*} \frac {7}{4}x - 8 & = -1 \\ \frac {7}{4}x & = 7 \\ x & = 4 \end{align*}
We get the interval \(\left ( \frac {16}{7}, 4 \right ]\).
The function \(g\) maps the domain interval \(\left ( \frac {16}{7}, 4 \right ]\) to the range interval \((-4,-1]\), which is inside the domain of \(T\).
That was one of the domain intervals of \(T\).
Now for the other interval in the domain of \(T\).
\(\blacktriangleright \) The range interval \([1, 6)\) of \(g\) has a preimage on only one piece.
\(1\) and \(6\) have preimages only through \(g(x) = -2x-3\).
- What is the preimage of \(1\)?
- What is the preimage of \(6\)?
Graphically, we begin at \(1\) on the vertical axis. It is the lower endpoint of the top interval. We follow it to the right to the larger piece of the graph of \(g\). Once we hit the graph, we move down until we hit the horizontal axis. Graphically, it appears to be around \(5\).
Graphically, we begin at \(6\) on the vertical axis. It is the upper endpoint of the top interval of our intersection (not the top of \(g\), but the top of our common interval). We follow it to the right to the graph of \(g\). Once we hit the graph, we move down until we hit the horizontal axis. Graphically, it appears to be around \(8\).
Let’s see if our graphical approximations are close to the actual values.
\begin{align*} \frac {7}{4}x - 8 & = 1 \\ \frac {7}{4}x & = 9 \\ x & = \frac {36}{7} \approx 5.1 \end{align*}
\begin{align*} \frac {7}{4}x - 8 & = 6 \\ \frac {7}{4}x & = 14 \\ x & = 8 \end{align*}
We get the interval \(\left [ \frac {36}{7}, 8 \right )\).
The function \(g\) maps the domain interval \(\left [ \frac {16}{7}, 4 \right )\) to the range interval \([1,6)\), which is inside the domain of \(T\).
The domain of \(T \circ g\) is \(\left ( -1, \frac {1}{2} \right ] \cup \left ( \frac {16}{7}, 4 \right ] \cup \left [ \frac {36}{7}, 8 \right )\)
This is inside the full domain of \(g\). It is not the full domain of \(g\). We needed to leave some domain numbers out, because the full domain of \(g\) would give the full range of \(g\), which was bigger than the domain of \(T\).
There are three pieces to the domain of our composition:
- \(\left [ -1, \frac {1}{2} \right )\)
- \(\left ( \frac {16}{7}, 4 \right ]\)
- \(\left [ \frac {36}{7}, 8 \right )\)
The composition will have a formula for each piece.
We have a composition: \(T \circ g\). We know this is a piecewise linear function, because it is the composition of two piecewise linear functions.
Our composition has a piecewise defined formula, let’s use \(c\) for its variable.
\(\blacktriangleright \) On \(\left [ -1, \frac {1}{2} \right )\)
- the formula for \(g(x)\) is \(\answer {-2x-3}\)
- the image of \(g(x)\) on \(\left [ -1, \frac {1}{2} \right )\) is \(\left ( \answer {-4}, \answer {-1} \right ]\)
- On \(( -4, -1 ]\), the formula for \(T(v) = \answer {2v-1}\)
- \((T \circ g)(c) = 2 \left (\answer {-2c-3}\right ) - 1 = -4c - 7\)
\(\blacktriangleright \) On \(\left ( \frac {16}{7}, \answer {4} \right ]\)
- the formula for \(g(x)\) is \(\answer {\frac {7}{4}x - 8}\)
- the image of \(g(x)\) on \(\left ( \frac {16}{7}, 4 \right ]\) is \(\left ( \answer {-4}, \answer {-1} \right ]\)
- On \(( -4, -1 ]\), the formula for \(T(v) = \answer {2v-1}\)
- \((T \circ g)(c) = 2\left (\answer {\frac {7}{4}c - 8}\right ) - 1 = \frac {7}{2}c - 17\)
\(\blacktriangleright \) On \(\left [ \frac {36}{7}, \answer {8} \right )\)
- the formula for \(g(x)\) is \(\answer {\frac {7}{4}x - 8}\)
- the image of \(g(x)\) on \(\left [ \frac {36}{7}, 8 \right )\) is \(\left [ \answer {1}, \answer {6} \right )\)
- On \([ 1, 6 )\), the formula for \(T(v) = \answer {-v + 3}\)
- \((T \circ g)(c) = -\left (\answer {\frac {7}{4}c - 8}\right ) + 3 = -\frac {7}{4}c + 11\)
ooooo-=-=-=-ooOoo-=-=-=-ooooo
more examples can be found by following this link
More Examples of Piecewise Composition