Piecewise Functions#
Definition#
Definition
A piecewise function is a function whose domain is broken up into several subintervals and a different rule is used to define the function on each subinterval.
Example 1#
A piecewise defined function
Movie theaters frequently offer discounted ticket prices for shows that start before 4:00 pm. If we let \(p(t)\) represent the price of a ticket for a movie that starts at time \(t\), then we could use the following notation to describe the scenario where a ticket costs 6 dollars if the movie starts before 4:00 pm and costs 10 dollars if the movie starts at 4:00 pm or later.
Example 2#
Evaluate a piecewise function
Evaluate the following piecewise function at \(-1\), \(0\) and \(1\).
Step 1: Evaluate \(f(-1)\).
Since \(-1 < 0\), use \(f(x) = x^2 + 1\) to evaluate \(f(-1)\).
Step 2: Evaluate \(f(0)\).
Since \(x = 0\), \(f(0) = 3\).
Step 3: Evaluate \(f(1)\).
Since \(1 > 0\), use \(f(x) = \sqrt{x+4}\) to evaluate \(f(1)\).
Example 3#
Evaluate a piecewise function
Evaluate the following piecewise function at \(4\), \(5\) and \(6\).
Step 1: Evaluate \(g(4)\).
Since \(4 \neq 5\), use \(g(x) = \dfrac{x^2 - 25}{x-5}\) to evaluate \(g(4)\).
Step 2: Evaluate \(g(5)\).
Since \(x = 5\), \(g(5) = 0\).
Step 3: Evaluate \(g(6)\).
Since \(6 \neq 5\), use \(g(x) = \dfrac{x^2 - 25}{x-5}\) to evaluate \(g(6)\).