You are not limited to functions defined by a single algebraic expression. Frequently engineers need to model situations that are quite complex and might require sudden changes in behavior. A piecewise-defined function is a function defined by multiple expressions, each assigned to a particular portion of the functionβs domain indicated by some logical condition.
evaluating at \(x = 3\text{,}\) we note that \(0 \leq 3 \lt 3\) is false, but \(3 \leq 3 \lt 5\) is true so that \(f(3) = -2(3-5) = -2(-2) = 4\text{.}\)
evaluating at \(x = -10\text{,}\) we note that none of the conditions are true for this value so that \(f(-10)\) is undefined and \(x=-10\) is not in the domain of \(f\text{.}\)
To graph \(y=f(x)\text{,}\) sketch the graph of each expression, but only on the domain indicated by its companion condition. In our example, there are three βpiecesβ to the graph. Iβve plotted each only on its domain indicated by the conditional.
Notice the use of a hole or dot, depending on the inequality \(\lt\) or \(\leq\) Combining them we obtain the graph of \(y=f(x)\)
From this, we conclude that the range of \(f\) is \([0,4]\text{.}\) Finally, observe how the graph is continuous in that the piecewise join together at points and may be drawn without lifting our pencil up at any point.
When defining a piecewise-defined function, we must ensure that the conditions donβt conflict. A given real number must satisfy at most one of the statements. For example, the following is not a function:
\begin{equation*}
\begin{cases}
4,& \text{if $0 \leq x \leq 3$} \\
2,& \text{if $3 \leq x \lt 5$} \\
\end{cases}
\end{equation*}
because \(x=3\) satisfies both conditions resulting in conflicting values. This does not satisfy the uniqueness of outputs required in DefinitionΒ 7.1.2.
There are two pieces, \(y=x^2\) and \(y=x-2\text{.}\) Plot them individually, but restrict your attention to the interval they are defined on. Use a dot or hole depending on the inequality.
There is a βcatchallβ that assigns one to any other value of \(x\text{.}\) For example, \(f(0) = 1\) because neither condition applies to zero. Putting it all together:
The domain is \((-\infty,+\infty)\) and the range is \((-2,+\infty)\text{.}\)
Recall that a zero is a solution to \(P(x) = 0\text{.}\) We should attempt to find zeros of each expression defining \(P\text{,}\) but only on the interval where it applies.
Solving \(4-x^2 = 0\) results in \(x=\pm 2\text{,}\) but only \(x=-2\) satisfies \(-4\leq x \lt 1\text{.}\) Thus, \(x=-2\) is a zero of \(P\text{,}\) but \(x=2\) is not.