Since our function has multiple formulas and requirements for when we use which formula, the notation is a bit longer. Here is an example of a piecewise function:
\begin{equation*}
f(x) = \begin{cases}2x+3 \amp x \gt 4 \\ x^2+7 \amp -1 \lt x \le 4 \\ \sqrt{3-x} \amp x \le -1 \end{cases}
\end{equation*}
To evaluate the function, we actually start on the right. The column on the right that has \(x \gt 4\text{,}\)\(-1 \lt x \le 4\text{,}\) and \(x \ge -1\) is the part that tells us when to use which formula. Once we know which formula to use, thatβs when we move to the left to actually use the formula.
To find \(f(0)\text{,}\) we know that our input is \(0\text{.}\) So, we look on the right side and see that \(0\) fits into the middle inequality, since \(0\) is between \(-1\) and \(4\text{.}\) That tells us that we want to plug \(0\) into the middle equation. Therfore, \(f(0) = (0)^2+7 = 7\text{.}\)
To find \(f(-2)\text{,}\) we know that our input is \(-2\text{.}\) So, we look on the right side and see that \(-2\) fits into the last inequality, since \(-2\) is less than \(-1\text{.}\) That tells us that we want to plug \(-2\) into the last equation. Therfore, \(f(-2) = \sqrt{3-(-2)} = \sqrt{3+2}=\sqrt{5}\text{.}\)
To find \(f(10)\text{,}\) we know that our input is \(10\text{.}\) So, we look on the right side and see that \(10\) fits into the first inequality, since \(10\) is greater than \(4\text{.}\) That tells us that we want to plug \(10\) into the first equation. Therfore, \(f(10) = 2(10)+3 = 23\text{.}\)
To find \(f(4)\text{,}\) we know that our input is \(4\text{.}\) So, we look on the right side to see which inequality \(4\) fits into. Notice that the first inequality is only the numbers greater than \(4\text{,}\) which doesnβt include \(4\) itself. However, the middle equation has \(x \le 4\text{,}\) which does include \(4\text{.}\) That tells us that we want to plug \(4\) into the middle equation. Therfore, \(f(4) = (4)^2+7 = 16+7=23\text{.}\)
\begin{equation*}
p(x)=\begin{cases}3-x \amp x \gt 2 \\ 42 \amp x=2 \\ x^2 \amp x \lt 2\end{cases}
\end{equation*}
Evaluate each of the following:
To find \(f(1)\text{,}\) we know that our input is \(1\text{.}\) So, we look on the right side and see that \(1\) fits into the last inequality, since \(1\) is less than \(2\text{.}\) That tells us that we want to plug \(1\) into the last equation. Therfore, \(f(1) = (1)^2=1\text{.}\)
To find \(f(-3)\text{,}\) we know that our input is \(-3\text{.}\) So, we look on the right side and see that \(-3\) fits into the last inequality, since \(-3\) is less than \(2\text{.}\) That tells us that we want to plug \(-3\) into the last equation. Therfore, \(f(-3) = (-3)^2=9\text{.}\)
To find \(f(2)\text{,}\) we know that our input is \(2\text{.}\) So, we look on the right side and see that \(2\) fits into the middle, that one is just \(x=2\text{.}\) That tells us that we want to plug \(-2\) into the middle equation, which is a constant function. Therfore, \(f(2) = 42\text{.}\)
To find \(f(4)\text{,}\) we know that our input is \(4\text{.}\) So, we look on the right side and see that \(4\) fits into the first inequality, since \(4\) is greater than \(2\text{.}\) That tells us that we want to plug \(4\) into the first equation. Therfore, \(f(4) = 3-(4)=-1\text{.}\)