Piecewise-Defined Functions
Piecewise-Defined Functions
INTRO A piecewise function exists when a function is defined by two or more different functions throughout its domain. The first step in evaluating a piecewise function is to determine which function definition applies depending on the value of x that is being input. Once that has been determined, we evaluate the function as usual by substituting in the given value of x. _______________________________________________________________________ x if x < 0 , find f (-1), f (0), and f (1) Example: Given f ( x) = 2 x + 1 if x 0
Solution: First, we want to evaluate f at x = 1 , so f ( x) = x is the equation to use (since it applies whenever x < 0 ). f ( x) = x f (1) = (1)
f (1) = 1 Next, we want to evaluate f at x = 0 , so f ( x) = x 2 + 1 is the equation to use (since it applies whenever x 0 ). f ( x) = x 2 + 1
f (0) = 0 2 + 1 f (0) = 1
ABSOLUTE VALUE FUNCTIONS An absolute value function can be rewritten as a piecewise function. Absolute value is the distance from a number x to 0 on the real number line. Therefore, when the value of a function is equal to zero or is positive, taking its absolute value doesnt change it; however if the value is negative, taking its absolute value changes the sign. Therefore, the definition of the function changes depending on whether or not x 0 . x if x 0 y= x = x if x < 0
_______________________________________________________________________ Example: Write y = x 2 as a piecewise function and evaluate f (0), f (2), and f (5).
Solution:
x 2 if x 2 0 or x 2 y = x2 = ( x 2) if x 2 < 0 or x < 2