A piecewise defined function is a function that is written with multiple equations over different intervals of the domain.
An absolute value function of the form \(f\left(x\right)=a\left|x-h\right|+k\) where \(a\) determine the width of the function and whether the function is a reflection or not, and the vertex is at \(\left(h,k\right)\). The piecewise defined function of an absolute value function is written in the form \(f(x) = \begin{cases} -a|x-h|+k & x <h \\ a|x-h|+k & x \ge h \end{cases}\). Notice that the domain is restricted based on the \(x\)-value of the vertex and that one of the inequalities is simply, less than, and the other is, greater than or equal to. It doesn’t matter which piece of the graph has a domain with or equal to, as long as only of them does.
Example 1: Write the piecewise defined function for \(f\left(x\right)=\left|3-x\right|+4\).
Notice that the absolute value quantity is not in the form \(x-h\). We will re-write it to be in this form, but this step is not necessary.
\(\begin{align}&\left|-x+3\right|\ & \ \ \ & \text{1) Use the commutative property of addition to re-write the quantity.}\\
&\left|-\left(x-3\right)\right|\ & \ \ \ & \text{2) Factor out -1.}\\
&\left|x-3\right|\ & \ \ \ & \text{3) The absolute value of -1 is 1. Therefore}\ \left|3-x\right|=\left|x-3\right|.\end{align}\)
Now we’ll write equation piece of the equation, one at a time.
First piece: We’ll start with the left, decreasing piece of the absolute value function. Begin by multiply the quantity in the absolute value, by \(-1\).
\(-\left(x-3\right)+4\)
\(-x+3+4\)
\(-x+7\) This is the expression for the left side of the function, where \(x<3\)
Second piece: This piece will be the right side of the function, thus it is the increasing side. The quantity in the absolute value will remain positive to make the graph increase.
\(\left(x-3\right)+4\)
\(x+1\) This is the expression for the right side of the function, where \(x \ge 3\)
Not all of our questions ask us to write the piecewise function,sometimes we’re only asked about a certain piece of the function.
Example 2: Simplify \(f\left(x\right)=-\left|x+6\right|-2\) if \(x>-1\).
First observe that the \(a\) value is negative, meaning this graph is a reflection. The piece left of the vertex will be increasing and the piece right of the vertex will be decreasing. The vertex is at \(\left(-6,-2\right)\). One piece will have a domain of \(x<-6\) and the other piece will have a domain of \(x \ge -6\). In this problem, we want to work with the piece \(x \ge -6\) because of the restriction in the problem saying “if \(x>-1\).” Therefore we’re working with the decreasing piece of the function.
\(-\left(x+6\right)-2\)
\(-x-6-2\)
\(-x-8\)
\(-x-8\) is the solution because it is the simplified expression for the piece of the graph that satisfies the restriction \(x>-1\).